diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +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 - -# 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 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +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 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 19fd145..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/count-if) 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 334a901..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/count-if) 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 567ed9b..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: '1 1 * * 5' - - # 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 f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +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 status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # 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 + + ```
@@ -242,7 +233,7 @@ console.log( out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.10d_blocked_columnmajor.js b/benchmark/benchmark.10d_blocked_columnmajor.js deleted file mode 100644 index 13da6ab..0000000 --- a/benchmark/benchmark.10d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_blocked_rowmajor.js b/benchmark/benchmark.10d_blocked_rowmajor.js deleted file mode 100644 index 10a65ed..0000000 --- a/benchmark/benchmark.10d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_columnmajor.js b/benchmark/benchmark.10d_columnmajor.js deleted file mode 100644 index da59616..0000000 --- a/benchmark/benchmark.10d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_rowmajor.js b/benchmark/benchmark.10d_rowmajor.js deleted file mode 100644 index 2008fa1..0000000 --- a/benchmark/benchmark.10d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_columnmajor.js b/benchmark/benchmark.11d_columnmajor.js deleted file mode 100644 index db189e9..0000000 --- a/benchmark/benchmark.11d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_rowmajor.js b/benchmark/benchmark.11d_rowmajor.js deleted file mode 100644 index b70f6e7..0000000 --- a/benchmark/benchmark.11d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_columnmajor.js b/benchmark/benchmark.1d_columnmajor.js deleted file mode 100644 index 4bc2f9e..0000000 --- a/benchmark/benchmark.1d_columnmajor.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( [ x ], clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_rowmajor.js b/benchmark/benchmark.1d_rowmajor.js deleted file mode 100644 index 9707de4..0000000 --- a/benchmark/benchmark.1d_rowmajor.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( [ x ], clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_columnmajor.js b/benchmark/benchmark.2d_blocked_columnmajor.js deleted file mode 100644 index 6f3430b..0000000 --- a/benchmark/benchmark.2d_blocked_columnmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_rowmajor.js b/benchmark/benchmark.2d_blocked_rowmajor.js deleted file mode 100644 index 9cc9d85..0000000 --- a/benchmark/benchmark.2d_blocked_rowmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_columnmajor.js b/benchmark/benchmark.2d_columnmajor.js deleted file mode 100644 index a522d4d..0000000 --- a/benchmark/benchmark.2d_columnmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor.js b/benchmark/benchmark.2d_rowmajor.js deleted file mode 100644 index f92060d..0000000 --- a/benchmark/benchmark.2d_rowmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor_accessors.js b/benchmark/benchmark.2d_rowmajor_accessors.js deleted file mode 100644 index 7e08001..0000000 --- a/benchmark/benchmark.2d_rowmajor_accessors.js +++ /dev/null @@ -1,170 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/2d_accessors.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Returns an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @returns {*} element -*/ -function get( buf, idx ) { - return buf[ idx ]; -} - -/** -* Sets an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @param {*} value - value to set -*/ -function set( buf, idx, value ) { - buf[ idx ] = value; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::accessors:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::accessors:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::accessors:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_columnmajor.js b/benchmark/benchmark.3d_blocked_columnmajor.js deleted file mode 100644 index 76acdaa..0000000 --- a/benchmark/benchmark.3d_blocked_columnmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_rowmajor.js b/benchmark/benchmark.3d_blocked_rowmajor.js deleted file mode 100644 index c1ece9d..0000000 --- a/benchmark/benchmark.3d_blocked_rowmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_columnmajor.js b/benchmark/benchmark.3d_columnmajor.js deleted file mode 100644 index f521c9e..0000000 --- a/benchmark/benchmark.3d_columnmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_rowmajor.js b/benchmark/benchmark.3d_rowmajor.js deleted file mode 100644 index d756a5d..0000000 --- a/benchmark/benchmark.3d_rowmajor.js +++ /dev/null @@ -1,144 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_columnmajor.js b/benchmark/benchmark.4d_blocked_columnmajor.js deleted file mode 100644 index c716f65..0000000 --- a/benchmark/benchmark.4d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_rowmajor.js b/benchmark/benchmark.4d_blocked_rowmajor.js deleted file mode 100644 index b85aa30..0000000 --- a/benchmark/benchmark.4d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_columnmajor.js b/benchmark/benchmark.4d_columnmajor.js deleted file mode 100644 index 3c70f34..0000000 --- a/benchmark/benchmark.4d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_rowmajor.js b/benchmark/benchmark.4d_rowmajor.js deleted file mode 100644 index 89a89de..0000000 --- a/benchmark/benchmark.4d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_columnmajor.js b/benchmark/benchmark.5d_blocked_columnmajor.js deleted file mode 100644 index 44b2206..0000000 --- a/benchmark/benchmark.5d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_rowmajor.js b/benchmark/benchmark.5d_blocked_rowmajor.js deleted file mode 100644 index 23cfb30..0000000 --- a/benchmark/benchmark.5d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_columnmajor.js b/benchmark/benchmark.5d_columnmajor.js deleted file mode 100644 index 71e4b39..0000000 --- a/benchmark/benchmark.5d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_rowmajor.js b/benchmark/benchmark.5d_rowmajor.js deleted file mode 100644 index 5eb1457..0000000 --- a/benchmark/benchmark.5d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_columnmajor.js b/benchmark/benchmark.6d_blocked_columnmajor.js deleted file mode 100644 index bff301e..0000000 --- a/benchmark/benchmark.6d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_rowmajor.js b/benchmark/benchmark.6d_blocked_rowmajor.js deleted file mode 100644 index eab23f4..0000000 --- a/benchmark/benchmark.6d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_columnmajor.js b/benchmark/benchmark.6d_columnmajor.js deleted file mode 100644 index 652ef02..0000000 --- a/benchmark/benchmark.6d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_rowmajor.js b/benchmark/benchmark.6d_rowmajor.js deleted file mode 100644 index da9b204..0000000 --- a/benchmark/benchmark.6d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_columnmajor.js b/benchmark/benchmark.7d_blocked_columnmajor.js deleted file mode 100644 index 951c294..0000000 --- a/benchmark/benchmark.7d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_rowmajor.js b/benchmark/benchmark.7d_blocked_rowmajor.js deleted file mode 100644 index 9753824..0000000 --- a/benchmark/benchmark.7d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_columnmajor.js b/benchmark/benchmark.7d_columnmajor.js deleted file mode 100644 index 4426a76..0000000 --- a/benchmark/benchmark.7d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_rowmajor.js b/benchmark/benchmark.7d_rowmajor.js deleted file mode 100644 index f3841df..0000000 --- a/benchmark/benchmark.7d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_columnmajor.js b/benchmark/benchmark.8d_blocked_columnmajor.js deleted file mode 100644 index 303b0e9..0000000 --- a/benchmark/benchmark.8d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_rowmajor.js b/benchmark/benchmark.8d_blocked_rowmajor.js deleted file mode 100644 index 303b0e9..0000000 --- a/benchmark/benchmark.8d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_columnmajor.js b/benchmark/benchmark.8d_columnmajor.js deleted file mode 100644 index 09022da..0000000 --- a/benchmark/benchmark.8d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_rowmajor.js b/benchmark/benchmark.8d_rowmajor.js deleted file mode 100644 index d720d9b..0000000 --- a/benchmark/benchmark.8d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_columnmajor.js b/benchmark/benchmark.9d_blocked_columnmajor.js deleted file mode 100644 index 69c5262..0000000 --- a/benchmark/benchmark.9d_blocked_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_rowmajor.js b/benchmark/benchmark.9d_blocked_rowmajor.js deleted file mode 100644 index 3d20f03..0000000 --- a/benchmark/benchmark.9d_blocked_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+'::blocked:ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_columnmajor.js b/benchmark/benchmark.9d_columnmajor.js deleted file mode 100644 index e2bfc63..0000000 --- a/benchmark/benchmark.9d_columnmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_rowmajor.js b/benchmark/benchmark.9d_rowmajor.js deleted file mode 100644 index 68ea0c6..0000000 --- a/benchmark/benchmark.9d_rowmajor.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 isNumber = require( '@stdlib/assert-is-number' ).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 pkg = require( './../package.json' ).name; -var countIf = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Callback function. -* -* @param {*} value - ndarray element -* @returns {boolean} result -*/ -function clbk( value ) { - return value > 0.0; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100 ); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = countIf( x, clbk ); - if ( typeof out !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( out ) ) { - b.fail( 'should return a number' ); - } - 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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+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( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+order+',xtype='+t1, f ); - } - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 59c3566..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/count-if" -%% click B href "https://github.com/stdlib-js/ndarray-base-count-if/tree/main" -%% click C href "https://github.com/stdlib-js/ndarray-base-count-if/tree/production" -%% click D href "https://github.com/stdlib-js/ndarray-base-count-if/tree/esm" -%% click E href "https://github.com/stdlib-js/ndarray-base-count-if/tree/deno" -%% click F href "https://github.com/stdlib-js/ndarray-base-count-if/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/count-if -[production-url]: https://github.com/stdlib-js/ndarray-base-count-if/tree/production -[deno-url]: https://github.com/stdlib-js/ndarray-base-count-if/tree/deno -[deno-readme]: https://github.com/stdlib-js/ndarray-base-count-if/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/ndarray-base-count-if/tree/umd -[umd-readme]: https://github.com/stdlib-js/ndarray-base-count-if/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/ndarray-base-count-if/tree/esm -[esm-readme]: https://github.com/stdlib-js/ndarray-base-count-if/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 59076d8..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import countIf from '../docs/types/index'; -export = countIf; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 9de3f5a..0000000 --- a/dist/index.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict";var Z=function(a,N){return function(){return N||a((N={exports:{}}).exports,N),N.exports}};var cr=Z(function(hs,ur){ -var Ja=require('@stdlib/ndarray-base-nullary-loop-interchange-order/dist'),Qa=require('@stdlib/ndarray-base-nullary-tiling-block-size/dist'),Va=require('@stdlib/array-base-take-indexed/dist'),Wa=require('@stdlib/array-base-reverse/dist');function Ya(a,N,w){var j,r,S,T,C,g,z,I,k,b,u,f,o,v,e,n,i,t,p;for(p=Ja(a.shape,a.strides),k=p.sh,f=p.sx,T=Wa(p.idx),r=Qa(a.dtype),o=a.offset,S=a.data,g=f[0],C=a.accessors[0],j=0,t=k[1];t>0;)for(t0;)for(i0;)for(s0;)for(q0;)for(d0;)for(D0;)for(O0;)for(l0;)for(h0;)for(_0;)for(E0;)for(P0;)for(m0;)for(y0;)for(L0;)for(K0;)for(U0;)for(M0;)for(B0;)for(_0;)for(H0;)for(X0;)for(R0;)for(G0;)for(F0;)for(L0;)for(K0;)for(Y0;)for(W0;)for(V0;)for(Q0;)for(J0;)for(H0;)for(X0;)for(R0;)for(vr0;)for(ar0;)for(rr0;)for(A0;)for($0;)for(Y0;)for(W0;)for(V0;)for(Q0;)for(fr0;)for(sr0;)for(ir0;)for(or0;)for(er0;)for(vr0;)for(ar0;)for(rr0;)for(A0;)for($0;)for(i0;)for(n0;)for(q0;)for(d0;)for(x0;)for(O0;)for(l0;)for(h0;)for(c0;)for(E0;)for(P0;)for(m0;)for(y0;)for(D0;)for(K0;)for(U0;)for(M0;)for(B0;)for(_0;)for(E0;)for(X0;)for(R0;)for(G0;)for(F0;)for(L0;)for(K0;)for(U0;)for(W0;)for(V0;)for(Q0;)for(J0;)for(H0;)for(X0;)for(R0;)for(G0;)for(ar0;)for(rr0;)for(A0;)for($0;)for(Y0;)for(W0;)for(V0;)for(Q0;)for(J0;)for(sr0;)for(ir0;)for(or0;)for(er0;)for(vr0;)for(ar0;)for(rr0;)for(A0;)for($0;)for(Y} x.accessors - data buffer accessors\n* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf2d( x, predicate );\n* // returns 3\n*/\nfunction blockedCountIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf2d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf3d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf3d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf4d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf4d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf5d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf5d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf6d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf6d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf7d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf7d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf8d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf8d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf9d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf9d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf10d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf10d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf2d( x, predicate );\n* // returns 3\n*/\nfunction blockedCountIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf2d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf3d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf3d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf4d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf4d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf5d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf5d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf6d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf6d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf7d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf7d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf8d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf8d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf9d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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\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n// EXPORTS //\n\nmodule.exports = blockedCountIf9d;\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' );\nvar take = require( '@stdlib/array-base-take-indexed' );\nvar reverse = require( '@stdlib/array-base-reverse' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf10d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 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\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedCountIf10d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\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* 'ref': null,\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* // Perform operation:\n* var out = countIf0d( x, predicate );\n* // returns 1\n*/\nfunction countIf0d( x, predicate, thisArg ) {\n\tif ( predicate.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ) { // eslint-disable-line max-len\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf0d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIf1d( x, predicate );\n* // returns 3\n*/\nfunction countIf1d( x, predicate, thisArg ) {\n\tvar count;\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#, 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// Initialize a counter:\n\tcount = 0;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( predicate.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref) ) {\n\t\t\tcount += 1;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf1d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIf2d( x, predicate );\n* // returns 3\n*/\nfunction countIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf2d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf3d( x, predicate );\n* // returns 7\n*/\nfunction countIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf3d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf4d( x, predicate );\n* // returns 7\n*/\nfunction countIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf4d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf5d( x, predicate );\n* // returns 7\n*/\nfunction countIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf5d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf6d( x, predicate );\n* // returns 7\n*/\nfunction countIf6d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf6d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf7d( x, predicate );\n* // returns 7\n*/\nfunction countIf7d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf7d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf8d( x, predicate );\n* // returns 7\n*/\nfunction countIf8d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf8d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf9d( x, predicate );\n* // returns 7\n*/\nfunction countIf9d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf9d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf10d( x, predicate );\n* // returns 7\n*/\nfunction countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf10d;\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' );\nvar ind2sub = require( '@stdlib/ndarray-base-ind2sub' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIfnd( x, predicate );\n* // returns 3\n*/\nfunction countIfnd( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar ordx;\n\tvar idx;\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 input 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// Initialize a counter:\n\tcount = 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\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tif ( predicate.call( thisArg, get( xbuf, ix ), idx, x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIfnd;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf0d( x, predicate );\n* // returns 1\n*/\nfunction countIf0d( x, predicate, thisArg ) {\n\tif ( predicate.call( thisArg, x.data[ x.offset ], [], x.ref ) ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf0d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf1d( x, predicate );\n* // returns 3\n*/\nfunction countIf1d( x, predicate, thisArg ) {\n\tvar count;\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// Initialize a counter:\n\tcount = 0;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( predicate.call( thisArg, xbuf[ ix ], [ i0 ], x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf1d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf2d( x, predicate );\n* // returns 3\n*/\nfunction countIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf2d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf3d( x, predicate );\n* // returns 5\n*/\nfunction countIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf3d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf4d( x, predicate );\n* // returns 5\n*/\nfunction countIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf4d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf5d( x, predicate );\n* // returns 5\n*/\nfunction countIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf5d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf6d( x, predicate );\n* // returns 5\n*/\nfunction countIf6d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf6d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf7d( x, predicate );\n* // returns 5\n*/\nfunction countIf7d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf7d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf8d( x, predicate );\n* // returns 5\n*/\nfunction countIf8d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf8d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf9d( x, predicate );\n* // returns 5\n*/\nfunction countIf9d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf9d;\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' );\nvar zeroTo = require( '@stdlib/array-base-zero-to' );\nvar reverse = require( '@stdlib/array-base-reverse' );\nvar take = require( '@stdlib/array-base-take-indexed' );\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf10d( x, predicate );\n* // returns 5\n*/\nfunction countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf10d;\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' );\nvar ind2sub = require( '@stdlib/ndarray-base-ind2sub' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIfnd( x, predicate );\n* // returns 3\n*/\nfunction countIfnd( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar ordx;\n\tvar idx;\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 input 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// Initialize a counter:\n\tcount = 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\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tif ( predicate.call( thisArg, xbuf[ ix ], idx, x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIfnd;\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 iterationOrder = require( '@stdlib/ndarray-base-iteration-order' );\nvar ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' );\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar blockedaccessorcount2d = require( './2d_blocked_accessors.js' );\nvar blockedaccessorcount3d = require( './3d_blocked_accessors.js' );\nvar blockedaccessorcount4d = require( './4d_blocked_accessors.js' );\nvar blockedaccessorcount5d = require( './5d_blocked_accessors.js' );\nvar blockedaccessorcount6d = require( './6d_blocked_accessors.js' );\nvar blockedaccessorcount7d = require( './7d_blocked_accessors.js' );\nvar blockedaccessorcount8d = require( './8d_blocked_accessors.js' );\nvar blockedaccessorcount9d = require( './9d_blocked_accessors.js' );\nvar blockedaccessorcount10d = require( './10d_blocked_accessors.js' );\nvar blockedcount2d = require( './2d_blocked.js' );\nvar blockedcount3d = require( './3d_blocked.js' );\nvar blockedcount4d = require( './4d_blocked.js' );\nvar blockedcount5d = require( './5d_blocked.js' );\nvar blockedcount6d = require( './6d_blocked.js' );\nvar blockedcount7d = require( './7d_blocked.js' );\nvar blockedcount8d = require( './8d_blocked.js' );\nvar blockedcount9d = require( './9d_blocked.js' );\nvar blockedcount10d = require( './10d_blocked.js' );\nvar accessorcount0d = require( './0d_accessors.js' );\nvar accessorcount1d = require( './1d_accessors.js' );\nvar accessorcount2d = require( './2d_accessors.js' );\nvar accessorcount3d = require( './3d_accessors.js' );\nvar accessorcount4d = require( './4d_accessors.js' );\nvar accessorcount5d = require( './5d_accessors.js' );\nvar accessorcount6d = require( './6d_accessors.js' );\nvar accessorcount7d = require( './7d_accessors.js' );\nvar accessorcount8d = require( './8d_accessors.js' );\nvar accessorcount9d = require( './9d_accessors.js' );\nvar accessorcount10d = require( './10d_accessors.js' );\nvar accessorcountnd = require( './nd_accessors.js' );\nvar count0d = require( './0d.js' );\nvar count1d = require( './1d.js' );\nvar count2d = require( './2d.js' );\nvar count3d = require( './3d.js' );\nvar count4d = require( './4d.js' );\nvar count5d = require( './5d.js' );\nvar count6d = require( './6d.js' );\nvar count7d = require( './7d.js' );\nvar count8d = require( './8d.js' );\nvar count9d = require( './9d.js' );\nvar count10d = require( './10d.js' );\nvar countnd = require( './nd.js' );\n\n\n// VARIABLES //\n\nvar COUNT = [\n\tcount0d,\n\tcount1d,\n\tcount2d,\n\tcount3d,\n\tcount4d,\n\tcount5d,\n\tcount6d,\n\tcount7d,\n\tcount8d,\n\tcount9d,\n\tcount10d\n];\nvar ACCESSOR_COUNT = [\n\taccessorcount0d,\n\taccessorcount1d,\n\taccessorcount2d,\n\taccessorcount3d,\n\taccessorcount4d,\n\taccessorcount5d,\n\taccessorcount6d,\n\taccessorcount7d,\n\taccessorcount8d,\n\taccessorcount9d,\n\taccessorcount10d\n];\nvar BLOCKED_COUNT = [\n\tblockedcount2d, // 0\n\tblockedcount3d,\n\tblockedcount4d,\n\tblockedcount5d,\n\tblockedcount6d,\n\tblockedcount7d,\n\tblockedcount8d,\n\tblockedcount9d,\n\tblockedcount10d // 8\n];\nvar BLOCKED_ACCESSOR_COUNT = [\n\tblockedaccessorcount2d, // 0\n\tblockedaccessorcount3d,\n\tblockedaccessorcount4d,\n\tblockedaccessorcount5d,\n\tblockedaccessorcount6d,\n\tblockedaccessorcount7d,\n\tblockedaccessorcount8d,\n\tblockedaccessorcount9d,\n\tblockedaccessorcount10d // 8\n];\nvar MAX_DIMS = COUNT.length - 1;\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\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* @param {Function} predicate - predicate function\n* @param {thisArg} [thisArg] - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* // Perform operation:\n* var out = countIf( [ x ], predicate );\n* // returns 5\n*/\nfunction countIf( arrays, predicate, thisArg ) {\n\tvar ndims;\n\tvar shx;\n\tvar x;\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// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_COUNT[ ndims ]( x, predicate, thisArg );\n\t\t}\n\t\treturn COUNT[ ndims ]( x, predicate, thisArg );\n\t}\n\t// Check whether we were provided an empty ndarray...\n\tif ( numel( shx ) === 0 ) {\n\t\treturn true;\n\t}\n\t// Determine whether we can avoid blocked iteration...\n\tif ( ndims <= MAX_DIMS && iterationOrder( x.strides ) !== 0 ) {\n\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\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_COUNT[ ndims ]( x, predicate, thisArg );\n\t\t}\n\t\treturn COUNT[ ndims ]( x, predicate, thisArg );\n\t}\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_COUNT[ ndims-2 ]( x, predicate, thisArg );\n\t\t}\n\t\treturn BLOCKED_COUNT[ ndims-2 ]( x, predicate, thisArg );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol ) {\n\t\treturn accessorcountnd( x, predicate, thisArg );\n\t}\n\treturn countnd( x, predicate, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = countIf;\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* Count the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @module @stdlib/ndarray-base-count-if\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var countIf = require( '@stdlib/ndarray-base-count-if' );\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf( [ x ], predicate );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,GAAAC,GAAA,cAsBA,IAAIC,GAAY,QAAS,qDAAsD,EAC3EC,GAAY,QAAS,gDAAiD,EACtEC,GAAO,QAAS,iCAAkC,EAClDC,GAAU,QAAS,4BAA6B,EA0DpD,SAASC,GAAkBC,EAAGC,EAAWC,EAAU,CAClD,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EA6BJ,IAxBAA,EAAI1B,GAAWK,EAAE,MAAOA,EAAE,OAAQ,EAClCW,EAAKU,EAAE,GACPP,EAAKO,EAAE,GACPf,EAAMR,GAASuB,EAAE,GAAI,EAGrBjB,EAAQR,GAAWI,EAAE,KAAM,EAG3Be,EAAKf,EAAE,OAGPK,EAAOL,EAAE,KAGTQ,EAAMM,EAAG,CAAC,EAGVP,EAAMP,EAAE,UAAU,CAAC,EAGnBG,EAAQ,EAGFiB,EAAKT,EAAG,CAAC,EAAGS,EAAK,GAStB,IARKA,EAAKhB,GACTS,EAAKO,EACLA,EAAK,IAELP,EAAKT,EACLgB,GAAMhB,GAEPM,EAAMK,EAAOK,EAAGN,EAAG,CAAC,EACdK,EAAKR,EAAG,CAAC,EAAGQ,EAAK,GAetB,IAdKA,EAAKf,GACTQ,EAAKO,EACLA,EAAK,IAELP,EAAKR,EACLe,GAAMf,GAGPY,EAAKN,EAAQS,EAAGL,EAAG,CAAC,EAGpBL,EAAMK,EAAG,CAAC,EAAMF,EAAGE,EAAG,CAAC,EAGjBI,EAAK,EAAGA,EAAKL,EAAIK,IAAO,CAC7B,IAAMD,EAAK,EAAGA,EAAKL,EAAIK,IACjBhB,EAAU,KAAMC,EAASK,EAAKF,EAAMW,CAAG,EAAGnB,GAAM,CAAEuB,E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OS,CAAM,EAAGE,EAAGJ,EAAWC,CAAQ,EAGzCC,GAASL,GACRO,EAAE,iBACCR,GAAwBM,EAAM,CAAE,EAAGE,EAAGJ,EAAWC,CAAQ,EAE1DN,GAAeO,EAAM,CAAE,EAAGE,EAAGJ,EAAWC,CAAQ,EAGnDG,EAAE,iBACCxB,GAAiBwB,EAAGJ,EAAWC,CAAQ,EAExCT,GAASY,EAAGJ,EAAWC,CAAQ,CACvC,CAKAtD,GAAO,QAAUmD,KC/JjB,IAAIO,GAAO,KAKX,OAAO,QAAUA", - "names": ["require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedCountIf2d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "get", "dx0", "dx1", "ox1", "sh", "s0", "s1", "sx", "ox", "ix", "i0", "i1", "j0", "j1", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedCountIf3d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf4d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf5d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf6d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf7d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf8d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf9d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf10d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedCountIf2d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "dx0", "dx1", "ox1", "sh", "s0", "s1", "sx", "ox", "ix", "i0", "i1", "j0", "j1", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "take", "reverse", "blockedCountIf3d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf4d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf5d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf6d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf7d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf8d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf9d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "take", "reverse", "blockedCountIf10d", "x", "predicate", "thisArg", "count", "bsize", "xbuf", "idx", "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", "countIf0d", "x", "predicate", "thisArg", "require_d_accessors", "__commonJSMin", "exports", "module", "countIf1d", "x", "predicate", "thisArg", "count", "xbuf", "get", "dx0", "S0", "ix", "i0", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf2d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "get", "dx0", "dx1", "sh", "S0", "S1", "sx", "ix", "i0", "i1", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf3d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "get", "dx0", "dx1", "dx2", "sh", "S0", "S1", "S2", "sx", "ix", "i0", "i1", "i2", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf4d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "get", "dx0", "dx1", "dx2", "dx3", "sh", "S0", "S1", "S2", "S3", "sx", "ix", "i0", "i1", "i2", "i3", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf5d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf6d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf7d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf8d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf9d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf10d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "ind2sub", "MODE", "countIfnd", "x", "predicate", "thisArg", "count", "xbuf", "ordx", "idx", "len", "get", "sh", "sx", "ox", "ix", "i", "require_d", "__commonJSMin", "exports", "module", "countIf0d", "x", "predicate", "thisArg", "require_d", "__commonJSMin", "exports", "module", "countIf1d", "x", "predicate", "thisArg", "count", "xbuf", "dx0", "S0", "ix", "i0", "require_d", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf2d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "dx0", "dx1", "sh", "S0", "S1", "sx", "ix", "i0", "i1", "require_d", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf3d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "dx0", "dx1", "dx2", "sh", "S0", "S1", "S2", "sx", "ix", "i0", "i1", "i2", "require_d", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf4d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "dx0", "dx1", "dx2", "dx3", "sh", "S0", "S1", "S2", "S3", "sx", "ix", "i0", "i1", "i2", "i3", "require_d", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf5d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "dx0", "dx1", "dx2", "dx3", "dx4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "require_d", "__commonJSMin", "exports", "module", "strides2order", "zeroTo", "reverse", "take", "countIf6d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf7d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf8d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf9d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "zeroTo", "reverse", "take", "countIf10d", "x", "predicate", "thisArg", "count", "xbuf", "idx", "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", "ind2sub", "MODE", "countIfnd", "x", "predicate", "thisArg", "count", "xbuf", "ordx", "idx", "len", "sh", "sx", "ox", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "iterationOrder", "ndarray2object", "numel", "blockedaccessorcount2d", "blockedaccessorcount3d", "blockedaccessorcount4d", "blockedaccessorcount5d", "blockedaccessorcount6d", "blockedaccessorcount7d", "blockedaccessorcount8d", "blockedaccessorcount9d", "blockedaccessorcount10d", "blockedcount2d", "blockedcount3d", "blockedcount4d", "blockedcount5d", "blockedcount6d", "blockedcount7d", "blockedcount8d", "blockedcount9d", "blockedcount10d", "accessorcount0d", "accessorcount1d", "accessorcount2d", "accessorcount3d", "accessorcount4d", "accessorcount5d", "accessorcount6d", "accessorcount7d", "accessorcount8d", "accessorcount9d", "accessorcount10d", "accessorcountnd", "count0d", "count1d", "count2d", "count3d", "count4d", "count5d", "count6d", "count7d", "count8d", "count9d", "count10d", "countnd", "COUNT", "ACCESSOR_COUNT", "BLOCKED_COUNT", "BLOCKED_ACCESSOR_COUNT", "MAX_DIMS", "countIf", "arrays", "predicate", "thisArg", "ndims", "shx", "x", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index 3a0b421..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,74 +0,0 @@ - -{{alias}}( arrays, predicate[, thisArg] ) - Counts the number of elements in an ndarray which pass a test implemented by - a predicate function. - - 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). - - The predicate function is provided the following arguments: - - - value: current array element. - - indices: current array element indices. - - arr: the input ndarray. - - If provided an empty ndarray, the function returns `0`. - - Parameters - ---------- - arrays: ArrayLikeObject - Array-like object containing an input ndarray. - - predicate: Function - Predicate function. - - thisArg: any (optional) - Predicate function execution context. - - Returns - ------- - out: integer - Number of elements in an ndarray which pass a test implemented by a - predicate function. - - Examples - -------- - // Define ndarray data and meta data... - > var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); - > var dt = 'float64'; - > var sh = [ 2, 2 ]; - > var sx = [ 2, 1 ]; - > var ox = 0; - > var ord = 'row-major'; - - // Define a callback... - > function clbk( v ) { return v > 0.0; }; - - // Using an ndarray... - > var x = {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); - > {{alias}}( [ x ], clbk ) - 4 - - // Using a minimal ndarray-like object... - > xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0, 1.0, 0.0 ] ); - > x = { - ... 'dtype': dt, - ... 'data': xbuf, - ... 'shape': sh, - ... 'strides': sx, - ... 'offset': ox, - ... 'order': ord - ... }; - > {{alias}}( [ x ], clbk ) - 3 - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 90f0529..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 countIf = require( './index' ); - -/** -* Predicate function. -* -* @param v - ndarray element -* @returns result -*/ -function clbk( v: any ): boolean { - return v > 0.0; -} - - -// TESTS // - -// The function returns a number... -{ - const x = zeros( [ 2, 2 ] ); - const arrays = [ x ]; - - countIf( arrays, clbk ); // $ExpectType number - countIf( arrays, clbk, {} ); // $ExpectType number -} - -// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects... -{ - countIf( 5, clbk ); // $ExpectError - countIf( true, clbk ); // $ExpectError - countIf( false, clbk ); // $ExpectError - countIf( null, clbk ); // $ExpectError - countIf( undefined, clbk ); // $ExpectError - countIf( {}, clbk ); // $ExpectError - countIf( [ 1 ], clbk ); // $ExpectError - countIf( ( x: number ): number => x, clbk ); // $ExpectError - - countIf( 5, clbk, {} ); // $ExpectError - countIf( true, clbk, {} ); // $ExpectError - countIf( false, clbk, {} ); // $ExpectError - countIf( null, clbk, {} ); // $ExpectError - countIf( undefined, clbk, {} ); // $ExpectError - countIf( {}, clbk, {} ); // $ExpectError - countIf( [ 1 ], clbk, {} ); // $ExpectError - countIf( ( x: number ): number => x, clbk, {} ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a callback function... -{ - const x = zeros( [ 2, 2 ] ); - const arrays = [ x ]; - - countIf( arrays, '10' ); // $ExpectError - countIf( arrays, 5 ); // $ExpectError - countIf( arrays, true ); // $ExpectError - countIf( arrays, false ); // $ExpectError - countIf( arrays, null ); // $ExpectError - countIf( arrays, undefined ); // $ExpectError - countIf( arrays, [] ); // $ExpectError - countIf( arrays, {} ); // $ExpectError - - countIf( arrays, '10', {} ); // $ExpectError - countIf( arrays, 5, {} ); // $ExpectError - countIf( arrays, true, {} ); // $ExpectError - countIf( arrays, false, {} ); // $ExpectError - countIf( arrays, null, {} ); // $ExpectError - countIf( arrays, undefined, {} ); // $ExpectError - countIf( arrays, [], {} ); // $ExpectError - countIf( arrays, {}, {} ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const x = zeros( [ 2, 2 ] ); - const arrays = [ x ]; - - countIf(); // $ExpectError - countIf( arrays ); // $ExpectError - countIf( arrays, clbk, {}, {} ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 6ea65a0..0000000 --- a/examples/index.js +++ /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. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var ndarray2array = require( '@stdlib/ndarray-base-to-array' ); -var countIf = require( './../lib' ); - -function clbk( value ) { - return value > 0; -} - -var x = { - 'dtype': 'generic', - 'data': discreteUniform( 10, -2, 10, { - '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 = countIf( [ x ], clbk ); -console.log( out ); diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 97% rename from docs/types/index.d.ts rename to index.d.ts index 7291870..590a0a4 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { ArrayLike } from '@stdlib/types/array'; import { typedndarray } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..f8ee231 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import r from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-iteration-order@v0.2.2-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-ndarraylike2object@v0.2.2-esm/index.mjs";import o from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-numel@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-nullary-loop-interchange-order@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-nullary-tiling-block-size@v0.2.2-esm/index.mjs";import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-take-indexed@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-reverse@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-reverse@esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-nullary-tiling-block-size@esm/index.mjs";import i from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-take-indexed@esm/index.mjs";import c from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-nullary-loop-interchange-order@esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-strides2order@esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zero-to@esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-numel@esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-vind2bind@esm/index.mjs";import v from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-ind2sub@esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/ndarray-base-strides2order@v0.2.2-esm/index.mjs";var x="throw";var j="throw";var g=[function(r,f,o){return f.call(o,r.data[r.offset],[],r.ref)?1:0},function(r,f,o){var s,e,t,a,n,d;for(a=r.shape[0],t=r.strides[0],n=r.offset,e=r.data,s=0,d=0;d0;)for(P0;)for(k0;)for(B0;)for(A0;)for(q0;)for(G0;)for(F0;)for(E0;)for(D0;)for(L0;)for(K0;)for(J0;)for(I0;)for(H0;)for(R0;)for(Q0;)for(O0;)for(N0;)for(M0;)for(L0;)for(W0;)for(V0;)for(U0;)for(T0;)for(S0;)for(R0;)for(Q0;)for(_0;)for($0;)for(Z0;)for(Y0;)for(X0;)for(W0;)for(V0;)for(U0;)for(er0;)for(sr0;)for(or0;)for(fr0;)for(rr0;)for(_0;)for($0;)for(Z0;)for(Y0;)for(ir0;)for(dr0;)for(nr0;)for(ar0;)for(tr0;)for(er0;)for(sr0;)for(or0;)for(fr0;)for(rr0;)for(z0;)for(P0;)for(C0;)for(B0;)for(A0;)for(H0;)for(G0;)for(F0;)for(E0;)for(M0;)for(L0;)for(K0;)for(J0;)for(I0;)for(S0;)for(R0;)for(Q0;)for(O0;)for(N0;)for(M0;)for(X0;)for(W0;)for(V0;)for(U0;)for(T0;)for(S0;)for(R0;)for(rr0;)for(_0;)for($0;)for(Z0;)for(Y0;)for(X0;)for(W0;)for(V0;)for(tr0;)for(er0;)for(sr0;)for(or0;)for(fr0;)for(rr0;)for(_0;)for($0;)for(Z0;)for(cr0;)for(ir0;)for(dr0;)for(nr0;)for(ar0;)for(tr0;)for(er0;)for(sr0;)for(or0;)for(fr} x.accessors - data buffer accessors\n* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIfnd( x, predicate );\n* // returns 3\n*/\nfunction countIfnd( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar ordx;\n\tvar idx;\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 input 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// Initialize a counter:\n\tcount = 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\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tif ( predicate.call( thisArg, get( xbuf, ix ), idx, x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIfnd;\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';\nimport ind2sub from '@stdlib/ndarray-base-ind2sub';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIfnd( x, predicate );\n* // returns 3\n*/\nfunction countIfnd( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar ordx;\n\tvar idx;\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 input 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// Initialize a counter:\n\tcount = 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\tidx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view\n\t\tif ( predicate.call( thisArg, xbuf[ ix ], idx, x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIfnd;\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 iterationOrder from '@stdlib/ndarray-base-iteration-order';\nimport ndarray2object from '@stdlib/ndarray-base-ndarraylike2object';\nimport numel from '@stdlib/ndarray-base-numel';\nimport blockedaccessorcount2d from './2d_blocked_accessors.js';\nimport blockedaccessorcount3d from './3d_blocked_accessors.js';\nimport blockedaccessorcount4d from './4d_blocked_accessors.js';\nimport blockedaccessorcount5d from './5d_blocked_accessors.js';\nimport blockedaccessorcount6d from './6d_blocked_accessors.js';\nimport blockedaccessorcount7d from './7d_blocked_accessors.js';\nimport blockedaccessorcount8d from './8d_blocked_accessors.js';\nimport blockedaccessorcount9d from './9d_blocked_accessors.js';\nimport blockedaccessorcount10d from './10d_blocked_accessors.js';\nimport blockedcount2d from './2d_blocked.js';\nimport blockedcount3d from './3d_blocked.js';\nimport blockedcount4d from './4d_blocked.js';\nimport blockedcount5d from './5d_blocked.js';\nimport blockedcount6d from './6d_blocked.js';\nimport blockedcount7d from './7d_blocked.js';\nimport blockedcount8d from './8d_blocked.js';\nimport blockedcount9d from './9d_blocked.js';\nimport blockedcount10d from './10d_blocked.js';\nimport accessorcount0d from './0d_accessors.js';\nimport accessorcount1d from './1d_accessors.js';\nimport accessorcount2d from './2d_accessors.js';\nimport accessorcount3d from './3d_accessors.js';\nimport accessorcount4d from './4d_accessors.js';\nimport accessorcount5d from './5d_accessors.js';\nimport accessorcount6d from './6d_accessors.js';\nimport accessorcount7d from './7d_accessors.js';\nimport accessorcount8d from './8d_accessors.js';\nimport accessorcount9d from './9d_accessors.js';\nimport accessorcount10d from './10d_accessors.js';\nimport accessorcountnd from './nd_accessors.js';\nimport count0d from './0d.js';\nimport count1d from './1d.js';\nimport count2d from './2d.js';\nimport count3d from './3d.js';\nimport count4d from './4d.js';\nimport count5d from './5d.js';\nimport count6d from './6d.js';\nimport count7d from './7d.js';\nimport count8d from './8d.js';\nimport count9d from './9d.js';\nimport count10d from './10d.js';\nimport countnd from './nd.js';\n\n\n// VARIABLES //\n\nvar COUNT = [\n\tcount0d,\n\tcount1d,\n\tcount2d,\n\tcount3d,\n\tcount4d,\n\tcount5d,\n\tcount6d,\n\tcount7d,\n\tcount8d,\n\tcount9d,\n\tcount10d\n];\nvar ACCESSOR_COUNT = [\n\taccessorcount0d,\n\taccessorcount1d,\n\taccessorcount2d,\n\taccessorcount3d,\n\taccessorcount4d,\n\taccessorcount5d,\n\taccessorcount6d,\n\taccessorcount7d,\n\taccessorcount8d,\n\taccessorcount9d,\n\taccessorcount10d\n];\nvar BLOCKED_COUNT = [\n\tblockedcount2d, // 0\n\tblockedcount3d,\n\tblockedcount4d,\n\tblockedcount5d,\n\tblockedcount6d,\n\tblockedcount7d,\n\tblockedcount8d,\n\tblockedcount9d,\n\tblockedcount10d // 8\n];\nvar BLOCKED_ACCESSOR_COUNT = [\n\tblockedaccessorcount2d, // 0\n\tblockedaccessorcount3d,\n\tblockedaccessorcount4d,\n\tblockedaccessorcount5d,\n\tblockedaccessorcount6d,\n\tblockedaccessorcount7d,\n\tblockedaccessorcount8d,\n\tblockedaccessorcount9d,\n\tblockedaccessorcount10d // 8\n];\nvar MAX_DIMS = COUNT.length - 1;\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\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* @param {Function} predicate - predicate function\n* @param {thisArg} [thisArg] - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* // Perform operation:\n* var out = countIf( [ x ], predicate );\n* // returns 5\n*/\nfunction countIf( arrays, predicate, thisArg ) {\n\tvar ndims;\n\tvar shx;\n\tvar x;\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// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_COUNT[ ndims ]( x, predicate, thisArg );\n\t\t}\n\t\treturn COUNT[ ndims ]( x, predicate, thisArg );\n\t}\n\t// Check whether we were provided an empty ndarray...\n\tif ( numel( shx ) === 0 ) {\n\t\treturn true;\n\t}\n\t// Determine whether we can avoid blocked iteration...\n\tif ( ndims <= MAX_DIMS && iterationOrder( x.strides ) !== 0 ) {\n\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\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_COUNT[ ndims ]( x, predicate, thisArg );\n\t\t}\n\t\treturn COUNT[ ndims ]( x, predicate, thisArg );\n\t}\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_COUNT[ ndims-2 ]( x, predicate, thisArg );\n\t\t}\n\t\treturn BLOCKED_COUNT[ ndims-2 ]( x, predicate, thisArg );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol ) {\n\t\treturn accessorcountnd( x, predicate, thisArg );\n\t}\n\treturn countnd( x, predicate, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default countIf;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf0d( x, predicate );\n* // returns 1\n*/\nfunction countIf0d( x, predicate, thisArg ) {\n\tif ( predicate.call( thisArg, x.data[ x.offset ], [], x.ref ) ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\n// EXPORTS //\n\nexport default countIf0d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf1d( x, predicate );\n* // returns 3\n*/\nfunction countIf1d( x, predicate, thisArg ) {\n\tvar count;\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// Initialize a counter:\n\tcount = 0;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( predicate.call( thisArg, xbuf[ ix ], [ i0 ], x.ref ) ) {\n\t\t\tcount += 1;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIf1d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf2d( x, predicate );\n* // returns 3\n*/\nfunction countIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIf2d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf3d( x, predicate );\n* // returns 5\n*/\nfunction countIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf3d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf4d( x, predicate );\n* // returns 5\n*/\nfunction countIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf4d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf5d( x, predicate );\n* // returns 5\n*/\nfunction countIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf5d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf6d( x, predicate );\n* // returns 5\n*/\nfunction countIf6d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf6d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf7d( x, predicate );\n* // returns 5\n*/\nfunction countIf7d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf7d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf8d( x, predicate );\n* // returns 5\n*/\nfunction countIf8d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf8d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf9d( x, predicate );\n* // returns 5\n*/\nfunction countIf9d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf9d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = countIf10d( x, predicate );\n* // returns 5\n*/\nfunction countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf10d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\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* 'ref': null,\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* // Perform operation:\n* var out = countIf0d( x, predicate );\n* // returns 1\n*/\nfunction countIf0d( x, predicate, thisArg ) {\n\tif ( predicate.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ) { // eslint-disable-line max-len\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\n// EXPORTS //\n\nexport default countIf0d;\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* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIf1d( x, predicate );\n* // returns 3\n*/\nfunction countIf1d( x, predicate, thisArg ) {\n\tvar count;\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#, 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// Initialize a counter:\n\tcount = 0;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( predicate.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref) ) {\n\t\t\tcount += 1;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIf1d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = countIf2d( x, predicate );\n* // returns 3\n*/\nfunction countIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default countIf2d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf3d( x, predicate );\n* // returns 7\n*/\nfunction countIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf3d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf4d( x, predicate );\n* // returns 7\n*/\nfunction countIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf4d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf5d( x, predicate );\n* // returns 7\n*/\nfunction countIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf5d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf6d( x, predicate );\n* // returns 7\n*/\nfunction countIf6d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf6d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf7d( x, predicate );\n* // returns 7\n*/\nfunction countIf7d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf7d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf8d( x, predicate );\n* // returns 7\n*/\nfunction countIf8d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf8d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf9d( x, predicate );\n* // returns 7\n*/\nfunction countIf9d( x, predicate, thisArg ) {\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf9d;\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';\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport reverse from '@stdlib/array-base-reverse';\nimport take from '@stdlib/array-base-take-indexed';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = countIf10d( x, predicate );\n* // returns 7\n*/\nfunction countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = zeroTo( sh.length );\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\tidx = reverse( idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default countIf10d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf2d( x, predicate );\n* // returns 3\n*/\nfunction blockedCountIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf2d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf3d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf3d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf4d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf4d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf5d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf5d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf6d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf6d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf7d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf7d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf8d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf8d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf9d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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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t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf9d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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 {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Perform operation:\n* var out = blockedCountIf10d( x, predicate );\n* // returns 5\n*/\nfunction blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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++ )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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf10d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf2d( x, predicate );\n* // returns 3\n*/\nfunction blockedCountIf2d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf2d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf3d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf3d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf3d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf4d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf4d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf4d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf5d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf5d( x, predicate, thisArg ) {\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf5d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf6d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf6d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf7d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf7d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf8d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf8d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf9d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount += 1;\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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf9d;\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';\nimport take from '@stdlib/array-base-take-indexed';\nimport reverse from '@stdlib/array-base-reverse';\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {ndarrayLike} x.ref - reference to the original ndarray-like object\n* @param {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* @param {Function} predicate - predicate function\n* @param {*} thisArg - predicate function execution context\n* @returns {integer} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* function predicate( value ) {\n* return value > 0.0;\n* }\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 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* 'ref': null,\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* // Perform operation:\n* var out = blockedCountIf10d( x, predicate );\n* // returns 7\n*/\nfunction blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar count;\n\tvar bsize;\n\tvar xbuf;\n\tvar idx;\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#, 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\tidx = reverse( o.idx );\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// Initialize a counter:\n\tcount = 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\t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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 count;\n}\n\n\n// EXPORTS //\n\nexport default blockedCountIf10d;\n"],"names":["MODE","COUNT","x","predicate","thisArg","call","data","offset","ref","count","xbuf","dx0","S0","ix","i0","shape","strides","idx","dx1","sh","S1","sx","i1","zeroTo","length","strides2order","reverse","take","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_COUNT","accessors","get","BLOCKED_COUNT","bsize","ox1","s0","s1","ox","j0","j1","o","loopOrder","blockSize","dtype","ox2","s2","j2","ox3","s3","j3","ox4","s4","j4","ox5","s5","j5","ox6","s6","j6","ox7","s7","j7","ox8","s8","j8","ox9","s9","j9","BLOCKED_ACCESSOR_COUNT","MAX_DIMS","countIf","arrays","ndims","shx","ndarray2object","accessorProtocol","numel","iterationOrder","ordx","len","i","order","vind2bind","ind2sub","accessorcountnd","countnd"],"mappings":";;+nDA6BA,IAAIA,EAAO,QCAX,IAAIA,EAAO,QC0CX,IAAIC,EAAQ,CCCZ,SAAoBC,EAAGC,EAAWC,GACjC,OAAKD,EAAUE,KAAMD,EAASF,EAAEI,KAAMJ,EAAEK,QAAU,GAAIL,EAAEM,KAChD,EAED,CACR,ECLA,SAAoBN,EAAGC,EAAWC,GACjC,IAAIK,EACAC,EACAC,EACAC,EACAC,EACAC,EAkBJ,IAbAF,EAAKV,EAAEa,MAAO,GACdJ,EAAMT,EAAEc,QAAS,GAGjBH,EAAKX,EAAEK,OAGPG,EAAOR,EAAEI,KAGTG,EAAQ,EAGFK,EAAK,EAAGA,E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d.js b/lib/0d.js deleted file mode 100644 index d4332e3..0000000 --- a/lib/0d.js +++ /dev/null @@ -1,83 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // 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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf0d( x, predicate ); -* // returns 1 -*/ -function countIf0d( x, predicate, thisArg ) { - if ( predicate.call( thisArg, x.data[ x.offset ], [], x.ref ) ) { - return 1; - } - return 0; -} - - -// EXPORTS // - -module.exports = countIf0d; diff --git a/lib/0d_accessors.js b/lib/0d_accessors.js deleted file mode 100644 index e5b607d..0000000 --- a/lib/0d_accessors.js +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // 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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf0d( x, predicate ); -* // returns 1 -*/ -function countIf0d( x, predicate, thisArg ) { - if ( predicate.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ) { // eslint-disable-line max-len - return 1; - } - return 0; -} - - -// EXPORTS // - -module.exports = countIf0d; diff --git a/lib/10d.js b/lib/10d.js deleted file mode 100644 index c70c84a..0000000 --- a/lib/10d.js +++ /dev/null @@ -1,222 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf10d( x, predicate ); -* // returns 5 -*/ -function countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf10d; diff --git a/lib/10d_accessors.js b/lib/10d_accessors.js deleted file mode 100644 index bc2d0e4..0000000 --- a/lib/10d_accessors.js +++ /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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf10d( x, predicate ); -* // returns 7 -*/ -function countIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i9, i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf10d; diff --git a/lib/10d_blocked.js b/lib/10d_blocked.js deleted file mode 100644 index b7a503a..0000000 --- a/lib/10d_blocked.js +++ /dev/null @@ -1,320 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf10d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - } - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf10d; diff --git a/lib/10d_blocked_accessors.js b/lib/10d_blocked_accessors.js deleted file mode 100644 index 359311e..0000000 --- a/lib/10d_blocked_accessors.js +++ /dev/null @@ -1,327 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf10d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf10d( x, predicate, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j9+i9, j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - } - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf10d; diff --git a/lib/1d.js b/lib/1d.js deleted file mode 100644 index dc522a7..0000000 --- a/lib/1d.js +++ /dev/null @@ -1,109 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf1d( x, predicate ); -* // returns 3 -*/ -function countIf1d( x, predicate, thisArg ) { - var count; - 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; - - // Initialize a counter: - count = 0; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - if ( predicate.call( thisArg, xbuf[ ix ], [ i0 ], x.ref ) ) { - count += 1; - } - ix += dx0; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf1d; diff --git a/lib/1d_accessors.js b/lib/1d_accessors.js deleted file mode 100644 index 228d5c6..0000000 --- a/lib/1d_accessors.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'; - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf1d( x, predicate ); -* // returns 3 -*/ -function countIf1d( x, predicate, thisArg ) { - var count; - var xbuf; - var get; - 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; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Initialize a counter: - count = 0; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - if ( predicate.call( thisArg, get( xbuf, ix ), [ i0 ], x.ref) ) { - count += 1; - } - ix += dx0; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf1d; diff --git a/lib/2d.js b/lib/2d.js deleted file mode 100644 index 68d8684..0000000 --- a/lib/2d.js +++ /dev/null @@ -1,140 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf2d( x, predicate ); -* // returns 3 -*/ -function countIf2d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 0; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( predicate.call( thisArg, xbuf[ ix ], take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf2d; diff --git a/lib/2d_accessors.js b/lib/2d_accessors.js deleted file mode 100644 index b625db5..0000000 --- a/lib/2d_accessors.js +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf2d( x, predicate ); -* // returns 3 -*/ -function countIf2d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 0; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( predicate.call( thisArg, get( xbuf, ix ), take( [ i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf2d; diff --git a/lib/2d_blocked.js b/lib/2d_blocked.js deleted file mode 100644 index b2e6042..0000000 --- a/lib/2d_blocked.js +++ /dev/null @@ -1,166 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf2d( x, predicate ); -* // returns 3 -*/ -function blockedCountIf2d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf2d; diff --git a/lib/2d_blocked_accessors.js b/lib/2d_blocked_accessors.js deleted file mode 100644 index aece82c..0000000 --- a/lib/2d_blocked_accessors.js +++ /dev/null @@ -1,173 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf2d( x, predicate ); -* // returns 3 -*/ -function blockedCountIf2d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf2d; diff --git a/lib/3d.js b/lib/3d.js deleted file mode 100644 index 9390ef6..0000000 --- a/lib/3d.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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf3d( x, predicate ); -* // returns 5 -*/ -function countIf3d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf3d; diff --git a/lib/3d_accessors.js b/lib/3d_accessors.js deleted file mode 100644 index c82733d..0000000 --- a/lib/3d_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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf3d( x, predicate ); -* // returns 7 -*/ -function countIf3d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf3d; diff --git a/lib/3d_blocked.js b/lib/3d_blocked.js deleted file mode 100644 index 2ec83f9..0000000 --- a/lib/3d_blocked.js +++ /dev/null @@ -1,187 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf3d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf3d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf3d; diff --git a/lib/3d_blocked_accessors.js b/lib/3d_blocked_accessors.js deleted file mode 100644 index 6956a32..0000000 --- a/lib/3d_blocked_accessors.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 loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf3d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf3d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf3d; diff --git a/lib/4d.js b/lib/4d.js deleted file mode 100644 index 56f9277..0000000 --- a/lib/4d.js +++ /dev/null @@ -1,160 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf4d( x, predicate ); -* // returns 5 -*/ -function countIf4d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf4d; diff --git a/lib/4d_accessors.js b/lib/4d_accessors.js deleted file mode 100644 index de36a28..0000000 --- a/lib/4d_accessors.js +++ /dev/null @@ -1,167 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf4d( x, predicate ); -* // returns 7 -*/ -function countIf4d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf4d; diff --git a/lib/4d_blocked.js b/lib/4d_blocked.js deleted file mode 100644 index 2d060eb..0000000 --- a/lib/4d_blocked.js +++ /dev/null @@ -1,206 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf4d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf4d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf4d; diff --git a/lib/4d_blocked_accessors.js b/lib/4d_blocked_accessors.js deleted file mode 100644 index b9f1f24..0000000 --- a/lib/4d_blocked_accessors.js +++ /dev/null @@ -1,213 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf4d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf4d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf4d; diff --git a/lib/5d.js b/lib/5d.js deleted file mode 100644 index e3089da..0000000 --- a/lib/5d.js +++ /dev/null @@ -1,172 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf5d( x, predicate ); -* // returns 5 -*/ -function countIf5d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf5d; diff --git a/lib/5d_accessors.js b/lib/5d_accessors.js deleted file mode 100644 index eef4cb5..0000000 --- a/lib/5d_accessors.js +++ /dev/null @@ -1,179 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf5d( x, predicate ); -* // returns 7 -*/ -function countIf5d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf5d; diff --git a/lib/5d_blocked.js b/lib/5d_blocked.js deleted file mode 100644 index 5ec5110..0000000 --- a/lib/5d_blocked.js +++ /dev/null @@ -1,225 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf5d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf5d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf5d; diff --git a/lib/5d_blocked_accessors.js b/lib/5d_blocked_accessors.js deleted file mode 100644 index 424c6fd..0000000 --- a/lib/5d_blocked_accessors.js +++ /dev/null @@ -1,232 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf5d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf5d( x, predicate, thisArg ) { - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf5d; diff --git a/lib/6d.js b/lib/6d.js deleted file mode 100644 index 931595c..0000000 --- a/lib/6d.js +++ /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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf6d( x, predicate ); -* // returns 5 -*/ -function countIf6d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf6d; diff --git a/lib/6d_accessors.js b/lib/6d_accessors.js deleted file mode 100644 index d0b1a25..0000000 --- a/lib/6d_accessors.js +++ /dev/null @@ -1,189 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf6d( x, predicate ); -* // returns 7 -*/ -function countIf6d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf6d; diff --git a/lib/6d_blocked.js b/lib/6d_blocked.js deleted file mode 100644 index a5bd074..0000000 --- a/lib/6d_blocked.js +++ /dev/null @@ -1,244 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf6d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf6d; diff --git a/lib/6d_blocked_accessors.js b/lib/6d_blocked_accessors.js deleted file mode 100644 index ce0a327..0000000 --- a/lib/6d_blocked_accessors.js +++ /dev/null @@ -1,251 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf6d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf6d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf6d; diff --git a/lib/7d.js b/lib/7d.js deleted file mode 100644 index 0b9b2fe..0000000 --- a/lib/7d.js +++ /dev/null @@ -1,192 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf7d( x, predicate ); -* // returns 5 -*/ -function countIf7d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf7d; diff --git a/lib/7d_accessors.js b/lib/7d_accessors.js deleted file mode 100644 index 1780c28..0000000 --- a/lib/7d_accessors.js +++ /dev/null @@ -1,199 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf7d( x, predicate ); -* // returns 7 -*/ -function countIf7d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf7d; diff --git a/lib/7d_blocked.js b/lib/7d_blocked.js deleted file mode 100644 index de9e8a4..0000000 --- a/lib/7d_blocked.js +++ /dev/null @@ -1,263 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf7d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf7d; diff --git a/lib/7d_blocked_accessors.js b/lib/7d_blocked_accessors.js deleted file mode 100644 index 25f433a..0000000 --- a/lib/7d_blocked_accessors.js +++ /dev/null @@ -1,270 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf7d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf7d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf7d; diff --git a/lib/8d.js b/lib/8d.js deleted file mode 100644 index 4fee3ed..0000000 --- a/lib/8d.js +++ /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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf8d( x, predicate ); -* // returns 5 -*/ -function countIf8d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf8d; diff --git a/lib/8d_accessors.js b/lib/8d_accessors.js deleted file mode 100644 index fedc254..0000000 --- a/lib/8d_accessors.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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf8d( x, predicate ); -* // returns 7 -*/ -function countIf8d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf8d; diff --git a/lib/8d_blocked.js b/lib/8d_blocked.js deleted file mode 100644 index 5ac2c27..0000000 --- a/lib/8d_blocked.js +++ /dev/null @@ -1,282 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf8d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf8d; diff --git a/lib/8d_blocked_accessors.js b/lib/8d_blocked_accessors.js deleted file mode 100644 index 22a6d8a..0000000 --- a/lib/8d_blocked_accessors.js +++ /dev/null @@ -1,289 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf8d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf8d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf8d; diff --git a/lib/9d.js b/lib/9d.js deleted file mode 100644 index e5bb67d..0000000 --- a/lib/9d.js +++ /dev/null @@ -1,212 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf9d( x, predicate ); -* // returns 5 -*/ -function countIf9d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf9d; diff --git a/lib/9d_accessors.js b/lib/9d_accessors.js deleted file mode 100644 index 294593f..0000000 --- a/lib/9d_accessors.js +++ /dev/null @@ -1,219 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var reverse = require( '@stdlib/array-base-reverse' ); -var take = require( '@stdlib/array-base-take-indexed' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIf9d( x, predicate ); -* // returns 7 -*/ -function countIf9d( x, predicate, thisArg ) { - var count; - var xbuf; - var idx; - 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#, 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; - idx = zeroTo( sh.length ); - 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 - idx = reverse( idx ); - } - // 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 ]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ i8, i7, i6, i5, i4, i3, i2, i1, i0 ], idx ), x.ref ) ) { // eslint-disable-line max-len - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - return count; -} - - -// EXPORTS // - -module.exports = countIf9d; diff --git a/lib/9d_blocked.js b/lib/9d_blocked.js deleted file mode 100644 index 36afb92..0000000 --- a/lib/9d_blocked.js +++ /dev/null @@ -1,301 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = blockedCountIf9d( x, predicate ); -* // returns 5 -*/ -function blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, xbuf[ ix ], take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf9d; diff --git a/lib/9d_blocked_accessors.js b/lib/9d_blocked_accessors.js deleted file mode 100644 index 8a2c12a..0000000 --- a/lib/9d_blocked_accessors.js +++ /dev/null @@ -1,308 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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' ); -var take = require( '@stdlib/array-base-take-indexed' ); -var reverse = require( '@stdlib/array-base-reverse' ); - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = blockedCountIf9d( x, predicate ); -* // returns 7 -*/ -function blockedCountIf9d( x, predicate, thisArg ) { // eslint-disable-line max-statements - var count; - var bsize; - var xbuf; - var idx; - 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#, 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; - idx = reverse( o.idx ); - - // 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]; - - // Initialize a counter: - count = 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 ( predicate.call( thisArg, get( xbuf, ix ), take( [ j8+i8, j7+i7, j6+i6, j5+i5, j4+i4, j3+i3, j2+i2, j1+i1, j0+i0 ], idx ), x.ref ) ) { - count += 1; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - } - } - } - } - } - } - } - } - } - return count; -} - - -// EXPORTS // - -module.exports = blockedCountIf9d; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 1985c75..0000000 --- a/lib/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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'; - -/** -* Count the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @module @stdlib/ndarray-base-count-if -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* var countIf = require( '@stdlib/ndarray-base-count-if' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIf( [ x ], predicate ); -* // returns 5 -*/ - -// 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 5e3c4af..0000000 --- a/lib/main.js +++ /dev/null @@ -1,223 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var iterationOrder = require( '@stdlib/ndarray-base-iteration-order' ); -var ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var blockedaccessorcount2d = require( './2d_blocked_accessors.js' ); -var blockedaccessorcount3d = require( './3d_blocked_accessors.js' ); -var blockedaccessorcount4d = require( './4d_blocked_accessors.js' ); -var blockedaccessorcount5d = require( './5d_blocked_accessors.js' ); -var blockedaccessorcount6d = require( './6d_blocked_accessors.js' ); -var blockedaccessorcount7d = require( './7d_blocked_accessors.js' ); -var blockedaccessorcount8d = require( './8d_blocked_accessors.js' ); -var blockedaccessorcount9d = require( './9d_blocked_accessors.js' ); -var blockedaccessorcount10d = require( './10d_blocked_accessors.js' ); -var blockedcount2d = require( './2d_blocked.js' ); -var blockedcount3d = require( './3d_blocked.js' ); -var blockedcount4d = require( './4d_blocked.js' ); -var blockedcount5d = require( './5d_blocked.js' ); -var blockedcount6d = require( './6d_blocked.js' ); -var blockedcount7d = require( './7d_blocked.js' ); -var blockedcount8d = require( './8d_blocked.js' ); -var blockedcount9d = require( './9d_blocked.js' ); -var blockedcount10d = require( './10d_blocked.js' ); -var accessorcount0d = require( './0d_accessors.js' ); -var accessorcount1d = require( './1d_accessors.js' ); -var accessorcount2d = require( './2d_accessors.js' ); -var accessorcount3d = require( './3d_accessors.js' ); -var accessorcount4d = require( './4d_accessors.js' ); -var accessorcount5d = require( './5d_accessors.js' ); -var accessorcount6d = require( './6d_accessors.js' ); -var accessorcount7d = require( './7d_accessors.js' ); -var accessorcount8d = require( './8d_accessors.js' ); -var accessorcount9d = require( './9d_accessors.js' ); -var accessorcount10d = require( './10d_accessors.js' ); -var accessorcountnd = require( './nd_accessors.js' ); -var count0d = require( './0d.js' ); -var count1d = require( './1d.js' ); -var count2d = require( './2d.js' ); -var count3d = require( './3d.js' ); -var count4d = require( './4d.js' ); -var count5d = require( './5d.js' ); -var count6d = require( './6d.js' ); -var count7d = require( './7d.js' ); -var count8d = require( './8d.js' ); -var count9d = require( './9d.js' ); -var count10d = require( './10d.js' ); -var countnd = require( './nd.js' ); - - -// VARIABLES // - -var COUNT = [ - count0d, - count1d, - count2d, - count3d, - count4d, - count5d, - count6d, - count7d, - count8d, - count9d, - count10d -]; -var ACCESSOR_COUNT = [ - accessorcount0d, - accessorcount1d, - accessorcount2d, - accessorcount3d, - accessorcount4d, - accessorcount5d, - accessorcount6d, - accessorcount7d, - accessorcount8d, - accessorcount9d, - accessorcount10d -]; -var BLOCKED_COUNT = [ - blockedcount2d, // 0 - blockedcount3d, - blockedcount4d, - blockedcount5d, - blockedcount6d, - blockedcount7d, - blockedcount8d, - blockedcount9d, - blockedcount10d // 8 -]; -var BLOCKED_ACCESSOR_COUNT = [ - blockedaccessorcount2d, // 0 - blockedaccessorcount3d, - blockedaccessorcount4d, - blockedaccessorcount5d, - blockedaccessorcount6d, - blockedaccessorcount7d, - blockedaccessorcount8d, - blockedaccessorcount9d, - blockedaccessorcount10d // 8 -]; -var MAX_DIMS = COUNT.length - 1; - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* ## 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 -* @param {Function} predicate - predicate function -* @param {thisArg} [thisArg] - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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' -* }; -* -* // Perform operation: -* var out = countIf( [ x ], predicate ); -* // returns 5 -*/ -function countIf( arrays, predicate, thisArg ) { - var ndims; - var shx; - var x; - - // Unpack the ndarray and standardize ndarray meta data: - x = ndarray2object( arrays[ 0 ] ); - shx = x.shape; - ndims = shx.length; - - // Determine whether we can avoid iteration altogether... - if ( ndims === 0 ) { - if ( x.accessorProtocol ) { - return ACCESSOR_COUNT[ ndims ]( x, predicate, thisArg ); - } - return COUNT[ ndims ]( x, predicate, thisArg ); - } - // Check whether we were provided an empty ndarray... - if ( numel( shx ) === 0 ) { - return true; - } - // Determine whether we can avoid blocked iteration... - if ( ndims <= MAX_DIMS && iterationOrder( x.strides ) !== 0 ) { - // 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_COUNT[ ndims ]( x, predicate, thisArg ); - } - return COUNT[ ndims ]( x, predicate, thisArg ); - } - // Determine whether we can perform blocked iteration... - if ( ndims <= MAX_DIMS ) { - if ( x.accessorProtocol ) { - return BLOCKED_ACCESSOR_COUNT[ ndims-2 ]( x, predicate, thisArg ); - } - return BLOCKED_COUNT[ ndims-2 ]( x, predicate, thisArg ); - } - // Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)... - if ( x.accessorProtocol ) { - return accessorcountnd( x, predicate, thisArg ); - } - return countnd( x, predicate, thisArg ); -} - - -// EXPORTS // - -module.exports = countIf; diff --git a/lib/nd.js b/lib/nd.js deleted file mode 100644 index 84171c1..0000000 --- a/lib/nd.js +++ /dev/null @@ -1,131 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); -var ind2sub = require( '@stdlib/ndarray-base-ind2sub' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Perform operation: -* var out = countIfnd( x, predicate ); -* // returns 3 -*/ -function countIfnd( x, predicate, thisArg ) { - var count; - var xbuf; - var ordx; - var idx; - 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 input 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; - - // Initialize a counter: - count = 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 ); - idx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view - if ( predicate.call( thisArg, xbuf[ ix ], idx, x.ref ) ) { - count += 1; - } - } - return count; -} - - -// EXPORTS // - -module.exports = countIfnd; diff --git a/lib/nd_accessors.js b/lib/nd_accessors.js deleted file mode 100644 index 45e6f85..0000000 --- a/lib/nd_accessors.js +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); -var ind2sub = require( '@stdlib/ndarray-base-ind2sub' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Counts the number of elements in an ndarray which pass a test implemented by a predicate function. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {ndarrayLike} x.ref - reference to the original ndarray-like object -* @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 -* @param {Function} predicate - predicate function -* @param {*} thisArg - predicate function execution context -* @returns {integer} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* function predicate( value ) { -* return value > 0.0; -* } -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.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 = { -* 'ref': null, -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Perform operation: -* var out = countIfnd( x, predicate ); -* // returns 3 -*/ -function countIfnd( x, predicate, thisArg ) { - var count; - var xbuf; - var ordx; - var idx; - 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 input 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 ]; - - // Initialize a counter: - count = 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 ); - idx = ind2sub( sh, sx, 0, ordx, i, MODE ); // return subscripts from the perspective of the ndarray view - if ( predicate.call( thisArg, get( xbuf, ix ), idx, x.ref ) ) { - count += 1; - } - } - return count; -} - - -// EXPORTS // - -module.exports = countIfnd; diff --git a/package.json b/package.json index 5fbf24e..ca08e84 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Count the number of elements in an ndarray which pass a test implemented by a predicate function.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,56 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-reverse": "^0.2.2", - "@stdlib/array-base-take-indexed": "^0.2.2", - "@stdlib/array-base-zero-to": "^0.2.1", - "@stdlib/ndarray-base-ind2sub": "^0.2.2", - "@stdlib/ndarray-base-iteration-order": "^0.2.2", - "@stdlib/ndarray-base-ndarraylike2object": "^0.2.2", - "@stdlib/ndarray-base-nullary-loop-interchange-order": "^0.2.2", - "@stdlib/ndarray-base-nullary-tiling-block-size": "^0.2.2", - "@stdlib/ndarray-base-numel": "^0.2.2", - "@stdlib/ndarray-base-strides2order": "^0.2.2", - "@stdlib/ndarray-base-vind2bind": "^0.2.2", - "@stdlib/types": "^0.4.3" - }, - "devDependencies": { - "@stdlib/array-base-to-accessor-array": "^0.2.2", - "@stdlib/array-float64": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/complex-float64-ctor": "^0.0.3", - "@stdlib/complex-float64-imag": "^0.1.1", - "@stdlib/complex-float64-real": "^0.1.1", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^0.2.2", - "@stdlib/ndarray-base-shape2strides": "^0.2.2", - "@stdlib/ndarray-base-to-array": "^0.2.1", - "@stdlib/ndarray-ctor": "^0.2.2", - "@stdlib/ndarray-from-scalar": "^0.2.1", - "@stdlib/random-array-discrete-uniform": "^0.2.1", - "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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "base", @@ -99,7 +26,6 @@ "utils", "truthy" ], - "__stdlib__": {}, "funding": { "type": "opencollective", "url": "https://opencollective.com/stdlib" diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..d94a9ea --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.0d.js b/test/test.0d.js deleted file mode 100644 index 190a70b..0000000 --- a/test/test.0d.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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 real = require( '@stdlib/complex-float64-real' ); -var imag = require( '@stdlib/complex-float64-imag' ); -var scalar2ndarray = require( '@stdlib/ndarray-from-scalar' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var countIf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof countIf, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function counts the number of elements in a 0-dimensional ndarray which pass a test implemented by a predicate function', function test( t ) { - var actual; - var x; - - x = scalar2ndarray( 0.0, { - 'dtype': 'float64' - }); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 0, 'returns expected value' ); - - x = scalar2ndarray( 1.0, { - 'dtype': 'float64' - }); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 1, 'returns expected value' ); - - t.end(); - - function clbk( v ) { - return v !== 0.0; - } -}); - -tape( 'the function counts the number of elements in a 0-dimensional ndarray which pass a test implemented by a predicate function (accessors)', function test( t ) { - var actual; - var x; - - x = ndarray( 'generic', toAccessorArray( new Float64Array( [ 0.0 ] ) ), [], [ 0 ], 0, 'row-major' ); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 0, 'returns expected value' ); - - x = ndarray( 'generic', toAccessorArray( new Float64Array( [ 1.0 ] ) ), [], [ 0 ], 0, 'row-major' ); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 1, 'returns expected value' ); - - t.end(); - - function clbk( v ) { - return v !== 0.0; - } -}); - -tape( 'the function counts the number of elements in a 0-dimensional ndarray which pass a test implemented by a predicate function (complex)', function test( t ) { - var actual; - var x; - - x = scalar2ndarray( new Complex128( 0.0, 0.0 ), { - 'dtype': 'complex128' - }); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 0, 'returns expected value' ); - - x = scalar2ndarray( new Complex128( 1.0, 1.0 ), { - 'dtype': 'complex128' - }); - - actual = countIf( [ x ], clbk ); - t.strictEqual( actual, 1, 'returns expected value' ); - - t.end(); - - function clbk( v ) { - return ( real( v ) !== 0.0 && imag( v ) !== 0.0 ); - } -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 509fad8..0000000 --- a/test/test.js +++ /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. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var countIf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof countIf, 'function', 'main export is a function' ); - t.end(); -});