diff --git a/.editorconfig b/.editorconfig index dab5d2a638dd..80f3fca5199a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -165,6 +165,15 @@ indent_style = tab indent_style = space indent_size = 2 +# Ignore generated lock files for GitHub Agentic Workflows: +[*.lock.yml] +charset = unset +end_of_line = unset +indent_style = unset +indent_size = unset +trim_trailing_whitespace = unset +insert_final_newline = unset + # Set properties for GYP files: [binding.gyp] indent_style = space diff --git a/.gitattributes b/.gitattributes index 1c88e69c0546..24b327f4687e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -64,3 +64,5 @@ Makefile linguist-vendored # Configure files which should be included in GitHub language statistics: docs/types/*.d.ts -linguist-documentation + +.github/workflows/*.lock.yml linguist-generated=true merge=ours diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json new file mode 100644 index 000000000000..7c02c792420d --- /dev/null +++ b/.github/aw/actions-lock.json @@ -0,0 +1,14 @@ +{ + "entries": { + "actions/github-script@v8": { + "repo": "actions/github-script", + "version": "v8", + "sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd" + }, + "github/gh-aw-actions/setup@v0.61.2": { + "repo": "github/gh-aw-actions/setup", + "version": "v0.61.2", + "sha": "71cfb3cbe2002225f9d5afa180669fff36b86ea2" + } + } +} diff --git a/.github/workflows/check_licenses.yml b/.github/workflows/check_licenses.yml index 6c2ab49410d6..e7c8d18e596d 100644 --- a/.github/workflows/check_licenses.yml +++ b/.github/workflows/check_licenses.yml @@ -128,7 +128,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact: diff --git a/.github/workflows/check_pr_issue_references.lock.yml b/.github/workflows/check_pr_issue_references.lock.yml new file mode 100644 index 000000000000..fa1ac6f40ef8 --- /dev/null +++ b/.github/workflows/check_pr_issue_references.lock.yml @@ -0,0 +1,1001 @@ +# ___ _ _ +# / _ \ | | (_) +# | |_| | __ _ ___ _ __ | |_ _ ___ +# | _ |/ _` |/ _ \ '_ \| __| |/ __| +# | | | | (_| | __/ | | | |_| | (__ +# \_| |_/\__, |\___|_| |_|\__|_|\___| +# __/ | +# _ _ |___/ +# | | | | / _| | +# | | | | ___ _ __ _ __| |_| | _____ ____ +# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___| +# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ +# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ +# +# This file was automatically generated by gh-aw (v0.61.2). DO NOT EDIT. +# +# To update this file, edit the corresponding .md file and run: +# gh aw compile +# Not all edits will cause changes to this file. +# +# For more information: https://github.github.com/gh-aw/introduction/overview/ +# +# Checks whether issue/PR references in a PR body are actually related to the PR. Posts an informational comment when suspicious references are detected. +# +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"aae025200a6642adcb44f1e1f3e12d782fe91a9bb0451c59f7d625e0ff1482a8","compiler_version":"v0.61.2","strict":true} + +name: "Check PR Issue References" +"on": + schedule: + - cron: "1 */6 * * *" + # Friendly format: every 6h (scattered) + workflow_dispatch: + inputs: + pr_numbers: + description: Comma-separated PR numbers to check (leave empty to auto-discover recent PRs) + required: false + type: string + +permissions: {} + +concurrency: + group: "gh-aw-${{ github.workflow }}" + +run-name: check_pr_issue_references + +jobs: + activation: + runs-on: ubuntu-slim + permissions: + contents: read + outputs: + comment_id: "" + comment_repo: "" + lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} + model: ${{ steps.generate_aw_info.outputs.model }} + secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + steps: + - name: Setup Scripts + uses: github/gh-aw-actions/setup@71cfb3cbe2002225f9d5afa180669fff36b86ea2 # v0.61.2 + with: + destination: ${{ runner.temp }}/gh-aw/actions + - name: Generate agentic run info + id: generate_aw_info + env: + GH_AW_INFO_ENGINE_ID: "copilot" + GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" + GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }} + GH_AW_INFO_VERSION: "" + GH_AW_INFO_AGENT_VERSION: "latest" + GH_AW_INFO_CLI_VERSION: "v0.61.2" + GH_AW_INFO_WORKFLOW_NAME: "Check PR Issue References" + GH_AW_INFO_EXPERIMENTAL: "false" + GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" + GH_AW_INFO_STAGED: "false" + GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]' + GH_AW_INFO_FIREWALL_ENABLED: "true" + GH_AW_INFO_AWF_VERSION: "v0.24.3" + GH_AW_INFO_AWMG_VERSION: "" + GH_AW_INFO_FIREWALL_TYPE: "squid" + GH_AW_COMPILED_STRICT: "true" + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs'); + await main(core, context); + - name: Validate COPILOT_GITHUB_TOKEN secret + id: validate-secret + run: ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + - name: Checkout .github and .agents folders + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + sparse-checkout: | + .github + .agents + sparse-checkout-cone-mode: true + fetch-depth: 1 + - name: Check workflow file timestamps + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_WORKFLOW_FILE: "check_pr_issue_references.lock.yml" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); + await main(); + - name: Create prompt with built-in context + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} + GH_AW_GITHUB_ACTOR: ${{ github.actor }} + GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} + GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBERS: ${{ github.event.inputs.pr_numbers }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} + GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} + GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + run: | + bash ${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh + { + cat << 'GH_AW_PROMPT_EOF' + + GH_AW_PROMPT_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" + cat << 'GH_AW_PROMPT_EOF' + + Tools: add_comment, missing_tool, missing_data, noop + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + GH_AW_PROMPT_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" + cat << 'GH_AW_PROMPT_EOF' + + GH_AW_PROMPT_EOF + cat << 'GH_AW_PROMPT_EOF' + {{#runtime-import .github/workflows/check_pr_issue_references.md}} + GH_AW_PROMPT_EOF + } > "$GH_AW_PROMPT" + - name: Interpolate variables and render templates + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBERS: ${{ github.event.inputs.pr_numbers }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); + await main(); + - name: Substitute placeholders + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_GITHUB_ACTOR: ${{ github.actor }} + GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} + GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBERS: ${{ github.event.inputs.pr_numbers }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} + GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} + GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + + const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs'); + + // Call the substitution function + return await substitutePlaceholders({ + file: process.env.GH_AW_PROMPT, + substitutions: { + GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR, + GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID, + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER, + GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBERS: process.env.GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBERS, + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER, + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER, + GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, + GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, + GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE + } + }); + - name: Validate prompt placeholders + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + run: bash ${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh + - name: Print prompt + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + run: bash ${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh + - name: Upload activation artifact + if: success() + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: activation + path: | + /tmp/gh-aw/aw_info.json + /tmp/gh-aw/aw-prompts/prompt.txt + retention-days: 1 + + agent: + needs: activation + runs-on: ubuntu-latest + permissions: + contents: read + issues: read + pull-requests: read + concurrency: + group: "gh-aw-copilot-${{ github.workflow }}" + env: + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + GH_AW_ASSETS_ALLOWED_EXTS: "" + GH_AW_ASSETS_BRANCH: "" + GH_AW_ASSETS_MAX_SIZE_KB: 0 + GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs + GH_AW_WORKFLOW_ID_SANITIZED: check_pr_issue_references + outputs: + checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} + detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_success: ${{ steps.detection_conclusion.outputs.success }} + has_patch: ${{ steps.collect_output.outputs.has_patch }} + inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }} + model: ${{ needs.activation.outputs.model }} + output: ${{ steps.collect_output.outputs.output }} + output_types: ${{ steps.collect_output.outputs.output_types }} + steps: + - name: Setup Scripts + uses: github/gh-aw-actions/setup@71cfb3cbe2002225f9d5afa180669fff36b86ea2 # v0.61.2 + with: + destination: ${{ runner.temp }}/gh-aw/actions + - name: Set runtime paths + run: | + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" >> "$GITHUB_ENV" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" >> "$GITHUB_ENV" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" >> "$GITHUB_ENV" + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Create gh-aw temp directory + run: bash ${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh + - name: Configure gh CLI for GitHub Enterprise + run: bash ${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh + env: + GH_TOKEN: ${{ github.token }} + - name: Configure Git credentials + env: + REPO_NAME: ${{ github.repository }} + SERVER_URL: ${{ github.server_url }} + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git config --global am.keepcr true + # Re-authenticate git with GitHub token + SERVER_URL_STRIPPED="${SERVER_URL#https://}" + git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + echo "Git configured with standard GitHub Actions identity" + - name: Checkout PR branch + id: checkout-pr + if: | + (github.event.pull_request) || (github.event.issue.pull_request) + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); + await main(); + - name: Install GitHub Copilot CLI + run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest + env: + GH_HOST: github.com + - name: Install AWF binary + run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.24.3 + - name: Download container images + run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.24.3 ghcr.io/github/gh-aw-firewall/api-proxy:0.24.3 ghcr.io/github/gh-aw-firewall/squid:0.24.3 ghcr.io/github/gh-aw-mcpg:v0.1.18 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine + - name: Write Safe Outputs Config + run: | + mkdir -p ${RUNNER_TEMP}/gh-aw/safeoutputs + mkdir -p /tmp/gh-aw/safeoutputs + mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs + cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF' + {"add_comment":{"max":10},"missing_data":{},"missing_tool":{},"noop":{"max":10}} + GH_AW_SAFE_OUTPUTS_CONFIG_EOF + - name: Write Safe Outputs Tools + run: | + cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/tools_meta.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF' + { + "description_suffixes": { + "add_comment": " CONSTRAINTS: Maximum 10 comment(s) can be added." + }, + "repo_params": {}, + "dynamic_tools": [] + } + GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF + cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF' + { + "add_comment": { + "defaultMax": 1, + "fields": { + "body": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "item_number": { + "issueOrPRNumber": true + }, + "repo": { + "type": "string", + "maxLength": 256 + } + } + }, + "missing_data": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "context": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "data_type": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, + "reason": { + "type": "string", + "sanitize": true, + "maxLength": 256 + } + } + }, + "missing_tool": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 512 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "tool": { + "type": "string", + "sanitize": true, + "maxLength": 128 + } + } + }, + "noop": { + "defaultMax": 1, + "fields": { + "message": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + } + } + } + } + GH_AW_SAFE_OUTPUTS_VALIDATION_EOF + node ${RUNNER_TEMP}/gh-aw/actions/generate_safe_outputs_tools.cjs + - name: Generate Safe Outputs MCP Server Config + id: safe-outputs-config + run: | + # Generate a secure random API key (360 bits of entropy, 40+ chars) + # Mask immediately to prevent timing vulnerabilities + API_KEY=$(openssl rand -base64 45 | tr -d '/+=') + echo "::add-mask::${API_KEY}" + + PORT=3001 + + # Set outputs for next steps + { + echo "safe_outputs_api_key=${API_KEY}" + echo "safe_outputs_port=${PORT}" + } >> "$GITHUB_OUTPUT" + + echo "Safe Outputs MCP server will run on port ${PORT}" + + - name: Start Safe Outputs MCP HTTP Server + id: safe-outputs-start + env: + DEBUG: '*' + GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }} + GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }} + GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json + GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/config.json + GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs + run: | + # Environment variables are set above to prevent template injection + export DEBUG + export GH_AW_SAFE_OUTPUTS_PORT + export GH_AW_SAFE_OUTPUTS_API_KEY + export GH_AW_SAFE_OUTPUTS_TOOLS_PATH + export GH_AW_SAFE_OUTPUTS_CONFIG_PATH + export GH_AW_MCP_LOG_DIR + + bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh + + - name: Start MCP Gateway + id: start-mcp-gateway + env: + GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} + GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }} + GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + run: | + set -eo pipefail + mkdir -p /tmp/gh-aw/mcp-config + + # Export gateway environment variables for MCP config and gateway script + export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_DOMAIN="host.docker.internal" + MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') + echo "::add-mask::${MCP_GATEWAY_API_KEY}" + export MCP_GATEWAY_API_KEY + export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads" + mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}" + export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288" + export DEBUG="*" + + export GH_AW_ENGINE="copilot" + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.1.18' + + mkdir -p /home/runner/.copilot + cat << GH_AW_MCP_CONFIG_EOF | bash ${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh + { + "mcpServers": { + "github": { + "type": "stdio", + "container": "ghcr.io/github/github-mcp-server:v0.32.0", + "env": { + "GITHUB_HOST": "\${GITHUB_SERVER_URL}", + "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", + "GITHUB_READ_ONLY": "1", + "GITHUB_TOOLSETS": "issues,pull_requests,repos" + }, + "guard-policies": { + "allow-only": { + "min-integrity": "none", + "repos": "all" + } + } + }, + "safeoutputs": { + "type": "http", + "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT", + "headers": { + "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}" + }, + "guard-policies": { + "write-sink": { + "accept": [ + "*" + ] + } + } + } + }, + "gateway": { + "port": $MCP_GATEWAY_PORT, + "domain": "${MCP_GATEWAY_DOMAIN}", + "apiKey": "${MCP_GATEWAY_API_KEY}", + "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" + } + } + GH_AW_MCP_CONFIG_EOF + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Clean git credentials + continue-on-error: true + run: bash ${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh + - name: Execute GitHub Copilot CLI + id: agentic_execution + # Copilot CLI tool arguments (sorted): + timeout-minutes: 10 + run: | + set -o pipefail + touch /tmp/gh-aw/agent-step-summary.md + # shellcheck disable=SC1003 + sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.24.3 --skip-pull --enable-api-proxy \ + -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-all-tools --allow-all-paths --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + env: + COPILOT_AGENT_RUNNER_TYPE: STANDALONE + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }} + GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json + GH_AW_PHASE: agent + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} + GH_AW_VERSION: v0.61.2 + GITHUB_API_URL: ${{ github.api_url }} + GITHUB_AW: true + GITHUB_HEAD_REF: ${{ github.head_ref }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_REF_NAME: ${{ github.ref_name }} + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md + GITHUB_WORKSPACE: ${{ github.workspace }} + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_AUTHOR_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + XDG_CONFIG_HOME: /home/runner + - name: Detect inference access error + id: detect-inference-error + if: always() + continue-on-error: true + run: bash ${RUNNER_TEMP}/gh-aw/actions/detect_inference_access_error.sh + - name: Configure Git credentials + env: + REPO_NAME: ${{ github.repository }} + SERVER_URL: ${{ github.server_url }} + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git config --global am.keepcr true + # Re-authenticate git with GitHub token + SERVER_URL_STRIPPED="${SERVER_URL#https://}" + git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + echo "Git configured with standard GitHub Actions identity" + - name: Copy Copilot session state files to logs + if: always() + continue-on-error: true + run: | + # Copy Copilot session state files to logs folder for artifact collection + # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them + SESSION_STATE_DIR="$HOME/.copilot/session-state" + LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs" + + if [ -d "$SESSION_STATE_DIR" ]; then + echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR" + mkdir -p "$LOGS_DIR" + cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true + echo "Session state files copied successfully" + else + echo "No session-state directory found at $SESSION_STATE_DIR" + fi + - name: Stop MCP Gateway + if: always() + continue-on-error: true + env: + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }} + run: | + bash ${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID" + - name: Redact secrets in logs + if: always() + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs'); + await main(); + env: + GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN' + SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} + SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} + SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Append agent step summary + if: always() + run: bash ${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh + - name: Copy Safe Outputs + if: always() + run: | + mkdir -p /tmp/gh-aw + cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true + - name: Ingest agent output + id: collect_output + if: always() + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} + GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_API_URL: ${{ github.api_url }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs'); + await main(); + - name: Parse agent logs for step summary + if: always() + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_copilot_log.cjs'); + await main(); + - name: Parse MCP Gateway logs for step summary + if: always() + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs'); + await main(); + - name: Print firewall logs + if: always() + continue-on-error: true + env: + AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs + run: | + # Fix permissions on firewall logs so they can be uploaded as artifacts + # AWF runs with sudo, creating files owned by root + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) + if command -v awf &> /dev/null; then + awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" + else + echo 'AWF binary not installed, skipping firewall log summary' + fi + - name: Upload agent artifacts + if: always() + continue-on-error: true + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: agent + path: | + /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/sandbox/agent/logs/ + /tmp/gh-aw/redacted-urls.log + /tmp/gh-aw/mcp-logs/ + /tmp/gh-aw/sandbox/firewall/logs/ + /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/agent/ + /tmp/gh-aw/safeoutputs.jsonl + /tmp/gh-aw/agent_output.json + if-no-files-found: ignore + # --- Threat Detection (inline) --- + - name: Check if detection needed + id: detection_guard + if: always() + env: + OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }} + HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + run: | + if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then + echo "run_detection=true" >> "$GITHUB_OUTPUT" + echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH" + else + echo "run_detection=false" >> "$GITHUB_OUTPUT" + echo "Detection skipped: no agent outputs or patches to analyze" + fi + - name: Clear MCP configuration for detection + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f /home/runner/.copilot/mcp-config.json + rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" + - name: Prepare threat detection files + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + mkdir -p /tmp/gh-aw/threat-detection/aw-prompts + cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true + cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true + for f in /tmp/gh-aw/aw-*.patch; do + [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true + done + echo "Prepared threat detection files:" + ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true + - name: Setup threat detection + if: always() && steps.detection_guard.outputs.run_detection == 'true' + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + WORKFLOW_NAME: "Check PR Issue References" + WORKFLOW_DESCRIPTION: "Checks whether issue/PR references in a PR body are actually related to the PR. Posts an informational comment when suspicious references are detected." + HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs'); + await main(); + - name: Ensure threat-detection directory and log + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + mkdir -p /tmp/gh-aw/threat-detection + touch /tmp/gh-aw/threat-detection/detection.log + - name: Execute GitHub Copilot CLI + if: always() && steps.detection_guard.outputs.run_detection == 'true' + id: detection_agentic_execution + # Copilot CLI tool arguments (sorted): + # --allow-tool shell(cat) + # --allow-tool shell(grep) + # --allow-tool shell(head) + # --allow-tool shell(jq) + # --allow-tool shell(ls) + # --allow-tool shell(tail) + # --allow-tool shell(wc) + timeout-minutes: 20 + run: | + set -o pipefail + touch /tmp/gh-aw/agent-step-summary.md + # shellcheck disable=SC1003 + sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,raw.githubusercontent.com,registry.npmjs.org,telemetry.enterprise.githubcopilot.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.24.3 --skip-pull --enable-api-proxy \ + -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(wc)'\'' --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + env: + COPILOT_AGENT_RUNNER_TYPE: STANDALONE + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || '' }} + GH_AW_PHASE: detection + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_VERSION: v0.61.2 + GITHUB_API_URL: ${{ github.api_url }} + GITHUB_AW: true + GITHUB_HEAD_REF: ${{ github.head_ref }} + GITHUB_REF_NAME: ${{ github.ref_name }} + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md + GITHUB_WORKSPACE: ${{ github.workspace }} + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_AUTHOR_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + XDG_CONFIG_HOME: /home/runner + - name: Parse threat detection results + id: parse_detection_results + if: always() && steps.detection_guard.outputs.run_detection == 'true' + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + - name: Upload threat detection log + if: always() && steps.detection_guard.outputs.run_detection == 'true' + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: detection + path: /tmp/gh-aw/threat-detection/detection.log + if-no-files-found: ignore + - name: Set detection conclusion + id: detection_conclusion + if: always() + env: + RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} + DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }} + run: | + if [[ "$RUN_DETECTION" != "true" ]]; then + echo "conclusion=skipped" >> "$GITHUB_OUTPUT" + echo "success=true" >> "$GITHUB_OUTPUT" + echo "Detection was not needed, marking as skipped" + elif [[ "$DETECTION_SUCCESS" == "true" ]]; then + echo "conclusion=success" >> "$GITHUB_OUTPUT" + echo "success=true" >> "$GITHUB_OUTPUT" + echo "Detection passed successfully" + else + echo "conclusion=failure" >> "$GITHUB_OUTPUT" + echo "success=false" >> "$GITHUB_OUTPUT" + echo "Detection found issues" + fi + + conclusion: + needs: + - activation + - agent + - safe_outputs + if: (always()) && ((needs.agent.result != 'skipped') || (needs.activation.outputs.lockdown_check_failed == 'true')) + runs-on: ubuntu-slim + permissions: + contents: read + discussions: write + issues: write + pull-requests: write + concurrency: + group: "gh-aw-conclusion-check_pr_issue_references" + cancel-in-progress: false + outputs: + noop_message: ${{ steps.noop.outputs.noop_message }} + tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} + total_count: ${{ steps.missing_tool.outputs.total_count }} + steps: + - name: Setup Scripts + uses: github/gh-aw-actions/setup@71cfb3cbe2002225f9d5afa180669fff36b86ea2 # v0.61.2 + with: + destination: ${{ runner.temp }}/gh-aw/actions + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_ENV" + - name: Process No-Op Messages + id: noop + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} + GH_AW_NOOP_MAX: "10" + GH_AW_WORKFLOW_NAME: "Check PR Issue References" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/noop.cjs'); + await main(); + - name: Record Missing Tool + id: missing_tool + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Check PR Issue References" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); + await main(); + - name: Handle Agent Failure + id: handle_agent_failure + if: always() + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Check PR Issue References" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_WORKFLOW_ID: "check_pr_issue_references" + GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} + GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} + GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} + GH_AW_GROUP_REPORTS: "false" + GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_TIMEOUT_MINUTES: "10" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); + await main(); + - name: Handle No-Op Message + id: handle_noop_message + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Check PR Issue References" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }} + GH_AW_NOOP_REPORT_AS_ISSUE: "true" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); + await main(); + + safe_outputs: + needs: agent + if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.agent.outputs.detection_success == 'true') + runs-on: ubuntu-slim + permissions: + contents: read + discussions: write + issues: write + pull-requests: write + timeout-minutes: 15 + env: + GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/check_pr_issue_references" + GH_AW_ENGINE_ID: "copilot" + GH_AW_WORKFLOW_ID: "check_pr_issue_references" + GH_AW_WORKFLOW_NAME: "Check PR Issue References" + outputs: + code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }} + code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }} + comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }} + comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }} + create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }} + create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }} + process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }} + process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} + steps: + - name: Setup Scripts + uses: github/gh-aw-actions/setup@71cfb3cbe2002225f9d5afa180669fff36b86ea2 # v0.61.2 + with: + destination: ${{ runner.temp }}/gh-aw/actions + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_ENV" + - name: Configure GH_HOST for enterprise compatibility + shell: bash + run: | + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Process Safe Outputs + id: process_safe_outputs + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} + GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_API_URL: ${{ github.api_url }} + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":10},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":10,\"report-as-issue\":\"true\"}}" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs'); + await main(); + - name: Upload Safe Output Items Manifest + if: always() + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: safe-output-items + path: /tmp/safe-output-items.jsonl + if-no-files-found: warn + diff --git a/.github/workflows/check_pr_issue_references.md b/.github/workflows/check_pr_issue_references.md new file mode 100644 index 000000000000..29c599e02a29 --- /dev/null +++ b/.github/workflows/check_pr_issue_references.md @@ -0,0 +1,136 @@ +--- +description: > + Checks whether issue/PR references in a PR body are actually related to the PR. + Posts an informational comment when suspicious references are detected. + +run-name: check_pr_issue_references + +on: + schedule: every 6h + workflow_dispatch: + inputs: + pr_numbers: + description: 'Comma-separated PR numbers to check (leave empty to auto-discover recent PRs)' + required: false + type: string + +permissions: + contents: read + issues: read + pull-requests: read + +engine: + id: copilot + +tools: + github: + toolsets: [issues, pull_requests, repos] + lockdown: false + min-integrity: none + repos: all + +network: + allowed: + - defaults + +safe-outputs: + add-comment: + max: 10 + noop: + max: 10 + +timeout-minutes: 10 +--- + +# Check PR Issue References + +You are a reference validator for the stdlib-js/stdlib repository. Your task is +to check whether issue/PR references in pull request descriptions are actually +related to the PRs. + +## Step 1: Discover PRs to Check + +If `${{ github.event.inputs.pr_numbers }}` is provided, parse it as a +comma-separated list of PR numbers and fetch those PRs. + +Otherwise, use the GitHub tool to list open pull requests in `stdlib-js/stdlib`, +sorted by `updated` in descending order. Filter to PRs whose `updated_at` is +within the last 7 hours. If no PRs match, call `noop` with "No recently updated +PRs found" and stop. + +Process at most 10 PRs per run. + +## Step 2: Check for Existing Comments (Deduplication) + +For each PR, before analyzing it: + +1. List comments on the PR using the GitHub tool. +2. If any comment body contains the heading `**Issue Reference Review**`, this + PR was already checked. Skip it and call `noop` with "PR #X already has an + Issue Reference Review comment. Skipping." +3. If no such comment exists, proceed to Step 3. + +## Step 3: Extract and Assess References + +For each PR that passes deduplication: + +1. **Extract all issue/PR references** from the PR body. Look for: + - `#123` (bare references) + - `stdlib-js/stdlib#123` (qualified references) + - `https://github.com/stdlib-js/stdlib/issues/123` (URL references) + - Pay special attention to closing keywords: Resolves, Closes, Fixes (and variants) + +2. **For each referenced issue/PR**, fetch its title and body using the GitHub tool. + +3. **Assess whether each reference is plausibly related** to the pull request: + - **related**: Clear topical connection (same package, same feature area, PR addresses the issue) + - **suspicious**: Connection is unclear or tenuous + - **unrelated**: Completely different topics, packages, or feature areas + +## Assessment Guidelines + +- stdlib is a large numerical/scientific computing library with thousands of packages + (e.g., `@stdlib/math/base/special/sin`, `@stdlib/stats/incr/mean`) +- A PR adding a new package often references the issue that requested it — this is VALID +- A PR fixing tests/benchmarks/docs for a package may reference the original creation issue — VALID +- References to "Tracking Issues" (issues listing many sub-tasks) are usually VALID +- PRs may reference broad project-wide issues — give benefit of the doubt +- **When in doubt, lean toward "related".** False positives are worse than false negatives. +- If a PR has no issue references at all, that is fine — call noop. +- If a PR has more than 10 references, call noop (too many to meaningfully assess). + +## Safe Outputs + +When calling `add-comment`, you **MUST** set the `item_number` parameter to the +PR number so the comment is posted on the correct PR. + +- **If ALL references appear related** (or there are no references): Call `noop` with a + brief explanation like "All N issue references in PR #X appear related." + +- **If any references appear suspicious or unrelated**: Use `add-comment` to post a + comment on the PR: + + > ⚠️ **Issue Reference Review** + > + > An automated check found potentially unrelated issue/PR references in this PR: + > + > | Reference | Assessment | Reasoning | + > | --- | --- | --- | + > | #123 | suspicious | PR adds math/sin but issue is about string/trim | + > + > **Why this matters:** GitHub automatically closes issues referenced with closing + > keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect references + > can accidentally close unrelated issues. + > + > **What to do:** + > - If the reference is correct, no action needed. This check may produce false positives. + > - If the reference is incorrect, please update your PR description. + > + > *This assessment was generated by an AI model and is informational only.* + + Only include suspicious/unrelated references in the table, not related ones. + +## Important Notes + +- Process each PR independently. A failure on one PR should not prevent checking others. +- A `noop` call is expected for each PR that is skipped or has all-valid references. diff --git a/.github/workflows/lint_changed_files.yml b/.github/workflows/lint_changed_files.yml index c80a5fe1d9b0..c5da1b28f6f3 100644 --- a/.github/workflows/lint_changed_files.yml +++ b/.github/workflows/lint_changed_files.yml @@ -147,7 +147,7 @@ jobs: - name: 'Lint Markdown files' if: success() || failure() run: | - files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -E '\.md$' | tr '\n' ' ' | sed 's/ $//') + files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -E '\.md$' | grep -v '^\.github/workflows/.*\.md$' | tr '\n' ' ' | sed 's/ $//') if [ -n "${files}" ]; then make lint-markdown-files FILES="${files}" fi @@ -274,7 +274,7 @@ jobs: # Pin action to full length commit SHA uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 with: - r-version: '3.5.3' + r-version: '4.2.0' # Lint R files: - name: 'Lint R files' @@ -345,7 +345,7 @@ jobs: - name: 'Lint license headers' if: success() || failure() run: | - files=$(echo "${{ steps.changed-files.outputs.files }}") + files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -v '\.github/workflows/.*\.md$' | grep -v '\.lock\.yml$' | tr '\n' ' ' | sed 's/ $//') if [[ -n "${files}" ]]; then make lint-license-headers-files FILES="${files}" fi diff --git a/.github/workflows/lint_random_files.yml b/.github/workflows/lint_random_files.yml index f717f630f6b4..03666d36eea8 100644 --- a/.github/workflows/lint_random_files.yml +++ b/.github/workflows/lint_random_files.yml @@ -374,7 +374,7 @@ jobs: # Pin action to full length commit SHA uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 with: - r-version: '4.3.3' + r-version: '4.2.0' # Lint R files: - name: 'Lint R files' diff --git a/.github/workflows/linux_benchmark.yml b/.github/workflows/linux_benchmark.yml index 559156f4f901..ad64e9eff26a 100644 --- a/.github/workflows/linux_benchmark.yml +++ b/.github/workflows/linux_benchmark.yml @@ -251,7 +251,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/linux_examples.yml b/.github/workflows/linux_examples.yml index 1ea1eceaed97..02e812e8486f 100644 --- a/.github/workflows/linux_examples.yml +++ b/.github/workflows/linux_examples.yml @@ -251,7 +251,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/linux_test.yml b/.github/workflows/linux_test.yml index 057e47128f1b..3af5b1445ea8 100644 --- a/.github/workflows/linux_test.yml +++ b/.github/workflows/linux_test.yml @@ -250,7 +250,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/linux_test_cov.yml b/.github/workflows/linux_test_cov.yml index 9fb2acdd8d31..6af3f85d7be0 100644 --- a/.github/workflows/linux_test_cov.yml +++ b/.github/workflows/linux_test_cov.yml @@ -251,7 +251,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/linux_test_install.yml b/.github/workflows/linux_test_install.yml index 01c3abb1a645..951191abd045 100644 --- a/.github/workflows/linux_test_install.yml +++ b/.github/workflows/linux_test_install.yml @@ -274,7 +274,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/macos_benchmark.yml b/.github/workflows/macos_benchmark.yml index 3a4535401fdb..dfc8b02121e4 100644 --- a/.github/workflows/macos_benchmark.yml +++ b/.github/workflows/macos_benchmark.yml @@ -237,7 +237,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/macos_test.yml b/.github/workflows/macos_test.yml index 908fc4b833b7..f2a330baf422 100644 --- a/.github/workflows/macos_test.yml +++ b/.github/workflows/macos_test.yml @@ -236,7 +236,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/macos_test_cov.yml b/.github/workflows/macos_test_cov.yml index 56b298de9c66..9985bbe7619c 100644 --- a/.github/workflows/macos_test_cov.yml +++ b/.github/workflows/macos_test_cov.yml @@ -237,7 +237,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/macos_test_npm_install.yml b/.github/workflows/macos_test_npm_install.yml index 0eaa89cd8518..471485a38058 100644 --- a/.github/workflows/macos_test_npm_install.yml +++ b/.github/workflows/macos_test_npm_install.yml @@ -233,7 +233,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/.github/workflows/markdown_links.yml b/.github/workflows/markdown_links.yml index 6de0081551ca..b90c92908ba9 100644 --- a/.github/workflows/markdown_links.yml +++ b/.github/workflows/markdown_links.yml @@ -176,7 +176,7 @@ jobs: # Upload the log files: - name: 'Upload log files' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact: diff --git a/.github/workflows/markdown_src_attributes.yml b/.github/workflows/markdown_src_attributes.yml index dca84a30b15d..3ae99f266675 100644 --- a/.github/workflows/markdown_src_attributes.yml +++ b/.github/workflows/markdown_src_attributes.yml @@ -119,7 +119,7 @@ jobs: # Upload the log files: - name: 'Upload log files' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact: diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml index 3ecf75f0154a..125ae98b2ed9 100644 --- a/.github/workflows/npm_downloads.yml +++ b/.github/workflows/npm_downloads.yml @@ -88,7 +88,7 @@ jobs: # Upload the download data: - name: 'Upload data' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: # Define a name for the uploaded artifact (ensuring a unique name for each job): name: npm_downloads diff --git a/.github/workflows/ossf_scorecard.yml b/.github/workflows/ossf_scorecard.yml index 9e950c368d52..dc1652261ab2 100644 --- a/.github/workflows/ossf_scorecard.yml +++ b/.github/workflows/ossf_scorecard.yml @@ -87,7 +87,7 @@ jobs: # Upload the results as artifacts: - name: "Upload artifact" # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: SARIF file path: results.sarif diff --git a/.github/workflows/process_metadata.yml b/.github/workflows/process_metadata.yml index d1d2220610ee..d775ba94ea1a 100644 --- a/.github/workflows/process_metadata.yml +++ b/.github/workflows/process_metadata.yml @@ -130,7 +130,7 @@ jobs: - name: 'Dispatch workflow with inputs' # Pin action to full length commit SHA - uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 + uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 # v1.3.1 if: ${{ steps.assert-write-access.outcome == 'success' && steps.check-workflow-dispatch.outputs.dispatch == 'true' }} with: workflow: ${{ steps.check-workflow-dispatch.outputs.workflow }} diff --git a/.github/workflows/publish_coverage_pr.yml b/.github/workflows/publish_coverage_pr.yml index 325b06eea6a4..3897aad3e2b0 100644 --- a/.github/workflows/publish_coverage_pr.yml +++ b/.github/workflows/publish_coverage_pr.yml @@ -53,7 +53,7 @@ jobs: - name: 'Download PR metadata' id: download-metadata # Pin action to full length commit SHA - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: pr-metadata path: pr-metadata/ @@ -110,7 +110,7 @@ jobs: - name: 'Download coverage artifacts' id: download-coverage # Pin action to full length commit SHA - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: coverage-artifacts path: artifacts/ diff --git a/.github/workflows/run_tests_coverage.yml b/.github/workflows/run_tests_coverage.yml index 71a59bc0d302..5ee3143ea928 100644 --- a/.github/workflows/run_tests_coverage.yml +++ b/.github/workflows/run_tests_coverage.yml @@ -228,8 +228,8 @@ jobs: # Specify whether to remove untracked files before checking out the repository: clean: false - # Limit clone depth to the most recent commit: - fetch-depth: 1 + # Fetch extra history so `git pull --rebase` can find a common ancestor: + fetch-depth: 20 # Token for accessing the repository: token: ${{ secrets.STDLIB_BOT_FGPAT_REPO_READ }} @@ -282,4 +282,22 @@ jobs: git config --local user.name "stdlib-bot" git add . git commit -m "Update artifacts" || exit 0 - git push "https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git" main + + REMOTE_URL="https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git" + MAX_ATTEMPTS=5 + for i in $(seq 1 $MAX_ATTEMPTS); do + if git push "$REMOTE_URL" main; then + echo "Push succeeded on attempt $i." + break + fi + if [ "$i" -eq "$MAX_ATTEMPTS" ]; then + echo "Push failed after $MAX_ATTEMPTS attempts." + exit 1 + fi + echo "Push failed on attempt $i. Pulling and retrying..." + git pull --rebase "$REMOTE_URL" main || { + echo "Rebase failed due to conflict. Falling back to merge..." + git rebase --abort + git pull --no-rebase "$REMOTE_URL" main + } + done diff --git a/.github/workflows/run_tests_coverage_pr.yml b/.github/workflows/run_tests_coverage_pr.yml index 359437790bc0..47505aadb85d 100644 --- a/.github/workflows/run_tests_coverage_pr.yml +++ b/.github/workflows/run_tests_coverage_pr.yml @@ -183,7 +183,7 @@ jobs: - name: 'Upload PR metadata' if: steps.check-changed.outputs.skip == 'false' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: pr-metadata path: pr-metadata/ @@ -193,7 +193,7 @@ jobs: - name: 'Upload coverage artifacts' if: steps.check-changed.outputs.skip == 'false' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: coverage-artifacts path: artifacts/ diff --git a/.github/workflows/scripts/run_affected_benchmarks/run b/.github/workflows/scripts/run_affected_benchmarks/run index b233ff4d28b1..eec70bfa3f88 100755 --- a/.github/workflows/scripts/run_affected_benchmarks/run +++ b/.github/workflows/scripts/run_affected_benchmarks/run @@ -30,7 +30,7 @@ # LOG_FILE Log file. # -# shellcheck disable=SC2034,SC2153,SC2317 +# shellcheck disable=SC2034,SC2086,SC2153,SC2317 # Ensure that the exit status of pipelines is non-zero in the event that at least one of the commands in a pipeline fails: set -o pipefail @@ -141,7 +141,8 @@ main() { # Run JS benchmarks: if [ -n "${js_bench_files}" ]; then - make benchmark-javascript-files FILES="${js_bench_files}" + # Invoke make in batches to avoid "Argument list too long" errors: + printf '%s\n' ${js_bench_files} | xargs sh -c 'make benchmark-javascript-files FILES="$*"' _ else echo 'No JavaScript benchmarks to run.' >&2 fi @@ -172,7 +173,8 @@ main() { fi if [ -n "${c_bench_files}" ]; then - make benchmark-c-files FILES="${c_bench_files}" + # Invoke make in batches to avoid "Argument list too long" errors: + printf '%s\n' ${c_bench_files} | xargs sh -c 'make benchmark-c-files FILES="$*"' _ else echo 'No C benchmarks to run.' >&2 fi diff --git a/.github/workflows/scripts/run_affected_tests/run b/.github/workflows/scripts/run_affected_tests/run index 29febccd88e9..cb1add9e441f 100755 --- a/.github/workflows/scripts/run_affected_tests/run +++ b/.github/workflows/scripts/run_affected_tests/run @@ -165,7 +165,8 @@ main() { files=$(echo "${files}" | grep -v '/fixtures/') || true if [[ -n "${files}" ]]; then - make test-javascript-files-min FILES="${files}" + # Invoke make in batches to avoid "Argument list too long" errors: + printf '%s\n' ${files} | xargs sh -c 'make test-javascript-files-min FILES="$*"' _ fi cleanup diff --git a/.github/workflows/standalone_keepalive.yml b/.github/workflows/standalone_keepalive.yml index 9e37cee7d47b..196c37a52c78 100644 --- a/.github/workflows/standalone_keepalive.yml +++ b/.github/workflows/standalone_keepalive.yml @@ -21,9 +21,9 @@ name: standalone_keepalive # Workflow triggers: on: - # Run the workflow on the first day of each week: + # Run the workflow daily: schedule: - - cron: '0 0 * * 1' + - cron: '0 2 * * *' # Allow the workflow to be manually run: workflow_dispatch: diff --git a/.github/workflows/standalone_publish.yml b/.github/workflows/standalone_publish.yml index ac0026a26864..fb8e2ce801e8 100644 --- a/.github/workflows/standalone_publish.yml +++ b/.github/workflows/standalone_publish.yml @@ -130,7 +130,7 @@ jobs: # Archive list of to be published packages: - name: 'Archive package list' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: ordered-pkg-list path: | diff --git a/.github/workflows/windows_test_npm_install.yml b/.github/workflows/windows_test_npm_install.yml index 940b858b671d..2b70267419ab 100644 --- a/.github/workflows/windows_test_npm_install.yml +++ b/.github/workflows/windows_test_npm_install.yml @@ -245,7 +245,7 @@ jobs: # Install Windows build tools for compiling Node.js native add-ons. - name: 'Install Windows build tools' # Pin action to full length commit SHA - uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0 + uses: crazy-max/ghaction-chocolatey@dff3862348493b11fba2fbc49147b6d2dfe09b66 # v4.0.0 with: args: install -y visualstudio2019buildtools visualstudio2019-workload-vctools timeout-minutes: 10 @@ -287,7 +287,7 @@ jobs: # Upload the log file: - name: 'Upload log file' # Pin action to full length commit SHA - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: always() with: # Define a name for the uploaded artifact (ensuring a unique name for each job): diff --git a/README.md b/README.md index 01d7bdc612d4..86fbb8532eed 100644 --- a/README.md +++ b/README.md @@ -18,21 +18,7 @@ limitations under the License. --> - - - - -
- -
- - - -
- -
- - + diff --git a/docs/assets/talks/devconf_pune_2026_gunj_joshi.png b/docs/assets/talks/devconf_pune_2026_gunj_joshi.png new file mode 100644 index 000000000000..2f6ac3dc92a2 Binary files /dev/null and b/docs/assets/talks/devconf_pune_2026_gunj_joshi.png differ diff --git a/docs/contributing/zulip_guide.md b/docs/contributing/zulip_guide.md new file mode 100644 index 000000000000..2916e5c9b883 --- /dev/null +++ b/docs/contributing/zulip_guide.md @@ -0,0 +1,136 @@ + + + + +# Zulip Guide + +> Guide to the stdlib Zulip chat. + +This guide provides best practices and community norms for the [**stdlib Zulip chat**][stdlib-zulip], home of the stdlib community (see [announcement][zulip-announcement]). Everyone is welcome to join or browse the web-public channels (which you can see without signing up). The community norms and guidelines provided in this document are to help ensure that everyone can get the most out of this platform and, hopefully, have a positive experience. + +## Getting Started + +When you first join, a welcome bot will greet you and share some tips specific to stdlib on how to participate effectively. If you're new to Zulip, you may also want to check out [Zulip's official getting started guide][zulip-getting-started] for a quick overview of how the platform works. If you've used other chat platforms, such as Slack or Discord, things should feel pretty familiar. The one key difference is that Zulip organizes conversations into "topics" rather than "threads". This allows for more focused discussions and makes it easier to follow specific conversations without getting lost in a stream of messages. For more on this, see [Zulip's introduction to topics][zulip-intro-to-topics]. + +We encourage you to come say hello and tell us a bit about yourself in the [**#introductions**][stdlib-introductions] channel. + +## Community Norms + +### Where to post + +First and foremost, whenever possible, try to post your questions **in public** (rather than sending direct messages, a.k.a. DMs). Asking questions in public is the fastest way to get a response, as more people can help, _plus_ it's likely that someone else will benefit from finding out the answer to your question. The stdlib team is active in the chat, so you shouldn't need to use **@-mentions** by default. + +Each channel has a description (don't worry too much about posting in the "right" channel—moderators can help [move content][zulip-move-content] if needed), and conversations are organized into [**topics**][zulip-intro-to-topics]. If you're starting a new discussion, try to pick a brief, descriptive topic name that captures the subject of your message. Topic names also help others find relevant information from past conversations (learn more about [Zulip search filters here][zulip-search-filters]). You can edit a topic name at any time, so if you realize that your original topic name isn't quite right, feel free to update it. + +Because it's easy to move content around, please **do NOT cross-post**. Not only can this be confusing, but you risk duplication of effort if multiple people respond to the same question in different channels. + +#### Channels + +When you first join, you'll automatically be subscribed to several "default" channels. However, there are more channels you might want to explore. + +The channels are roughly organized into categories in the left-hand sidebar. At the bottom, you can click on "Browse Channels" to see the full list. + +Some categories and channels of interest include: + +- **General Interest** + + - **announcements**: Announcements everyone should see, including new releases, blog posts, and public events. + - **general**: General topics. + - **office-hours**: Information related to stdlib's weekly [office hours][stdlib-office-hours]. + - **water-cooler**: A place to discuss random topics, unrelated to stdlib and its development. + +- **Feedback & Support** + + - **case-studies**: Using stdlib in your application? Got a cool new demo? Share it here! + - **feedback**: Post your reactions to or feedback on using stdlib. + - **problems**: For reporting and discussing issues in using stdlib. + - **user-questions**: For questions about how to accomplish your goals with stdlib. + +- **GSOC** + + - **gsoc-questions**: Interested in participating in Google Summer of Code? Have questions? Ask here! + +- **Contributors** + + - **dev**: General development topics. + - **dev-questions**: Ask questions related to developing stdlib. + - **getting-started**: Are you a new contributor? Post your questions here! + - **introductions**: Interested in contributing to stdlib? Please introduce yourself here! + - **review-requests**: Requests for PR reviews. + +- **Development**: Channels related to specific stdlib namespaces, and other areas such as documentation and tooling. + +- **GitHub**: These are feeds generated from GitHub activity, such as new issues and pull requests. You can use these channels to keep up with the latest activity in the project. + +- **Other** + + - **sandbox**: Experiment with Zulip here. + - **zulip**: Questions and discussion about using Zulip. + +### Custom Linkifiers + +We've set up some [custom linkifiers][zulip-linkifiers] to make it easy to share links to GitHub issues and pull requests. If you type **`#1234`** in a message, it will automatically link to the issue or PR with that number in the main [stdlib GitHub repository][stdlib-github-repo]. There's also a special linkifier for the [stdlib Google Summer of Code repo][stdlib-gsoc-repo]; you simply type **`#G{id-number}`**. Note that these work for both issues and pull requests (GitHub uses the same numbering for both). + +### Code of Conduct + +The [stdlib Code of Conduct][stdlib-code-of-conduct] applies to all community spaces, including stdlib's Zulip. Should you encounter an issue, [Zulip's reporting tools][zulip-reporting] and our moderation team will be notified and available to assist. + +## Feedback and Suggestions + +If you have feedback or suggestions about improving our Zulip community, don't hesitate to share your thoughts. We have a special meta channel, [**#zulip**][stdlib-zulip-channel], for discussing community-related topics. For more general feedback, there's also the aptly-named [**#feedback**][stdlib-feedback-channel] channel. + +The best part of open source is the community, so we're committed to making our Zulip a welcoming and inclusive space for everyone. We look forward to chatting with you there! + + + + diff --git a/docs/git-notes/12db091f535461d7b4a0df5d3d47627ad9234da2.txt b/docs/git-notes/12db091f535461d7b4a0df5d3d47627ad9234da2.txt new file mode 100644 index 000000000000..f75b83e486c1 --- /dev/null +++ b/docs/git-notes/12db091f535461d7b4a0df5d3d47627ad9234da2.txt @@ -0,0 +1,10 @@ +--- +type: amend-message +--- +chore: fix JavaScript lint errors + +PR-URL: #10804 +Closes: #10801 + +Reviewed-by: Geo Daoyu +Reviewed-by: Philipp Burckhardt diff --git a/docs/git-notes/43243ab71b8c84a2df4c19be8e9842f8ae9ddedc.txt b/docs/git-notes/43243ab71b8c84a2df4c19be8e9842f8ae9ddedc.txt new file mode 100644 index 000000000000..8a2462ecb19d --- /dev/null +++ b/docs/git-notes/43243ab71b8c84a2df4c19be8e9842f8ae9ddedc.txt @@ -0,0 +1,11 @@ +--- +type: amend-message +--- +chore: fix JavaScript lint errors + +PR-URL: #10731 +Closes: #10017 + +Assisted-by: Claude Opus 4.6 +Assisted-by: Egger +Reviewed-by: Philipp Burckhardt diff --git a/docs/git-notes/a60fc2596e69278abc19df474aa63f259f9bdbe5.txt b/docs/git-notes/a60fc2596e69278abc19df474aa63f259f9bdbe5.txt new file mode 100644 index 000000000000..78f2c78c43f1 --- /dev/null +++ b/docs/git-notes/a60fc2596e69278abc19df474aa63f259f9bdbe5.txt @@ -0,0 +1,8 @@ +--- +type: amend-message +--- +test: use `powf` in `absgammalnf` + +PR-URL: #10437 + +Reviewed-by: Philipp Burckhardt diff --git a/docs/talks.md b/docs/talks.md index 9e9503ed8356..9dec89734bb5 100644 --- a/docs/talks.md +++ b/docs/talks.md @@ -24,6 +24,19 @@ limitations under the License. > Talks featuring stdlib. +## 2026 + +### The Compute Revolution You’re Ignoring: JavaScript in Science + +> [Gunj Joshi][gunjjoshi], DevConf.IN, February 2026 + +
+ + The Compute Revolution You’re Ignoring: JavaScript in Science + +
+
+ ## 2025 ### The Future of Numerical Computing in JavaScript diff --git a/etc/typescript/tsconfig.json b/etc/typescript/tsconfig.json index f5bb973b1ce3..47016f7189f5 100644 --- a/etc/typescript/tsconfig.json +++ b/etc/typescript/tsconfig.json @@ -10,7 +10,7 @@ "forceConsistentCasingInFileNames": true, "keyofStringsOnly": false, "lib": [ - "es6" + "esnext" ], "module": "commonjs", "moduleResolution": "node", diff --git a/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/lib/write.js b/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/lib/write.js index 56197a3e0ab8..bdbf436e9a99 100644 --- a/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/lib/write.js +++ b/lib/node_modules/@stdlib/_tools/docs/www/readme-fragment-file-tree/lib/write.js @@ -20,9 +20,10 @@ // MODULES // -var path = require( 'path' ); +var join = require( 'path' ).join; var logger = require( 'debug' ); var mkdirp = require( 'mkdirp' ); +var dirname = require( '@stdlib/utils/dirname' ); var objectKeys = require( '@stdlib/utils/keys' ); var writeFile = require( '@stdlib/fs/write-file' ); @@ -72,8 +73,8 @@ function write( src, dest, db, clbk ) { i += 1; file = files[ i ]; - dpath = path.dirname( file.substring( src.length+1 ) ); // +1 to account for path separator - dpath = path.join( dest, dpath ); + dpath = dirname( file.substring( src.length+1 ) ); // +1 to account for path separator + dpath = join( dest, dpath ); debug( 'Creating output directory: %s', dpath ); mkdirp( dpath, onDir ); @@ -93,7 +94,7 @@ function write( src, dest, db, clbk ) { } debug( 'Successfully created output directory.' ); - fpath = path.join( dpath, BASENAME ); + fpath = join( dpath, BASENAME ); debug( 'Writing file %d of %d: %s', i+1, total, fpath ); writeFile( fpath, db[ file ], fopts, onWrite ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/lib/main.js index 3566e7c6e3bc..cf5cf817e6a2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/capitalized-comments/lib/main.js @@ -22,6 +22,7 @@ var isCapitalized = require( '@stdlib/assert/is-capitalized' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var uppercase = require( '@stdlib/string/base/uppercase' ); var ltrim = require( '@stdlib/string/left-trim' ); var copy = require( '@stdlib/utils/copy' ); var DEFAULTS = require( './defaults.json' ); @@ -57,7 +58,7 @@ function main( context ) { if ( hasOwnProp( options, 'whitelist' ) ) { opts.whitelist = options.whitelist.slice(); } - source = context.getSourceCode(); + source = context.sourceCode; visited = {}; /** @@ -89,7 +90,7 @@ function main( context ) { str = source.getText( comment ); idx = str.search( /[a-zA-Z]/ ); - ch = str.charAt( idx ).toUpperCase(); + ch = uppercase( str.charAt( idx ) ); replacement = str.slice( 0, idx ) + ch + str.slice( idx+1 ); return fixer.replaceText( comment, replacement ); } @@ -194,7 +195,7 @@ function main( context ) { var i; comments = source.getCommentsInside( node ); - scope = context.getScope( node ); + scope = source.getScope( node ); for ( i = 0; i < comments.length; i++ ) { comment = comments[ i ]; if ( comment.type !== 'Shebang' && !visited[ comment.range ] ) { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-annotation-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-annotation-spacing/lib/main.js index 34e11d5160d0..901f5c4ec238 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-annotation-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-annotation-spacing/lib/main.js @@ -66,7 +66,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/lib/main.js index b15b88a82148..8cb9fc46d9d7 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/lib/main.js @@ -18,11 +18,6 @@ 'use strict'; -// MODULES // - -var walk = require( 'acorn-walk' ); - - // VARIABLES // var RE_ANNOTATION = /^\s*(?:\* ){0,1}(?:\/\/|\/\*)* *(?:e\.g\.,){0,1} (returns|=>|throws)/; @@ -31,6 +26,93 @@ var rule; // FUNCTIONS // +/** +* Finds the nearest statement-level ancestor of a given AST node. +* +* @private +* @param {ASTNode} node - AST node +* @returns {ASTNode} statement-level ancestor +*/ +function findStatement( node ) { + while ( node ) { + if ( + node.type === 'VariableDeclaration' || + node.type === 'ExpressionStatement' || + node.type === 'ReturnStatement' || + node.type === 'ThrowStatement' || + node.type === 'IfStatement' || + node.type === 'ForStatement' || + node.type === 'WhileStatement' || + node.type === 'TryStatement' || + node.type === 'FunctionDeclaration' || + node.type === 'Program' + ) { + return node; + } + node = node.parent; + } + return null; +} + +/** +* Checks whether a comment is a return annotation and, if so, whether it follows marker style conventions. +* +* @private +* @param {Object} source - source code object +* @param {string} comment - comment to examine +* @returns {(string|null)} error message or null +*/ +function checkComment( source, comment ) { + var matches; + var token; + var node; + var type; + + matches = comment.value.match( RE_ANNOTATION ); + if ( matches ) { + type = matches[ 1 ]; + + // Find the preceding code token: + token = source.getTokenBefore( comment ); + if ( !token ) { + return 'Encountered an orphaned return annotation without a preceding node'; + } + // Check for orphaned annotation (preceding token is not on the same or previous line): + if ( comment.loc.start.line - token.loc.end.line > 1 ) { + return 'Encountered an orphaned return annotation without a preceding node'; + } + node = source.getNodeByRangeIndex( token.range[ 0 ] ); + if ( !node || node.type === 'Program' ) { + return 'Encountered an orphaned return annotation without a preceding node'; + } + node = findStatement( node ); + if ( !node || node.type === 'Program' ) { + return null; + } + switch ( type ) { + case 'returns': + if ( + node.type !== 'VariableDeclaration' && + ( node.type !== 'ExpressionStatement' || node.expression.type !== 'AssignmentExpression' ) + ) { + return 'Only include `// returns` after variable declarations or assignment expressions (use `=>` after `console.log`)'; + } + break; + case '=>': + if ( + node.type === 'VariableDeclaration' || + ( node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression' ) + ) { + return 'Use `// returns` after variable declarations or assignment expressions instead of `=>`'; + } + break; + default: + break; + } + } + return null; +} + /** * Rule for validating that return annotations follow marker style conventions. * @@ -38,7 +120,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. @@ -64,85 +146,17 @@ function main( context ) { function validate( node ) { var comments; var current; - var offset; - var prev; var msg; var i; comments = source.getAllComments( node ); - if ( comments.length > 0 ) { - current = comments[ 0 ]; - msg = checkComment( current, node, 0 ); + for ( i = 0; i < comments.length; i++ ) { + current = comments[ i ]; + msg = checkComment( source, current ); if ( msg ) { report( current.loc, msg ); } - for ( i = 1; i < comments.length; i++ ) { - prev = comments[ i-1 ]; - current = comments[ i ]; - offset = 0; - - // Check whether previous comment sits one line before the current one; if so, adjust offset for finding last node: - if ( current.loc.start.line === prev.loc.end.line + 1 ) { - offset = prev.loc.end.column - prev.loc.start.column + 1; - } - msg = checkComment( current, node, offset ); - if ( msg ) { - report( current.loc, msg ); - } - } - } - } - - /** - * Checks whether a comment is a return annotation and, if so, whether it follows marker style conventions. - * - * @private - * @param {string} comment - comment to examine - * @param {ASTNode} ast - node to examine - * @param {integer} offset - non-zero if previous line ends with a comment - * @returns {(string|null)} error message or null - */ - function checkComment( comment, ast, offset ) { - var matches; - var node; - var prev; - var type; - - matches = comment.value.match( RE_ANNOTATION ); - if ( matches ) { - offset += 1 + comment.loc.start.column; - prev = walk.findNodeAt( ast, null, comment.start-offset ); - type = matches[ 1 ]; - if ( !prev ) { - // Handle case when comment refers to node on the same line: - if ( walk.findNodeAt( ast, null, comment.start-1 ) ) { - return null; - } - return 'Encountered an orphaned return annotation without a preceding node'; - } - node = prev.node; - switch ( type ) { - case 'returns': - if ( - node.type !== 'VariableDeclaration' && - ( node.type !== 'ExpressionStatement' || node.expression.type !== 'AssignmentExpression' ) - ) { - return 'Only include `// returns` after variable declarations or assignment expressions (use `=>` after `console.log`)'; - } - break; - case '=>': - if ( - node.type === 'VariableDeclaration' || - ( node.type === 'ExpressionStatement' && node.expression === 'AssignmentExpression' ) - ) { - return 'Use `// returns` after variable declarations or assignment expressions instead of `=>`'; - } - break; - default: - break; - } } - return null; } return { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/test/fixtures/valid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/test/fixtures/valid.js index 357f04890ecd..bece76ceaf5d 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/test/fixtures/valid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-marker/test/fixtures/valid.js @@ -112,7 +112,7 @@ test = { 'code': [ 'var functionName = require( \'./../lib\' );', '', - 'console.log( functionName( Math.sqrt ) ); // eslint-disable-line stdlib/no-builtin-math', + 'console.log( functionName( Math.sqrt ) );', '// => \'sqrt\'', '', 'console.log( functionName( Float64Array ) );', diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/lib/main.js index 0adb9937bad0..bffc745fe233 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest-quote-props/lib/main.js @@ -154,7 +154,7 @@ function checkComment( comment ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js index 2f51061d1094..3ad66e9aa5bd 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js @@ -122,7 +122,7 @@ function main( context ) { var scope; var dir; - source = context.getSourceCode(); + source = context.sourceCode; if ( NODE_SHEBANG.test( source.text ) ) { // Do not lint executable Node.js script files: return {}; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/lib/main.js index 733049bd140a..8f9ce2a9aad6 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/empty-line-before-comment/lib/main.js @@ -40,7 +40,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js index a4f29a8ed00a..4ab1be53664e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js @@ -33,7 +33,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/lib/main.js index ce61a511673b..5384cd39ed62 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-blockquote-indentation/lib/main.js @@ -43,6 +43,26 @@ var rule; // FUNCTIONS // +/** +* Creates a location object. +* +* @private +* @param {Object} options - function options +* @returns {Object} location info +*/ +function locationInfo( options ) { + return { + 'start': { + 'line': options.startLine, + 'column': options.startColumn + }, + 'end': { + 'line': options.endLine, + 'column': options.endColumn + } + }; +} + /** * Rule for enforcing Markdown blockquote indentation in JSDoc descriptions. * @@ -63,7 +83,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -121,26 +141,6 @@ function main( context ) { } } - /** - * Creates a location object. - * - * @private - * @param {Object} options - function options - * @returns {Object} location info - */ - function locationInfo( options ) { - return { - 'start': { - 'line': options.startLine, - 'column': options.startColumn - }, - 'end': { - 'line': options.endLine, - 'column': options.endColumn - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/lib/main.js index 67158e3684a0..465952c1f504 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-character-style/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to enforce that Markdown checkboxes follow a specified style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/lib/main.js index 4df6a2e97dc3..621ebbebca82 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-checkbox-content-indent/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent Markdown checkboxes being followed by too much whitespace in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/lib/main.js index f1d26a5aaf9f..718ee97929c2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-code-block-style/lib/main.js @@ -38,7 +38,27 @@ var DOPTS = { var rule; -// MAIN // +// FUNCTIONS // + +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} /** * Rule for enforcing Markdown code blocks adhere to a specific style in JSDoc descriptions. @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/lib/main.js index 6744e401958a..eaa964245bde 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-case/lib/main.js @@ -25,6 +25,7 @@ var remark = require( 'remark' ); var remarkLint = require( 'remark-lint' ); var remarkPlugin = require( 'remark-lint-definition-case' ); var isObject = require( '@stdlib/assert/is-object' ); +var lowercase = require( '@stdlib/string/base/lowercase' ); var replace = require( '@stdlib/string/replace' ); var findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); @@ -40,6 +41,26 @@ var rule; // FUNCTIONS // +/** +* Creates a location object. +* +* @private +* @param {Object} options - function options +* @returns {Object} location info +*/ +function locationInfo( options ) { + return { + 'start': { + 'line': options.startLine, + 'column': options.startColumn + }, + 'end': { + 'line': options.endLine, + 'column': options.endColumn + } + }; +} + /** * Rule to require Markdown definition labels in JSDoc descriptions to be lowercased. * @@ -58,7 +79,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -116,26 +137,6 @@ function main( context ) { } } - /** - * Creates a location object. - * - * @private - * @param {Object} options - function options - * @returns {Object} location info - */ - function locationInfo( options ) { - return { - 'start': { - 'line': options.startLine, - 'column': options.startColumn - }, - 'end': { - 'line': options.endLine, - 'column': options.endColumn - } - }; - } - /** * Reports an error message. * @@ -178,7 +179,7 @@ function main( context ) { ]; definition = source.text.slice( range[ 0 ], range[ 1 ] ); definition = definition.substring( definition.indexOf( '[' ), definition.indexOf( ']' )+1 ); - lowercased = definition.toLowerCase(); + lowercased = lowercase( definition ); nodeSource = source.text.slice( jsdocRange[ 0 ], jsdocRange[ 1 ] ); text = replace( nodeSource, definition, lowercased ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/lib/main.js index 4ad759750997..bda8e157d2a6 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-definition-spacing/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Creates a location object. +* +* @private +* @param {Object} options - function options +* @returns {Object} location info +*/ +function locationInfo( options ) { + return { + 'start': { + 'line': options.startLine, + 'column': options.startColumn + }, + 'end': { + 'line': options.endLine, + 'column': options.endColumn + } + }; +} + /** * Rule to prevent consecutive whitespace in Markdown definition labels in JSDoc descriptions. * @@ -58,7 +78,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -116,26 +136,6 @@ function main( context ) { } } - /** - * Creates a location object. - * - * @private - * @param {Object} options - function options - * @returns {Object} location info - */ - function locationInfo( options ) { - return { - 'start': { - 'line': options.startLine, - 'column': options.startColumn - }, - 'end': { - 'line': options.endLine, - 'column': options.endColumn - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/lib/main.js index 85c166b15cb5..a0d16fc59b3f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-decimal-point/lib/main.js @@ -117,7 +117,7 @@ function checkComment( comment, rType, flg ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; var flg = false; /** diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/lib/main.js index f490487b8f1d..0a167717aaa3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/lib/main.js @@ -97,7 +97,7 @@ function checkComment( comment, ast, offset ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/invalid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/invalid.js index 63d24bad6a40..88b4b7e5c13b 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/invalid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/invalid.js @@ -122,7 +122,7 @@ test = { '*/', 'function isSharedArrayBuffer( value ) {', ' return (', - ' ( hasSharedArrayBuffer && value instanceof SharedArrayBuffer ) || // eslint-disable-line stdlib/require-globals, no-undef', + ' ( hasSharedArrayBuffer && value instanceof SharedArrayBuffer ) || // eslint-disable-line no-undef', ' nativeClass( value ) === \'[object SharedArrayBuffer]\'', ' );', '}' diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/valid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/valid.js index da8d03d630aa..b49d4778292f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/valid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-marker/test/fixtures/valid.js @@ -113,7 +113,7 @@ test = { '*/', 'function isSharedArrayBuffer( value ) {', ' return (', - ' ( hasSharedArrayBuffer && value instanceof SharedArrayBuffer ) || // eslint-disable-line stdlib/require-globals, no-undef', + ' ( hasSharedArrayBuffer && value instanceof SharedArrayBuffer ) || // eslint-disable-line no-undef', ' nativeClass( value ) === \'[object SharedArrayBuffer]\'', ' );', '}' diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/lib/main.js index 9e07e72b555a..80813604147d 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/lib/main.js @@ -157,7 +157,7 @@ function checkComment( comment ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js index efbc920500bd..c2f77c36ccf3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js @@ -131,7 +131,7 @@ function main( context ) { var opts; var dir; - source = context.getSourceCode(); + source = context.sourceCode; if ( NODE_SHEBANG.test( source.text ) ) { // Do not lint executable Node.js script files: return {}; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/lib/main.js index 670e0c4d5727..eb2c55b604b4 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-emphasis-marker/lib/main.js @@ -41,6 +41,26 @@ var rule; // FUNCTIONS // +/** +* Creates a location object. +* +* @private +* @param {Object} options - function options +* @returns {Object} location info +*/ +function locationInfo( options ) { + return { + 'start': { + 'line': options.startLine, + 'column': options.startColumn + }, + 'end': { + 'line': options.endLine, + 'column': options.endColumn + } + }; +} + /** * Rule for enforcing a specific Markdown emphasis marker in JSDoc descriptions. * @@ -61,7 +81,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -119,26 +139,6 @@ function main( context ) { } } - /** - * Creates a location object. - * - * @private - * @param {Object} options - function options - * @returns {Object} location info - */ - function locationInfo( options ) { - return { - 'start': { - 'line': options.startLine, - 'column': options.startColumn - }, - 'end': { - 'line': options.endLine, - 'column': options.endColumn - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/lib/main.js index 79a81a11172f..dca8a2266e97 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-empty-line-before-example/lib/main.js @@ -39,7 +39,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-example-require-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-example-require-spacing/lib/main.js index d371e73643a5..b1f21a947e80 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-example-require-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-example-require-spacing/lib/main.js @@ -72,7 +72,7 @@ function isEmpty( line ) { * @returns {Object} rule object */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/lib/main.js index 15dda58b9ef2..445a8148d12e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-flag/lib/main.js @@ -42,6 +42,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule for enforcing fenced Markdown code blocks to have a language flag. * @@ -62,7 +82,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -117,26 +137,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/lib/main.js index 15dc1a9e50ea..000c80b35e31 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-fenced-code-marker/lib/main.js @@ -42,6 +42,26 @@ var rule; // FUNCTIONS // +/** +* Creates a location object. +* +* @private +* @param {Object} options - function options +* @returns {Object} location info +*/ +function locationInfo( options ) { + return { + 'start': { + 'line': options.startLine, + 'column': options.startColumn + }, + 'end': { + 'line': options.endLine, + 'column': options.endColumn + } + }; +} + /** * Rule for enforcing a specific Markdown fenced code marker in JSDoc descriptions. * @@ -62,7 +82,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -120,26 +140,6 @@ function main( context ) { } } - /** - * Creates a location object. - * - * @private - * @param {Object} options - function options - * @returns {Object} location info - */ - function locationInfo( options ) { - return { - 'start': { - 'line': options.startLine, - 'column': options.startColumn - }, - 'end': { - 'line': options.endLine, - 'column': options.endColumn - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/lib/main.js index b395e2021eef..5dd4e8ff7a95 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-final-definition/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require Markdown definitions in JSDoc descriptions be placed at the end of the description. * @@ -58,7 +78,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -113,26 +133,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/lib/main.js index 5e3513bb2dcc..e78a4bff6ef8 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-first-heading-level/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require the first Markdown heading level be a specified level in JSDoc comments. * @@ -61,7 +81,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -116,26 +136,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/lib/main.js index 2d1362ef4b86..2977ee01cd2c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-hard-break-spaces/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent too many spaces from being used to hard break in JSDoc descriptions containing Markdown. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/lib/main.js index 5bf3565114d8..86ecd858f2ce 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-increment/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent Markdown headings from incrementing with more than one level at a time in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/lib/main.js index e9c3dca3954c..97119a33c4b5 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-heading-style/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to enforce that Markdown headings follow a specified style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/lib/main.js index 30125422411d..45db8d19fc8f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-leading-description-sentence/lib/main.js @@ -61,7 +61,7 @@ function main( context ) { if ( hasOwnProp( options, 'whitelist' ) ) { opts.whitelist = options.whitelist.slice(); } - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js index 751719e7f51e..b107758aaf44 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js @@ -40,7 +40,7 @@ var rule; */ function main( context ) { var filename = context.getFilename(); - var source = context.getSourceCode(); + var source = context.sourceCode; return { 'Program': validate diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/lib/main.js index 67f77a0a7f3e..88387b987e51 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-linebreak-style/lib/main.js @@ -35,6 +35,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to enforce that linebreaks follow a given or detected style in JSDoc comments. * @@ -62,7 +82,7 @@ function main( context ) { } lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -113,26 +133,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/lib/main.js index 8b32eacdcb79..1331f48d8338 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-link-title-style/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to enforce that link and definition titles use specified quotes in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/lib/main.js index 7ae4e113e0f6..fd9fa48d71e1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-bullet-indent/lib/main.js @@ -77,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/lib/main.js index 7b29e27245c1..4ddf6b27671e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-content-indent/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent mixed indentation in Markdown list item content in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/lib/main.js index 5d1c8d350390..66ecbc785c8a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-indent/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent spacing between a list item’s bullet and its content to violate a given style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/lib/main.js index c6dcd4cdc297..1900568714c1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-list-item-spacing/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to enforce consistent list item spacing in JSDoc descriptions. * @@ -66,7 +86,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -121,26 +141,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/lib/main.js index 5b10c63a8e3c..8e55e735d96f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-main-export/lib/main.js @@ -63,7 +63,7 @@ function main( context ) { var ending; var source; - source = context.getSourceCode(); + source = context.sourceCode; modulePath = context.getFilename(); // Get the part starting with `@stdlib`, shift by one to avoid leading `@`: diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/lib/main.js index a0645a10265d..2081e110d0dd 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-markdown-remark/lib/main.js @@ -58,7 +58,7 @@ function main( context ) { opts.config = {}; } lint = remark().use( opts.config ).processSync; - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/lib/main.js index 3c287b234641..7d8b9e044857 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-heading-length/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent Markdown headings from having too many characters in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/lib/main.js index 6435b1839adb..cd4f2400961a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-maximum-line-length/lib/main.js @@ -60,7 +60,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +115,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * @@ -151,6 +131,26 @@ function main( context ) { } } +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + // MAIN // diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/lib/main.js index 2d6d885d3656..44d1fd4934a7 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-auto-link-without-protocol/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require angle-bracketed Markdown links to contain protocols in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/lib/main.js index b67b969ba9c5..94a3969347ff 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require blank lines in Markdown blockquotes have a marker in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/test/fixtures/invalid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/test/fixtures/invalid.js index 00c8000c4298..579dd1b79e8e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/test/fixtures/invalid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-blockquote-without-marker/test/fixtures/invalid.js @@ -35,8 +35,7 @@ test = { '* Beep boop.', '*', '* > Beep...', - '*', - '* > ...boop.', + '* boop.', '*/', 'function beep() {', ' console.log( "boop" );', @@ -44,7 +43,7 @@ test = { ].join( '\n' ), 'errors': [ { - 'message': 'Missing marker in blockquote', + 'message': 'Missing marker in block quote', 'type': null } ] diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/lib/main.js index 30f5e1f5f87c..2b9c1f42e8a2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-consecutive-blank-lines/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent too many consecutive blank lines in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/lib/main.js index b2ab4350544d..8d8b1cb66a6a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-definitions/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent duplicate Markdown definitions in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/lib/main.js index c4407a210f37..489e4c788f83 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/lib/main.js @@ -77,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/lib/main.js index ecf73561fcb3..a61c30eb28cc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent duplicate Markdown headings in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/lib/main.js index 946c8527f76f..2d5e61f40333 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-tags/lib/main.js @@ -56,7 +56,7 @@ function main( context ) { if ( hasOwnProp( options, 'exceptions' ) ) { opts.exceptions = options.exceptions.slice(); } - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/lib/main.js index 048b372ec199..8f5fbaded7a3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-emphasis-as-heading/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent use of emphasis in place of a Markdown heading in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/lib/main.js index 52c4de881ea9..812e2fd3a0ca 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-empty-url/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent empty URLs in Markdown links and images in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/lib/main.js index 02d62b77403f..5b67bed1185c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-content-indent/lib/main.js @@ -77,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/lib/main.js index 784098029358..0a6676f7d39a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-indent/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent indentation of Markdown headings in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/lib/main.js index 714362369283..3115dd716bae 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-like-paragraph/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent Markdown paragraphs which appear to be h7+ "headings" in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/lib/main.js index 9788874274df..86c7e4769767 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-heading-punctuation/lib/main.js @@ -80,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/lib/main.js index 956c57034fe1..ad515b0515d3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-html/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent HTML from being used in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/lib/main.js index af911940a91e..642a2ddfe76c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-inline-padding/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent prevent padding of Markdown inline nodes between their markers and content in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/lib/main.js index 849598d7c72b..111ebccc284c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-literal-urls/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent URLs without angle-brackets from being used in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/lib/main.js index d179c96c1aa5..f28b29c3e889 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-missing-blank-lines/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require blank lines between Markdown block nodes in JSDoc descriptions. * @@ -68,7 +88,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -123,26 +143,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/lib/main.js index 66d81d1049dd..eed2567040a2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-blank-lines/lib/main.js @@ -39,7 +39,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/lib/main.js index eab0cda8fd39..de9a9c3f4641 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-multiple-toplevel-headings/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent multiple top-level Markdown headings from being used in JSDoc descriptions. * @@ -61,7 +81,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -116,26 +136,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/lib/main.js index 0f3687b04582..b6a36efd119a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-paragraph-content-indent/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent indentation of Markdown paragraph content in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/lib/main.js index a641aa8ff08a..9b3382cb6385 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-reference-like-url/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent Markdown references from being used like URLs in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/lib/main.js index eb51d778ddab..2b0cd4de1cb8 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shell-dollars/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent shell code in Markdown fenced code blocks from being prefixed by dollar-characters in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js index 255d2f91179b..57a16fc576ad 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js @@ -77,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/lib/main.js index c4b795bc29d1..e2440395041a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-link/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent shortcut Markdown reference links from being used in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/lib/main.js index 0019aeacbba7..257e492c9f65 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-space-aligned-asterisks/lib/main.js @@ -42,7 +42,7 @@ function main( context ) { var comment; var source; - source = context.getSourceCode(); + source = context.sourceCode; /** * Validates that a JSDoc comment does not start with space-aligned asterisks. @@ -60,7 +60,7 @@ function main( context ) { lines = comment.value.split( reEOL.REGEXP ); for ( i = 0; i < lines.length; i++ ) { if ( lines[ i ].charAt( 0 ) === ' ' ) { - hasLeadingSpace = true; + hasLeadingSpace = true; break; } } @@ -68,36 +68,6 @@ function main( context ) { report( comment.value, comment.loc, comment.range ); } } - - /** - * Reports the error message. - * - * @private - * @param {string} comment - comment text - * @param {Object} loc - location of comment node - * @param {Array} range - comment range - */ - function report( comment, loc, range ) { - context.report({ - 'node': null, - 'message': 'JSDoc comment should not have space-aligned asterisks', - 'loc': loc, - 'fix': fix - }); - - /** - * Fixes the lint error by removing leading spaces before asterisks. - * - * @private - * @param {Function} fixer - ESLint fixer - * @returns {(Object|null)} fix or null - */ - function fix( fixer ) { - var fixed = replace( comment, RE_LEADING_SPACE, '*' ); - fixed = '/*' + fixed + '*/'; - return fixer.replaceTextRange( range, fixed ); - } - } } return { @@ -105,6 +75,36 @@ function main( context ) { 'FunctionDeclaration': validate, 'FunctionExpression': validate }; + + /** + * Reports the error message. + * + * @private + * @param {string} comment - comment text + * @param {Object} loc - location of comment node + * @param {Array} range - comment range + */ + function report( comment, loc, range ) { + context.report({ + 'node': null, + 'message': 'JSDoc comment should not have space-aligned asterisks', + 'loc': loc, + 'fix': fix + }); + + /** + * Fixes the lint error by removing leading spaces before asterisks. + * + * @private + * @param {Function} fixer - ESLint fixer + * @returns {(Object|null)} fix or null + */ + function fix( fixer ) { + var fixed = replace( comment, RE_LEADING_SPACE, '$1' ); + fixed = '/*' + fixed + '*/'; + return fixer.replaceTextRange( range, fixed ); + } + } } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/lib/main.js index fd38de6c597f..5f6617020fbc 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-table-indentation/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent unnecessary indentation of Markdown tables in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/lib/main.js index cf4ed164d42e..a9125adf050c 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-tabs/lib/main.js @@ -36,6 +36,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule forbidding the use of tabs in JSDoc comments. * @@ -54,7 +74,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -108,26 +128,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/lib/main.js index 167a078e7a0d..accf0d1c5d50 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-undefined-references/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent references to undefined Markdown definitions in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/lib/main.js index 376641518c8e..7b6f59f0162f 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-unused-definitions/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent unused Markdown definitions in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/lib/main.js index 0e258dfb1e61..46187bce7497 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-style/lib/main.js @@ -85,7 +85,7 @@ function main( context ) { } }; lint = remark().use( config ).processSync; - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/lib/main.js index 0f8e7dc76073..b5f67fba1504 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule for enforcing a specified Markdown ordered list marker style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/test/fixtures/invalid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/test/fixtures/invalid.js index 7c0d373e54c1..4bc771e013d1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/test/fixtures/invalid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-value/test/fixtures/invalid.js @@ -148,6 +148,10 @@ test = { 'message': 'Marker should be `1`, was `2`', 'type': null }, + { + 'message': 'Marker should be `1`, was `2`', + 'type': null + }, { 'message': 'Marker should be `1`, was `2`', 'type': null diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/lib/main.js index e917b37fe0fe..57c2a5639f47 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-private-annotation/lib/main.js @@ -47,7 +47,7 @@ function main( context ) { var functionHash; var source; - source = context.getSourceCode(); + source = context.sourceCode; functionHash = {}; /** diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/lib/main.js index 17f16ab03915..df8e689d9f19 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-require-throws-tags/lib/main.js @@ -86,8 +86,8 @@ function extractFunctionBoundaries( node ) { elem = body[ i ]; if ( elem.type === 'FunctionDeclaration' ) { out.push({ - 'start': elem.start, - 'end': elem.end + 'start': elem.range[ 0 ], + 'end': elem.range[ 1 ] }); } } @@ -106,7 +106,7 @@ function main( context ) { var functionHash; var source; - source = context.getSourceCode(); + source = context.sourceCode; functionHash = {}; throwStatements = []; @@ -140,8 +140,8 @@ function main( context ) { annotations = extractThrowsAnnotations( node ); functionHash[ node.id.name ] = { 'name': node.id.name, - 'start': node.start, - 'end': node.end, + 'start': node.range[ 0 ], + 'end': node.range[ 1 ], 'loc': node.loc, 'throwAnnotations': annotations || [], 'functionBoundaries': extractFunctionBoundaries( node ), @@ -281,8 +281,8 @@ function main( context ) { callee = node.argument.callee; if ( callee && callee.name ) { obj = { - 'start': node.start, - 'end': node.end, + 'start': node.range[ 0 ], + 'end': node.range[ 1 ], 'type': callee.name }; throwStatements.push( obj ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/lib/main.js index 2059f734ac72..8183a53bc0fa 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-rule-style/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule for enforcing a specified Markdown horizontal rule style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/lib/main.js index f4ebc0d59fa0..08f90ffc9f58 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-strong-marker/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule for enforcing a specific Markdown strong marker in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/lib/main.js index 41025b90ed9f..1783d6480309 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-cell-padding/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require Markdown table cells in JSDoc descriptions to be correctly padded. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/lib/main.js index e7b57a9a3fa0..3ffa2e44cac2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipe-alignment/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require Markdown table pipe alignment in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/lib/main.js index 6ab41fe8975c..e98322483afe 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-table-pipes/lib/main.js @@ -39,6 +39,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to require pipes as fences for Markdown table rows in JSDoc descriptions. * @@ -57,7 +77,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -112,26 +132,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/lib/main.js index 2c5a8fdfa55a..8b5f361f0b50 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-names/lib/main.js @@ -56,7 +56,7 @@ function main( context ) { if ( hasOwnProp( options, 'tags' ) ) { opts.tags = options.tags; } - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/lib/main.js index ebbe80053125..40f418c711a0 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-order/lib/main.js @@ -55,7 +55,7 @@ function main( context ) { if ( hasOwnProp( options, 'order' ) ) { order = options.order.slice(); } - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, 'FunctionDeclaration:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/lib/main.js index 5234a1aed9be..0a1ad1b12d81 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-tag-spacing/lib/main.js @@ -44,7 +44,7 @@ var RE_SIMPLE_TAGS = /\*(\s*)@(see|private|module|namespace|name|memberof|readon function main( context ) { var source; - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, 'FunctionDeclaration:exit': validate, diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/lib/main.js index dfddd4ef5acf..5da7a97b4892 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/lib/main.js @@ -52,7 +52,7 @@ function main( context ) { var source; var opts; - source = context.getSourceCode(); + source = context.sourceCode; opts = copy( DEFAULTS ); options = context.options[ 0 ]; if ( hasOwnProp( options, 'types' ) ) { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/lib/main.js index add5893ed620..2df54a2e053b 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style/lib/main.js @@ -40,6 +40,26 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo( loc ) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule for enforcing a specified Markdown unordered list marker style in JSDoc descriptions. * @@ -60,7 +80,7 @@ function main( context ) { ] }; lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync - source = context.getSourceCode(); + source = context.sourceCode; return { 'FunctionExpression:exit': validate, @@ -115,26 +135,6 @@ function main( context ) { } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } - /** * Reports an error message. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/line-closing-bracket-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/line-closing-bracket-spacing/lib/main.js index 5fb5f51569a0..68f9f3357517 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/line-closing-bracket-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/line-closing-bracket-spacing/lib/main.js @@ -33,7 +33,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/lib/main.js index 52e803906373..37f174a65757 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-export-all/lib/main.js @@ -89,7 +89,7 @@ function main( context ) { var dir; var i; - source = context.getSourceCode(); + source = context.sourceCode; if ( !contains( source.text, ORDER_COMMENT ) ) { return {}; } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/lib/main.js index bc1353d1bddc..7d28cc86346e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/lib/main.js @@ -39,6 +39,30 @@ var OPTS = { // FUNCTIONS // +/** +* Extracts the package path from the `@see` tag. +* +* @private +* @param {Array} tags - array of tags +* @returns {string} package path +*/ +function extractPackagePath( tags ) { + var descr; + var tag; + var i; + if ( tags.length === 0 ) { + return null; + } + for ( i = tags.length - 1; i > 0; i-- ) { + tag = tags[ i ]; + if ( tag.title === 'see' ) { + descr = tag.description; + return descr.substring( 14, descr.length - 1 ); + } + } + return null; +} + /** * Rule for validating that packages in a namespace `index.js` file are listed in alphabetical order. * @@ -49,35 +73,11 @@ function main( context ) { var isNamespaceIndex; var source; - source = context.getSourceCode(); + source = context.sourceCode; return { 'Program:exit': validate }; - /** - * Extracts the package path from the `@see` tag. - * - * @private - * @param {Array} tags - array of tags - * @returns {string} package path - */ - function extractPackagePath( tags ) { - var descr; - var tag; - var i; - if ( tags.length === 0 ) { - return null; - } - for ( i = tags.length - 1; i > 0; i-- ) { - tag = tags[ i ]; - if ( tag.title === 'see' ) { - descr = tag.description; - return descr.substring( 14, descr.length - 1 ); - } - } - return null; - } - /** * Checks whether program is a namespace `index.js` file and if so, if packages are listed in alphabetical order. * diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/test/fixtures/valid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/test/fixtures/valid.js index 8c6fd5a06dcc..766dfb411206 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/test/fixtures/valid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/namespace-index-order/test/fixtures/valid.js @@ -184,22 +184,22 @@ test = { 'setReadOnly( ns, \'complex\', require( \'@stdlib/complex/cmplx\' ) );', '', '/**', - '* @name conj', + '* @name Complex64', '* @memberof ns', '* @readonly', - '* @type {Function}', - '* @see {@link module:@stdlib/complex/float64/conj}', + '* @constructor', + '* @see {@link module:@stdlib/complex/float32/ctor}', '*/', - 'setReadOnly( ns, \'conj\', require( \'@stdlib/complex/float64/conj\' ) );', + 'setReadOnly( ns, \'Complex64\', require( \'@stdlib/complex/float32/ctor\' ) );', '', '/**', - '* @name Complex64', + '* @name conj', '* @memberof ns', '* @readonly', - '* @constructor', - '* @see {@link module:@stdlib/complex/float32/ctor}', + '* @type {Function}', + '* @see {@link module:@stdlib/complex/float64/conj}', '*/', - 'setReadOnly( ns, \'Complex64\', require( \'@stdlib/complex/float32/ctor\' ) );', + 'setReadOnly( ns, \'conj\', require( \'@stdlib/complex/float64/conj\' ) );', '', '/**', '* @name Complex128', diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/README.md index 1f9b54febdd0..7b3e526cdba3 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/README.md @@ -104,6 +104,8 @@ var result = linter.verify( code, { */ ``` + + diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/lib/main.js index 92aed553e2cd..32304f5b3b93 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-big-int/lib/main.js @@ -33,22 +33,24 @@ var rule; * @returns {boolean} boolean indicating if using imported constructor from `@stdlib/bigint/ctor` */ function isImportedBigInt( scope ) { - var isNotBuiltIn; var v; - isNotBuiltIn = scope.set.has( 'BigInt' ); - if ( isNotBuiltIn ) { - v = scope.set.get( 'BigInt' ); - if ( - v.defs.length > 0 && - v.defs[ 0 ].node.type === 'VariableDeclarator' && - v.defs[ 0 ].node.init && - v.defs[ 0 ].node.init.type === 'CallExpression' && - v.defs[ 0 ].node.init.callee.name === 'require' && - v.defs[ 0 ].node.init.arguments[ 0 ].value === '@stdlib/bigint/ctor' - ) { - return true; + while ( scope ) { + if ( scope.set.has( 'BigInt' ) ) { + v = scope.set.get( 'BigInt' ); + if ( + v.defs.length > 0 && + v.defs[ 0 ].node.type === 'VariableDeclarator' && + v.defs[ 0 ].node.init && + v.defs[ 0 ].node.init.type === 'CallExpression' && + v.defs[ 0 ].node.init.callee.name === 'require' && + v.defs[ 0 ].node.init.arguments[ 0 ].value === '@stdlib/bigint/ctor' + ) { + return true; + } + return false; } + scope = scope.upper; } return false; } @@ -60,7 +62,7 @@ function isImportedBigInt( scope ) { * @returns {Object} validators */ function main( context ) { - var scope = context.getScope(); + var source = context.sourceCode; /** * Reports the error message. @@ -107,7 +109,7 @@ function main( context ) { node.callee.type === 'Identifier' && node.callee.name === 'BigInt' ) { - if ( isImportedBigInt( scope ) ) { + if ( isImportedBigInt( source.getScope( node ) ) ) { return; } report( node, 'CallExpression' ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/lib/main.js index a873e1fabbe1..8e56f81b6f49 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-comments/lib/main.js @@ -18,6 +18,11 @@ 'use strict'; +// MODULES // + +var trim = require( '@stdlib/string/base/trim' ); + + // VARIABLES // var rule; @@ -36,7 +41,7 @@ function main( context ) { var visited; var source; - source = context.getSourceCode(); + source = context.sourceCode; visited = {}; /** @@ -75,7 +80,7 @@ function main( context ) { * @param {ASTNode} comment - comment node */ function processComment( comment ) { - var text = comment.value.trim(); + var text = trim( comment.value ); if ( text === '' ) { report( comment ); } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-lines-between-requires/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-lines-between-requires/lib/main.js index 77418adfd7ff..d4b8f6b11f66 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-lines-between-requires/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-empty-lines-between-requires/lib/main.js @@ -103,7 +103,7 @@ function isRequireDeclaration( node ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; var lines = source.lines; /** diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/lib/main.js index 458d344cf9e5..de9c5733d652 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-multiple-empty-lines/lib/main.js @@ -50,7 +50,7 @@ function isSectionHeader( line ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; var lines = source.lines; /** diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-new-array/README.md b/lib/node_modules/@stdlib/_tools/eslint/rules/no-new-array/README.md index a16da76bc42a..53d4e8ca1fce 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-new-array/README.md +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-new-array/README.md @@ -108,6 +108,8 @@ var result = linter.verify( code, { */ ``` + + diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/lib/main.js index f0e7cb1c0915..6c9ddcc0bd66 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/lib/main.js @@ -81,8 +81,11 @@ function ascending( a, b ) { */ function main( context ) { var options; + var source; var opts; + source = context.sourceCode; + opts = copy( DEFAULTS ); options = context.options[ 0 ]; if ( hasOwnProp( options, 'builtinGlobals' ) ) { @@ -150,7 +153,7 @@ function main( context ) { function checkForGlobal( node ) { var parserOptions = context.parserOptions; var ecmaFeatures = parserOptions.ecmaFeatures || {}; - var scope = context.getScope(); + var scope = source.getScope( node ); // Node.js environment or modules have a special scope: if ( ecmaFeatures.globalReturn || node.sourceType === 'module' ) { @@ -164,9 +167,10 @@ function main( context ) { * Finds variables in the current scope. * * @private + * @param {ASTNode} node - AST node */ - function checkForBlock() { - findVariablesInScope( context.getScope() ); + function checkForBlock( node ) { + findVariablesInScope( source.getScope( node ) ); } return { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/test/fixtures/valid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/test/fixtures/valid.js index dd5d25eab1b4..09c9690988e1 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/test/fixtures/valid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-redeclare/test/fixtures/valid.js @@ -75,6 +75,7 @@ test = { 'builtinGlobals': true }], 'parserOptions': { + 'ecmaVersion': 2015, 'sourceType': 'module' } }; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/no-unnecessary-nested-functions/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/no-unnecessary-nested-functions/lib/main.js index 7d90f88059b5..99de63062283 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/no-unnecessary-nested-functions/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/no-unnecessary-nested-functions/lib/main.js @@ -34,7 +34,7 @@ var rule; * @returns {(Object|null)} scope */ function getScopeByNode( context, node ) { - var scopes = context.getSourceCode().scopeManager.scopes; + var scopes = context.sourceCode.scopeManager.scopes; var i; for ( i = scopes.length-1; i >= 0; i-- ) { if ( scopes[ i ].block === node ) { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/lib/main.js index a75bd4e8b64d..aaddb22ed824 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/repl-namespace-order/lib/main.js @@ -30,6 +30,43 @@ var OPTS_COMPARE = { // FUNCTIONS // +/** +* Extracts the alias value from a given node. +* +* @private +* @param {ASTNode} node - node containing properties to search +* @returns {string} alias value +*/ +function getAlias( node ) { + var props; + var alias; + var i; + + props = node.properties; + for ( i = 0; i < props.length; i++ ) { + if ( props[ i ].key.value === 'alias' ) { + alias = props[ i ].value.value; + if ( alias ) { + return alias; + } + } + } +} + +/** +* Compares two nodes and determines their order based on the alias property. +* +* @private +* @param {ASTNode} a - first node +* @param {ASTNode} b - second node +* @returns {number} number indicating sort order +*/ +function sortExpressions( a, b ) { + var aliasA = getAlias( a.arguments[ 0 ] ); + var aliasB = getAlias( b.arguments[ 0 ] ); + return aliasA.localeCompare( aliasB, 'en', OPTS_COMPARE ); +} + /** * Rule for validating that packages are added to a REPL namespace object in alphabetical order according to alias (namespace key). * @@ -42,43 +79,6 @@ function main( context ) { expressions = []; - /** - * Extracts the alias value from a given node. - * - * @private - * @param {ASTNode} node - node containing properties to search - * @returns {string} alias value - */ - function getAlias( node ) { - var props; - var alias; - var i; - - props = node.properties; - for ( i = 0; i < props.length; i++ ) { - if ( props[ i ].key.value === 'alias' ) { - alias = props[ i ].value.value; - if ( alias ) { - return alias; - } - } - } - } - - /** - * Compares two nodes and determines their order based on the alias property. - * - * @private - * @param {ASTNode} a - first node - * @param {ASTNode} b - second node - * @returns {number} number indicating sort order - */ - function sortExpressions( a, b ) { - var aliasA = getAlias( a.arguments[ 0 ] ); - var aliasB = getAlias( b.arguments[ 0 ] ); - return aliasA.localeCompare( aliasB, 'en', OPTS_COMPARE ); - } - /** * Fixes the lint error by reordering the packages. * @@ -95,7 +95,7 @@ function main( context ) { var txt; var i; - source = context.getSourceCode(); + source = context.sourceCode; replacingText = ''; startRange = expressions[0].range[ 0 ]; endRange = expressions[ expressions.length - 1 ].range[ 1 ]; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/lib/main.js index e330e9bc807a..2d4f959369c2 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-globals/lib/main.js @@ -40,8 +40,10 @@ var rule; */ function main( context ) { var options; + var source; var opts; + source = context.sourceCode; opts = copy( DEFAULTS ); options = context.options[ 0 ]; if ( hasOwnProp( options, 'globals' ) ) { @@ -78,7 +80,7 @@ function main( context ) { return void 0; } - scope = context.getScope( node ); + scope = source.getScope( node ); for ( i = 0; i < opts.globals.length; i++ ) { name = opts.globals[ i ]; if ( node.name === name ) { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-last-path-relative/test/fixtures/invalid.js b/lib/node_modules/@stdlib/_tools/eslint/rules/require-last-path-relative/test/fixtures/invalid.js index 277982d18130..6d9a9b06403b 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-last-path-relative/test/fixtures/invalid.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-last-path-relative/test/fixtures/invalid.js @@ -30,7 +30,7 @@ test = { ].join( '\n' ), 'errors': [ { - 'message': 'Last require statement in example files must be a relative path' + 'message': 'Last `require` statement in example files must be a relative path' } ] }; @@ -43,7 +43,7 @@ test = { ].join( '\n' ), 'errors': [ { - 'message': 'Last require statement in example files must be a relative path' + 'message': 'Last `require` statement in example files must be a relative path' } ] }; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/lib/main.js index 50ad0ed7c516..c8ff53bdb152 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-leading-slash/lib/main.js @@ -53,7 +53,7 @@ function main( context ) { * @returns {Object} fix */ function fixer( fixer ) { - var source = context.getSourceCode(); + var source = context.sourceCode; var value = source.getText( node ); var start = value.indexOf( '\'' ); var end = value.lastIndexOf( '\'' ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/lib/main.js index 83d8d320e195..192ff371e6e6 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-order/lib/main.js @@ -160,7 +160,7 @@ function main( context ) { replacingText = ''; requireDeclarations = []; - source = context.getSourceCode(); + source = context.sourceCode; // Get the text and rank for the require statements: for ( i = 0; i < requires.length; i++ ) { diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/lib/main.js index b3ec92dc64a9..86966db51dc6 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/require-spaces/lib/main.js @@ -73,7 +73,7 @@ function create( context ) { var arg; if ( node.callee.name === 'require' ) { - source = context.getSourceCode(); + source = context.sourceCode; tokens = source.getTokens( node ); open = tokens[ 1 ]; close = tokens[ tokens.length - 1 ]; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/lib/main.js index ec9dad423ccc..b32a4001b4af 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/section-header-empty-lines/lib/main.js @@ -63,7 +63,7 @@ function isSectionHeader( comment ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/lib/main.js index 31b162acfffb..6365b7d92a5a 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/section-headers/lib/main.js @@ -70,7 +70,7 @@ function isSectionHeader( comment ) { * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/lib/main.js index 9c368c52fa81..f0dd57019a7d 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/ternary-condition-parentheses/lib/main.js @@ -32,7 +32,7 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; /** * Reports the error message. diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest/lib/main.js index 582359dfc755..b5bf34ff8efd 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest/lib/main.js @@ -350,7 +350,7 @@ function main( context ) { var filename; var dir; - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; filename = context.getFilename(); // Only process TypeScript declaration files: diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/lib/main.js index 461aff1213e4..e1dc6c9a6416 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/uppercase-required-constants/lib/main.js @@ -22,6 +22,7 @@ var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var isUppercase = require( '@stdlib/assert/is-uppercase' ); +var uppercase = require( '@stdlib/string/base/uppercase' ); // VARIABLES // @@ -67,8 +68,8 @@ function main( context ) { var id; id = node.declarations[ 0 ].id; - src = context.getSourceCode().getText( id ); - rep = src.toUpperCase(); + src = context.sourceCode.getText( id ); + rep = uppercase( src ); return fixer.replaceText( id, rep ); } } diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/lib/main.js index 9f54ca98a843..fd16411a38ed 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/vars-order/lib/main.js @@ -132,7 +132,7 @@ function main( context ) { declarations = []; replacingText = ''; body = node.body.body; - source = context.getSourceCode(); + source = context.sourceCode; for ( i = 0; i < body.length; i++ ) { elem = body[ i ]; diff --git a/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/examples/index.js b/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/examples/index.js index 9fe1dd11fedb..f4a75997c744 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/examples/index.js +++ b/lib/node_modules/@stdlib/_tools/eslint/utils/find-jsdoc/examples/index.js @@ -32,7 +32,7 @@ var code; * @returns {Object} visitors */ function rule( context ) { - var source = context.getSourceCode(); + var source = context.sourceCode; return { 'FunctionExpression:exit': log, diff --git a/lib/node_modules/@stdlib/_tools/github/create-repo/README.md b/lib/node_modules/@stdlib/_tools/github/create-repo/README.md index 93b5c62eb8a8..49ca0ec9acfe 100644 --- a/lib/node_modules/@stdlib/_tools/github/create-repo/README.md +++ b/lib/node_modules/@stdlib/_tools/github/create-repo/README.md @@ -36,6 +36,8 @@ limitations under the License. ## Usage + + ```javascript var createRepo = require( '@stdlib/_tools/github/create-repo' ); ``` @@ -46,6 +48,8 @@ var createRepo = require( '@stdlib/_tools/github/create-repo' ); + + ```javascript var opts = { 'token': 'tkjorjk34ek3nj4!' @@ -92,6 +96,8 @@ To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] op + + ```javascript var opts = { 'token': 'tkjorjk34ek3nj4!' @@ -104,6 +110,8 @@ To specify a [user agent][github-user-agent], set the `useragent` option. + + ```javascript var opts = { 'token': 'tkjorjk34ek3nj4!', @@ -117,6 +125,8 @@ By default, the `function` [creates][github-create-repo] a repository for the au + + ```javascript var opts = { 'token': 'tkjorjk34ek3nj4!', @@ -132,6 +142,8 @@ Creates a reusable `function`. + + ```javascript var opts = { 'token': 'tkjorjk34ek3nj4!', @@ -178,6 +190,8 @@ The factory method accepts the same `options` as [`createRepo()`](#create-repo). ## Examples + + ```javascript @@ -207,6 +221,8 @@ function clbk( error, repo, info ) { **Note**: in order to run the example, you will need to obtain an access [token][github-token] and modify the `token` option accordingly. + + diff --git a/lib/node_modules/@stdlib/_tools/github/user-details/README.md b/lib/node_modules/@stdlib/_tools/github/user-details/README.md index 8b51dcad0549..c17018b90308 100644 --- a/lib/node_modules/@stdlib/_tools/github/user-details/README.md +++ b/lib/node_modules/@stdlib/_tools/github/user-details/README.md @@ -37,7 +37,7 @@ limitations under the License. ## Usage ```javascript -var userinfo = require( 'github-user-details' ); +var userinfo = require( '@stdlib/_tools/github/user-details' ); ``` @@ -95,6 +95,10 @@ The `function` accepts the following `options`: To [authenticate][github-oauth2] with GitHub, set the [`token`][github-token] option. + + + + ```javascript var opts = { 'usernames': ['kgryte'], @@ -106,6 +110,8 @@ userinfo( opts, clbk ); To specify a [user agent][github-user-agent], set the `useragent` option. + + ```javascript var opts = { 'usernames': [ 'kgryte', 'Planeshifter' ], @@ -119,6 +125,10 @@ userinfo( opts, clbk ); Creates a reusable `function`. + + + + ```javascript var opts = { 'usernames': [ 'kgryte', 'Planeshifter' ], @@ -135,6 +145,14 @@ get(); The factory method accepts the same `options` as [`userinfo()`](#userinfo). + + + + + + +
+ ## Notes - If the module encounters an application-level `error` (e.g., no network connection, etc), that `error` is returned immediately to the provided `callback`. @@ -159,7 +177,7 @@ The factory method accepts the same `options` as [`userinfo()`](#userinfo). ```javascript -var userinfo = require( 'github-user-details' ); +var userinfo = require( '@stdlib/_tools/github/user-details' ); var opts = { 'usernames': [ @@ -224,7 +242,7 @@ Options: - In addition to the [`token`][github-token] option, the [token][github-token] may also be specified by a [`GITHUB_TOKEN`][github-token] environment variable. The command-line option **always** takes precedence. - If a user's [details][github-user-details] are successfully resolved, the user info is written to `stdout`. -- If a user's [details][github-user-details] cannot be resolved due to a downstream `error` (failure), the `username` (and its associated `error`) is written to `sterr`. +- If a user's [details][github-user-details] cannot be resolved due to a downstream `error` (failure), the `username` (and its associated `error`) is written to `stderr`. - Output order is **not** guaranteed to match input order. - [Rate limit][github-rate-limit] information is written to `stderr`. diff --git a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js index a6719d0c8886..2e633ddb5c3f 100644 --- a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js @@ -89,10 +89,8 @@ function plugin( dir ) { opts = {}; opts.cwd = dir; - args = new Array( 1 ); - // Target: - args[ 0 ] = 'view-cov'; + args = [ 'view-cov' ]; proc = spawn( 'make', args, opts ); proc.on( 'error', onError ); diff --git a/lib/node_modules/@stdlib/_tools/modules/import-require/README.md b/lib/node_modules/@stdlib/_tools/modules/import-require/README.md index b041d84447c5..a2dc6bf7fbe5 100644 --- a/lib/node_modules/@stdlib/_tools/modules/import-require/README.md +++ b/lib/node_modules/@stdlib/_tools/modules/import-require/README.md @@ -40,6 +40,8 @@ var ls = require( '@stdlib/_tools/modules/import-require' ); Searches for import and require paths in a source `string` or [`Buffer`][node-buffer]. + + ```javascript var readFile = require( '@stdlib/fs/read-file' ).sync; @@ -64,6 +66,8 @@ The returned `object` has the following fields: - The function correctly resolves evaluated expressions: + + ```javascript @@ -80,12 +84,16 @@ The returned `object` has the following fields: */ ``` +
+
## Examples + + ```javascript diff --git a/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/lib/resolve.js b/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/lib/resolve.js index 9a0b765f77bf..4867711674f4 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/lib/resolve.js +++ b/lib/node_modules/@stdlib/_tools/pkgs/browser-compatible/lib/resolve.js @@ -51,19 +51,19 @@ function getPkgs( pkgs, dir, clbk ) { len = pkgs.length; debug( 'Resolving %d packages...', len ); - out = new Array( len ); + out = []; count = 0; for ( i = 0; i < len; i++ ) { debug( 'Resolving package: %s (%d of %d).', pkgs[ i ], i+1, len ); opts = { 'basedir': dir }; - out[ i ] = { + out.push({ 'id': null, 'pkg': pkgs[ i ], 'dir': null, 'data': null - }; + }); resolve( pkgs[ i ], opts, createClbk( i ) ); } /** diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js index 2e4b88739d22..75bb9746aaf3 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js @@ -30,6 +30,47 @@ var keys = require( '@stdlib/utils/keys' ); var debug = logger( 'remark-lint-expected-html-sections' ); var RE_SECTION_START = //; var RE_SECTION_END = /<\/section>/; +var RE_HTML_COMMENT = /^\s*\s*$/; + + +// FUNCTIONS // + +/** +* Returns a message anchor node. +* +* @private +* @param {Node} tree - abstract syntax tree (AST) +* @returns {Node} anchor node +*/ +function getAnchorNode( tree ) { + var node; + var i; + + for ( i = 0; i < tree.children.length; i++ ) { + node = tree.children[ i ]; + if ( node.type === 'yaml' ) { + continue; + } + if ( node.type === 'html' && RE_HTML_COMMENT.test( node.value ) ) { + continue; + } + return node; + } + return tree; +} + +/** +* Reports a lint message. +* +* @private +* @param {File} file - virtual file +* @param {Node} node - anchor node +* @param {string} msg - message +* @returns {void} +*/ +function reportMessage( file, node, msg ) { + file.message( msg, node, 'remark-lint:expected-html-sections' ); +} // MAIN // @@ -60,6 +101,7 @@ function factory( options ) { var sectionsFound; var sectionStack; var missingRoot; + var anchorNode; var missingC; var schema; var msg; @@ -78,6 +120,9 @@ function factory( options ) { 'c': {} }; + // Anchor messages to content nodes so inline lint comments can control reporting: + anchorNode = getAnchorNode( tree ); + // Visit all HTML nodes to build section structure: visit( tree, 'html', visitor ); @@ -101,7 +146,7 @@ function factory( options ) { if ( missingRoot.length > 0 ) { msg = 'Missing required root-level sections: `' + missingRoot.join( '`, `' ) + '`. Required sections are: `' + requiredRootSections.join( '`, `' ) + '`. missing-required-sections'; debug( msg ); - file.message( msg, tree, 'remark-lint:expected-html-sections' ); + reportMessage( file, anchorNode, msg ); } // If 'c' section exists, check its requirements: @@ -119,7 +164,7 @@ function factory( options ) { if ( missingC.length > 0 ) { msg = 'Missing required sections in "c" section: `' + missingC.join( '`, `' ) + '`. Required C sections are: `' + requiredCSections.join( '`, `' ) + '`. missing-required-c-sections'; debug( msg ); - file.message( msg, sectionsFound.root.c.node, 'remark-lint:expected-html-sections' ); + reportMessage( file, sectionsFound.root.c.node, msg ); } } diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md index ae85e0007f2d..c0846c0b9547 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/examples/fixtures/asinh/README.md @@ -91,6 +91,8 @@ v = asinh( Infinity );
+ +
## Examples diff --git a/lib/node_modules/@stdlib/_tools/repl-txt/rules/line-length/lib/main.js b/lib/node_modules/@stdlib/_tools/repl-txt/rules/line-length/lib/main.js index d72cea5ffa5c..e5a3a7cb3a0d 100644 --- a/lib/node_modules/@stdlib/_tools/repl-txt/rules/line-length/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/repl-txt/rules/line-length/lib/main.js @@ -51,6 +51,22 @@ function pkg2alias( pkg ) { return null; } +/** +* Replaces a matched alias annotation with the alias corresponding to the package path. +* +* @private +* @param {string} match - alias annotation +* @param {string} pkg - package name +* @returns {string} alias name or original string +*/ +function substituteAlias( match, pkg ) { + var alias = pkg2alias( pkg ); + if ( alias ) { + return alias; + } + return match; +} + // MAIN // @@ -86,22 +102,6 @@ function main( context ) { } } - /** - * Replaces a matched alias annotation with the alias corresponding to the package path. - * - * @private - * @param {string} match - alias annotation - * @param {string} pkg - package name - * @returns {string} alias name or original string - */ - function substituteAlias( match, pkg ) { - var alias = pkg2alias( pkg ); - if ( alias ) { - return alias; - } - return match; - } - return { 'function': lineLength }; diff --git a/lib/node_modules/@stdlib/_tools/scripts/publish_packages.js b/lib/node_modules/@stdlib/_tools/scripts/publish_packages.js index 3b09516dc7f3..1887fa25a0fc 100644 --- a/lib/node_modules/@stdlib/_tools/scripts/publish_packages.js +++ b/lib/node_modules/@stdlib/_tools/scripts/publish_packages.js @@ -46,7 +46,6 @@ var memoize = require( '@stdlib/utils/memoize' ); var repeat = require( '@stdlib/string/repeat' ); var trim = require( '@stdlib/string/trim' ); var copy = require( '@stdlib/utils/copy' ); -var sample = require( '@stdlib/random/sample' ); var rootDir = require( '@stdlib/_tools/utils/root-dir' ); var rescape = require( '@stdlib/utils/escape-regexp-string' ); var replace = require( '@stdlib/string/replace' ); @@ -56,6 +55,8 @@ var reFromString = require( '@stdlib/utils/regexp-from-string' ); var startsWith = require( '@stdlib/string/starts-with' ); var substringAfterLast = require( '@stdlib/string/substring-after-last' ); var currentYear = require( '@stdlib/time/current-year' ); +var dayOfYear = require( '@stdlib/time/day-of-year' ); +var ceil = require( '@stdlib/math/base/special/ceil' ); var namespaceDeps = require( '@stdlib/_tools/pkgs/namespace-deps' ); var depList = require( '@stdlib/_tools/pkgs/dep-list' ); var name2standalone = require( '@stdlib/_tools/pkgs/name2standalone' ); @@ -77,7 +78,7 @@ var debug = logger( 'scripts:publish-packages' ); var START_PKG_INDEX = parseInt( flags[ 'start-index' ], 10 ) || 0; var END_PKG_INDEX = ( flags[ 'end-index' ] === void 0 ) ? 9999 : parseInt( flags[ 'end-index' ], 10 ); var MAX_TREE_DEPTH = 99; -var KEEP_ALIVE_SAMPLE_SIZE = 1000; +var KEEP_ALIVE_SAMPLE_SIZE = 150; var topics = setTopics.factory({ 'token': ENV.GITHUB_TOKEN @@ -1507,6 +1508,8 @@ function publish( pkg, clbk ) { */ function main() { var repeatedTry; + var batchIndex; + var nBatches; var fpath; var pkgs; var idx; @@ -1542,10 +1545,10 @@ function main() { pkgs = pkgs.slice( START_PKG_INDEX, END_PKG_INDEX + 1 ); if ( flags[ 'keep-alive' ] ) { - pkgs = sample( pkgs, { - 'size': KEEP_ALIVE_SAMPLE_SIZE, - 'replace': false - }); + // Select a deterministic batch of packages based on the current day of the year, ensuring all packages get updated over a regular cycle... + nBatches = ceil( pkgs.length / KEEP_ALIVE_SAMPLE_SIZE ); + batchIndex = dayOfYear() % nBatches; + pkgs = pkgs.slice( batchIndex * KEEP_ALIVE_SAMPLE_SIZE, ( batchIndex + 1 ) * KEEP_ALIVE_SAMPLE_SIZE ); } for ( i = 0; i < pkgs.length; i++ ) { pkgs[ i ] = replace( pkgs[ i ], '@stdlib/', '' ); diff --git a/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md b/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md index 2a6bd541a1bd..a9ec9aea20bd 100644 --- a/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md +++ b/lib/node_modules/@stdlib/_tools/utils/uncapitalize-pkg-description/README.md @@ -70,6 +70,8 @@ out = uncapitalizeDescription( 'Return a JSON representation of an error object. + diff --git a/lib/node_modules/@stdlib/array/README.md b/lib/node_modules/@stdlib/array/README.md index 5bb8e9bc5fd6..837abb8fdb58 100644 --- a/lib/node_modules/@stdlib/array/README.md +++ b/lib/node_modules/@stdlib/array/README.md @@ -191,6 +191,7 @@ Lastly, the namespace contains various other functions for dealing with arrays, - [`nansLike( x[, dtype] )`][@stdlib/array/nans-like]: create an array filled with NaNs and having the same length and data type as a provided array. - [`nans( length[, dtype] )`][@stdlib/array/nans]: create an array filled with NaNs and having a specified length. - [`nextDataType( [dtype] )`][@stdlib/array/next-dtype]: return the next larger array data type of the same kind. +- [`nulls( length[, dtype] )`][@stdlib/array/nulls]: create an array filled with nulls and having a specified length. - [`oneToLike( x[, dtype] )`][@stdlib/array/one-to-like]: generate a linearly spaced numeric array whose elements increment by `1` starting from one and having the same length and data type as a provided input array. - [`oneTo( n[, dtype] )`][@stdlib/array/one-to]: generate a linearly spaced numeric array whose elements increment by `1` starting from one. - [`onesLike( x[, dtype] )`][@stdlib/array/ones-like]: create an array filled with ones and having the same length and data type as a provided array. @@ -333,6 +334,8 @@ console.log( objectKeys( ns ) ); [@stdlib/array/next-dtype]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/next-dtype +[@stdlib/array/nulls]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/nulls + [@stdlib/array/one-to-like]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/one-to-like [@stdlib/array/one-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/one-to diff --git a/lib/node_modules/@stdlib/array/base/README.md b/lib/node_modules/@stdlib/array/base/README.md index 7eca083461bf..849016168020 100644 --- a/lib/node_modules/@stdlib/array/base/README.md +++ b/lib/node_modules/@stdlib/array/base/README.md @@ -124,6 +124,7 @@ The namespace exports the following: - [`everyByRight( x, predicate[, thisArg] )`][@stdlib/array/base/every-by-right]: test whether all elements in an array pass a test implemented by a predicate function, iterating from right to left. - [`everyBy( x, predicate[, thisArg] )`][@stdlib/array/base/every-by]: test whether all elements in an array pass a test implemented by a predicate function. - [`every( x )`][@stdlib/array/base/every]: test whether all elements in an array are truthy. +- [`falses( len )`][@stdlib/array/base/falses]: create a "generic" array filled with `false` values. - [`fancySliceAssign( x, y, s, strict )`][@stdlib/array/base/fancy-slice-assign]: assign element values from a broadcasted input array to corresponding elements in an output array. - [`fancySlice( x, s, strict )`][@stdlib/array/base/fancy-slice]: return a shallow copy of a portion of an array. - [`fillBy( x, start, end, fcn[, thisArg] )`][@stdlib/array/base/fill-by]: fill all elements within a portion of an array according to a callback function. @@ -260,6 +261,7 @@ The namespace exports the following: - [`toDeduped( x, limit, equalNaNs )`][@stdlib/array/base/to-deduped]: copy elements to a new "generic" array after removing consecutive duplicated values. - [`toInsertedAt( x, index, value )`][@stdlib/array/base/to-inserted-at]: return a new array containing every element from an input array and with a provided value inserted at a specified index. - [`toReversed( x )`][@stdlib/array/base/to-reversed]: return a new array with elements in reverse order. +- [`trues( len )`][@stdlib/array/base/trues]: create a "generic" array filled with `true` values. - [`unary2dBy( arrays, shape, fcn, clbk[, thisArg] )`][@stdlib/array/base/unary2d-by]: apply a unary function to each element retrieved from a two-dimensional nested input array according to a callback function and assign results to elements in a two-dimensional nested output array. - [`unary2d( arrays, shape, fcn )`][@stdlib/array/base/unary2d]: apply a unary callback to elements in a two-dimensional nested input array and assign results to elements in a two-dimensional nested output array. - [`unary3dBy( arrays, shape, fcn, clbk[, thisArg] )`][@stdlib/array/base/unary3d-by]: apply a unary function to each element retrieved from a three-dimensional nested input array according to a callback function and assign results to elements in a three-dimensional nested output array. @@ -500,6 +502,8 @@ var squared = ns.map2d( arr2d, [ 2, 3 ], randu ); [@stdlib/array/base/every]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/every +[@stdlib/array/base/falses]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/falses + [@stdlib/array/base/fancy-slice-assign]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/fancy-slice-assign [@stdlib/array/base/fancy-slice]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/fancy-slice @@ -772,6 +776,8 @@ var squared = ns.map2d( arr2d, [ 2, 3 ], randu ); [@stdlib/array/base/to-reversed]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/to-reversed +[@stdlib/array/base/trues]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/trues + [@stdlib/array/base/unary2d-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/unary2d-by [@stdlib/array/base/unary2d]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/unary2d diff --git a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md index 225cc6d06c96..a357ea835c3f 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/README.md @@ -28,7 +28,7 @@ An accessor array is defined as either an [`Array`][mdn-array], [`Typed Array`][
- +
@@ -71,7 +71,7 @@ var bool = isAccessorArray( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/examples/index.js b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/examples/index.js index 49406082e6d9..97d2fa6ef11a 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/assert/is-accessor-array/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md index 33f266db84c1..eef243c63959 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/README.md @@ -26,7 +26,7 @@ limitations under the License.
- +
@@ -66,7 +66,7 @@ var bool = isBooleanArray( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/examples/index.js b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/examples/index.js index 938f142a48bc..3c6a88285553 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/assert/is-booleanarray/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md index 4c339ffb6e36..da1838df3644 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/README.md @@ -26,7 +26,7 @@ limitations under the License.
- +
@@ -66,7 +66,7 @@ var bool = isComplexTypedArray( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/examples/index.js b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/examples/index.js index 94b57948d657..a39761199166 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex-typed-array/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md index 14e26c1cbd34..d4086dfbb877 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/README.md @@ -26,7 +26,7 @@ limitations under the License.
- +
@@ -66,7 +66,7 @@ var bool = isComplex128Array( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/examples/index.js b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/examples/index.js index 67fffb4b7f19..ce86bdd36cf2 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex128array/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex128array/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md index c28d06cb3655..b75042d7f93a 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/README.md @@ -26,7 +26,7 @@ limitations under the License.
- +
@@ -66,7 +66,7 @@ var bool = isComplex64Array( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/examples/index.js b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/examples/index.js index 9415480dc75c..dbf883cf9056 100644 --- a/lib/node_modules/@stdlib/array/base/assert/is-complex64array/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/assert/is-complex64array/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-quaternary4d/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/base/broadcasted-quaternary4d/benchmark/benchmark.js index 48a5fb4d19d0..72a04a452d80 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-quaternary4d/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/base/broadcasted-quaternary4d/benchmark/benchmark.js @@ -29,6 +29,7 @@ var add = require( '@stdlib/number/float64/base/add4' ); var filled4dBy = require( '@stdlib/array/base/filled4d-by' ); var zeros4d = require( '@stdlib/array/base/zeros4d' ); var numel = require( '@stdlib/ndarray/base/numel' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var bquaternary4d = require( './../lib' ); @@ -129,7 +130,7 @@ function main() { N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); sh = [ N, N, N, N ]; f = createBenchmark( sh ); - bench( pkg+'::equidimensional:size='+numel( sh ), f ); + bench( format( '%s::equidimensional:size=%d', pkg, numel( sh ) ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/benchmark/benchmark.js index a6e37a898515..9142ed9bebdb 100644 --- a/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/base/broadcasted-quinary2d/benchmark/benchmark.js @@ -28,6 +28,7 @@ var floor = require( '@stdlib/math/base/special/floor' ); var filled2dBy = require( '@stdlib/array/base/filled2d-by' ); var zeros2d = require( '@stdlib/array/base/zeros2d' ); var numel = require( '@stdlib/ndarray/base/numel' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var bquinary2d = require( './../lib' ); @@ -140,7 +141,7 @@ function main() { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); sh = [ N, N ]; f = createBenchmark( sh ); - bench( pkg+'::square_matrix:size='+numel( sh ), f ); + bench( format( '%s::square_matrix:size=%d', pkg, numel( sh ) ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/cusome-by-right/lib/main.js b/lib/node_modules/@stdlib/array/base/cusome-by-right/lib/main.js index 354e2083fc3f..01d12258bba1 100644 --- a/lib/node_modules/@stdlib/array/base/cusome-by-right/lib/main.js +++ b/lib/node_modules/@stdlib/array/base/cusome-by-right/lib/main.js @@ -37,7 +37,7 @@ var assign = require( './assign.js' ); * * @example * function fcn( value ) { -* return ( value > 0 ); +* return ( value > 0 ); * } * * var x = [ 1, 1, 0, 0, 0 ]; diff --git a/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts index a863b4ddfedb..dce59c02bd17 100644 --- a/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts @@ -99,6 +99,7 @@ import entries2views = require( '@stdlib/array/base/entries2views' ); import every = require( '@stdlib/array/base/every' ); import everyBy = require( '@stdlib/array/base/every-by' ); import everyByRight = require( '@stdlib/array/base/every-by-right' ); +import falses = require( '@stdlib/array/base/falses' ); import fancySlice = require( '@stdlib/array/base/fancy-slice' ); import fancySliceAssign = require( '@stdlib/array/base/fancy-slice-assign' ); import fill = require( '@stdlib/array/base/fill' ); @@ -235,6 +236,7 @@ import toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); import toDeduped = require( '@stdlib/array/base/to-deduped' ); import toInsertedAt = require( '@stdlib/array/base/to-inserted-at' ); import toReversed = require( '@stdlib/array/base/to-reversed' ); +import trues = require( '@stdlib/array/base/trues' ); import unary2d = require( '@stdlib/array/base/unary2d' ); import unary2dBy = require( '@stdlib/array/base/unary2d-by' ); import unary3d = require( '@stdlib/array/base/unary3d' ); @@ -2405,6 +2407,18 @@ interface Namespace { */ everyByRight: typeof everyByRight; + /** + * Returns a "generic" array filled with `false` values. + * + * @param len - array length + * @returns output array + * + * @example + * var out = ns.falses( 3 ); + * // returns [ false, false, false ] + */ + falses: typeof falses; + /** * Returns a shallow copy of a portion of an array. * @@ -5713,6 +5727,18 @@ interface Namespace { */ toReversed: typeof toReversed; + /** + * Returns a "generic" array filled with `true` values. + * + * @param len - array length + * @returns output array + * + * @example + * var out = ns.trues( 3 ); + * // returns [ true, true, true ] + */ + trues: typeof trues; + /** * Applies a unary callback to elements in a two-dimensional nested input array and assigns results to elements in a two-dimensional nested output array. * diff --git a/lib/node_modules/@stdlib/array/base/falses/README.md b/lib/node_modules/@stdlib/array/base/falses/README.md new file mode 100644 index 000000000000..eb430490d476 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/README.md @@ -0,0 +1,108 @@ + + +# falses + +> Create a "generic" array filled with `false` values. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var falses = require( '@stdlib/array/base/falses' ); +``` + +#### falses( len ) + +Returns a "generic" array filled with `false` values. + +```javascript +var out = falses( 3 ); +// returns [ false, false, false ] +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var falses = require( '@stdlib/array/base/falses' ); + +// Create a `false` value array: +var arr = falses( 10 ); + +console.log( arr ); +// => [ false, false, false, false, false, false, false, false, false, false ] +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/array/base/falses/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/base/falses/benchmark/benchmark.length.js new file mode 100644 index 000000000000..5c9bd8d824c3 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/benchmark/benchmark.length.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var falses = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + 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 = falses( len ); + if ( out.length !== len ) { + b.fail( 'unexpected length' ); + } + } + b.toc(); + if ( !isArray( out ) ) { + b.fail( 'should return an array' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/array/base/falses/docs/repl.txt b/lib/node_modules/@stdlib/array/base/falses/docs/repl.txt new file mode 100644 index 000000000000..08e11c51ebba --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/docs/repl.txt @@ -0,0 +1,22 @@ + +{{alias}}( len ) + Returns a "generic" array filled with `false` values. + + Parameters + ---------- + len: integer + Array length. + + Returns + ------- + out: Array + Output array. + + Examples + -------- + > var out = {{alias}}( 3 ) + [ false, false, false ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/array/base/falses/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/falses/docs/types/index.d.ts new file mode 100644 index 000000000000..26472f22d238 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/docs/types/index.d.ts @@ -0,0 +1,36 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Returns a "generic" array filled with `false` values. +* +* @param len - array length +* @returns output array +* +* @example +* var out = falses( 3 ); +* // returns [ false, false, false ] +*/ +declare function falses( len: number ): Array; + + +// EXPORTS // + +export = falses; diff --git a/lib/node_modules/@stdlib/array/base/falses/docs/types/test.ts b/lib/node_modules/@stdlib/array/base/falses/docs/types/test.ts new file mode 100644 index 000000000000..45c793123d22 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 falses = require( './index' ); + + +// TESTS // + +// The function returns an array... +{ + falses( 3 ); // $ExpectType boolean[] +} + +// The compiler throws an error if the function is provided an argument which is not a number... +{ + falses( 'abc' ); // $ExpectError + falses( true ); // $ExpectError + falses( false ); // $ExpectError + falses( null ); // $ExpectError + falses( [] ); // $ExpectError + falses( {} ); // $ExpectError + falses( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + falses(); // $ExpectError + falses( 3, 2 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/array/base/falses/examples/index.js b/lib/node_modules/@stdlib/array/base/falses/examples/index.js new file mode 100644 index 000000000000..763002b26032 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/examples/index.js @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 falses = require( './../lib' ); + +// Create a `false` value array: +var arr = falses( 10 ); + +console.log( arr ); +// => [ false, false, false, false, false, false, false, false, false, false ] diff --git a/lib/node_modules/@stdlib/array/base/falses/lib/index.js b/lib/node_modules/@stdlib/array/base/falses/lib/index.js new file mode 100644 index 000000000000..b96780c08037 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/lib/index.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Create a "generic" array filled with `false` values. +* +* @module @stdlib/array/base/falses +* +* @example +* var falses = require( '@stdlib/array/base/falses' ); +* +* var out = falses( 3 ); +* // returns [ false, false, false ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/array/base/falses/lib/main.js b/lib/node_modules/@stdlib/array/base/falses/lib/main.js new file mode 100644 index 000000000000..73b5daec3d20 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/lib/main.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var filled = require( '@stdlib/array/base/filled' ); + + +// MAIN // + +/** +* Returns a "generic" array filled with `false` values. +* +* @param {NonNegativeInteger} len - array length +* @returns {Array} output array +* +* @example +* var out = falses( 3 ); +* // returns [ false, false, false ] +*/ +function falses( len ) { + return filled( false, len ); +} + + +// EXPORTS // + +module.exports = falses; diff --git a/lib/node_modules/@stdlib/array/base/falses/package.json b/lib/node_modules/@stdlib/array/base/falses/package.json new file mode 100644 index 000000000000..92241b3c53ff --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/package.json @@ -0,0 +1,65 @@ +{ + "name": "@stdlib/array/base/falses", + "version": "0.0.0", + "description": "Create a generic array filled with false values.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "data", + "structure", + "array", + "generic", + "allocate", + "alloc", + "fill", + "filled", + "false" + ] +} diff --git a/lib/node_modules/@stdlib/array/base/falses/test/test.js b/lib/node_modules/@stdlib/array/base/falses/test/test.js new file mode 100644 index 000000000000..21fcc23b377e --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/falses/test/test.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 falses = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof falses, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a "generic" array filled with `false` values', function test( t ) { + var expected; + var actual; + + expected = [ false, false, false ]; + actual = falses( 3 ); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an empty array if provided a length of `0`', function test( t ) { + var expected; + var actual; + + expected = []; + actual = falses( 0 ); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.2d.js b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.2d.js index e2647d27cc1d..bee967ae8893 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.2d.js +++ b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.2d.js @@ -26,6 +26,7 @@ var floor = require( '@stdlib/math/base/special/floor' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); var isArrayArray = require( '@stdlib/assert/is-array-array' ); var constantFunction = require( '@stdlib/utils/constant-function' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var filledndBy = require( './../lib' ); @@ -93,7 +94,7 @@ function main() { N = floor( sqrt( pow( 10, i ) ) ); f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); + bench( format( '%s::2d,equidimensional:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.3d.js b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.3d.js index 3a35b2b52d89..faf506668430 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.3d.js +++ b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.3d.js @@ -26,6 +26,7 @@ var floor = require( '@stdlib/math/base/special/floor' ); var cbrt = require( '@stdlib/math/base/special/cbrt' ); var isArrayArray = require( '@stdlib/assert/is-array-array' ); var constantFunction = require( '@stdlib/utils/constant-function' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var filledndBy = require( './../lib' ); @@ -93,7 +94,7 @@ function main() { N = floor( cbrt( pow( 10, i ) ) ); f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); + bench( format( '%s::3d,equidimensional:size=%d', pkg, N*N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.4d.js b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.4d.js index 1dbe72b149f7..d82d4242aea1 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.4d.js +++ b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.4d.js @@ -25,6 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var isArrayArray = require( '@stdlib/assert/is-array-array' ); var constantFunction = require( '@stdlib/utils/constant-function' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var filledndBy = require( './../lib' ); @@ -92,7 +93,7 @@ function main() { N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); + bench( format( '%s::4d,equidimensional:size=%d', pkg, N*N*N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.5d.js b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.5d.js index a2994dfce6da..dee593661e54 100644 --- a/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.5d.js +++ b/lib/node_modules/@stdlib/array/base/fillednd-by/benchmark/benchmark.size.5d.js @@ -25,6 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var isArrayArray = require( '@stdlib/assert/is-array-array' ); var constantFunction = require( '@stdlib/utils/constant-function' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var filledndBy = require( './../lib' ); @@ -92,7 +93,7 @@ function main() { N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); + bench( format( '%s::5d,equidimensional:size=%d', pkg, N*N*N*N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/filter/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/base/filter/benchmark/benchmark.length.js index 83288e40b469..270cfb6b3545 100644 --- a/lib/node_modules/@stdlib/array/base/filter/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/base/filter/benchmark/benchmark.length.js @@ -25,6 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; var zeroTo = require( '@stdlib/array/base/zero-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var filter = require( './../lib' ); @@ -90,7 +91,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/first/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/base/first/benchmark/benchmark.js index bb0134492517..ea2d0cdaff90 100644 --- a/lib/node_modules/@stdlib/array/base/first/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/base/first/benchmark/benchmark.js @@ -25,6 +25,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; var pow = require( '@stdlib/math/base/special/pow' ); var filledBy = require( '@stdlib/array/filled-by' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var first = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/base/flatten-by/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/base/flatten-by/benchmark/benchmark.js index 9efde616a7ee..fb95a3e8dc27 100644 --- a/lib/node_modules/@stdlib/array/base/flatten-by/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/base/flatten-by/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); var zeroTo = require( '@stdlib/array/base/zero-to' ); var filled = require( '@stdlib/array/base/filled' ); @@ -50,7 +51,7 @@ function scale( v ) { // MAIN // -bench( pkg+':ndims=2,size=100,lexicographic', function benchmark( b ) { +bench( format( '%s:ndims=2,size=100,lexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -72,7 +73,7 @@ bench( pkg+':ndims=2,size=100,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=2,size=100,colexicographic', function benchmark( b ) { +bench( format( '%s:ndims=2,size=100,colexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -94,7 +95,7 @@ bench( pkg+':ndims=2,size=100,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=2,size=100,lexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=2,size=100,lexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -118,7 +119,7 @@ bench( pkg+':assign:ndims=2,size=100,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=2,size=100,colexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=2,size=100,colexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -142,7 +143,7 @@ bench( pkg+':assign:ndims=2,size=100,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=3,size=125,lexicographic', function benchmark( b ) { +bench( format( '%s:ndims=3,size=125,lexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -164,7 +165,7 @@ bench( pkg+':ndims=3,size=125,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=3,size=125,colexicographic', function benchmark( b ) { +bench( format( '%s:ndims=3,size=125,colexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -186,7 +187,7 @@ bench( pkg+':ndims=3,size=125,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=3,size=125,lexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=3,size=125,lexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -210,7 +211,7 @@ bench( pkg+':assign:ndims=3,size=125,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=3,size=125,colexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=3,size=125,colexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -234,7 +235,7 @@ bench( pkg+':assign:ndims=3,size=125,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=4,size=144,lexicographic', function benchmark( b ) { +bench( format( '%s:ndims=4,size=144,lexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -256,7 +257,7 @@ bench( pkg+':ndims=4,size=144,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=4,size=144,colexicographic', function benchmark( b ) { +bench( format( '%s:ndims=4,size=144,colexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -278,7 +279,7 @@ bench( pkg+':ndims=4,size=144,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=4,size=144,lexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=4,size=144,lexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -302,7 +303,7 @@ bench( pkg+':assign:ndims=4,size=144,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=4,size=144,colexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=4,size=144,colexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -326,7 +327,7 @@ bench( pkg+':assign:ndims=4,size=144,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=5,size=108,lexicographic', function benchmark( b ) { +bench( format( '%s:ndims=5,size=108,lexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -348,7 +349,7 @@ bench( pkg+':ndims=5,size=108,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':ndims=5,size=108,colexicographic', function benchmark( b ) { +bench( format( '%s:ndims=5,size=108,colexicographic', pkg ), function benchmark( b ) { var x; var i; var v; @@ -370,7 +371,7 @@ bench( pkg+':ndims=5,size=108,colexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=5,size=108,lexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=5,size=108,lexicographic', pkg ), function benchmark( b ) { var out; var x; var i; @@ -394,7 +395,7 @@ bench( pkg+':assign:ndims=5,size=108,lexicographic', function benchmark( b ) { b.end(); }); -bench( pkg+':assign:ndims=5,size=108,colexicographic', function benchmark( b ) { +bench( format( '%s:assign:ndims=5,size=108,colexicographic', pkg ), function benchmark( b ) { var out; var x; var i; diff --git a/lib/node_modules/@stdlib/array/base/lib/index.js b/lib/node_modules/@stdlib/array/base/lib/index.js index 032ef016342b..a78f24e3eb2d 100644 --- a/lib/node_modules/@stdlib/array/base/lib/index.js +++ b/lib/node_modules/@stdlib/array/base/lib/index.js @@ -747,6 +747,15 @@ setReadOnly( ns, 'everyBy', require( '@stdlib/array/base/every-by' ) ); */ setReadOnly( ns, 'everyByRight', require( '@stdlib/array/base/every-by-right' ) ); +/** +* @name falses +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/array/base/falses} +*/ +setReadOnly( ns, 'falses', require( '@stdlib/array/base/falses' ) ); + /** * @name fancySlice * @memberof ns @@ -1971,6 +1980,15 @@ setReadOnly( ns, 'toInsertedAt', require( '@stdlib/array/base/to-inserted-at' ) */ setReadOnly( ns, 'toReversed', require( '@stdlib/array/base/to-reversed' ) ); +/** +* @name trues +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/array/base/trues} +*/ +setReadOnly( ns, 'trues', require( '@stdlib/array/base/trues' ) ); + /** * @name unary2d * @memberof ns diff --git a/lib/node_modules/@stdlib/array/base/mskbinary5d/examples/index.js b/lib/node_modules/@stdlib/array/base/mskbinary5d/examples/index.js index fa962a12479e..202178a37cff 100644 --- a/lib/node_modules/@stdlib/array/base/mskbinary5d/examples/index.js +++ b/lib/node_modules/@stdlib/array/base/mskbinary5d/examples/index.js @@ -23,7 +23,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory; var filled5dBy = require( '@stdlib/array/base/filled5d-by' ); var zeros5d = require( '@stdlib/array/base/zeros5d' ); var add = require( '@stdlib/number/float64/base/add' ); -var mskbinary5d = require( '@stdlib/array/base/mskbinary5d/lib' ); +var mskbinary5d = require( './../lib' ); var shape = [ 1, 2, 1, 3, 3 ]; diff --git a/lib/node_modules/@stdlib/array/base/mskbinary5d/test/test.js b/lib/node_modules/@stdlib/array/base/mskbinary5d/test/test.js index 6f8d60e0f594..6b479da33188 100644 --- a/lib/node_modules/@stdlib/array/base/mskbinary5d/test/test.js +++ b/lib/node_modules/@stdlib/array/base/mskbinary5d/test/test.js @@ -23,7 +23,7 @@ var tape = require( 'tape' ); var add = require( '@stdlib/number/float64/base/add' ); var zeros5d = require( '@stdlib/array/base/zeros5d' ); -var mskbinary5d = require( '@stdlib/array/base/mskbinary5d/lib' ); +var mskbinary5d = require( './../lib' ); // TESTS // diff --git a/lib/node_modules/@stdlib/array/base/trues/README.md b/lib/node_modules/@stdlib/array/base/trues/README.md new file mode 100644 index 000000000000..fdf94d6d9bee --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/README.md @@ -0,0 +1,108 @@ + + +# trues + +> Create a "generic" array filled with `true` values. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var trues = require( '@stdlib/array/base/trues' ); +``` + +#### trues( len ) + +Returns a "generic" array filled with `true` values. + +```javascript +var out = trues( 3 ); +// returns [ true, true, true ] +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var trues = require( '@stdlib/array/base/trues' ); + +// Create a `true` value array: +var arr = trues( 10 ); + +console.log( arr ); +// => [ true, true, true, true, true, true, true, true, true, true ] +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/array/base/trues/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/base/trues/benchmark/benchmark.length.js new file mode 100644 index 000000000000..6a556f72f696 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/benchmark/benchmark.length.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var trues = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + 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 = trues( len ); + if ( out.length !== len ) { + b.fail( 'unexpected length' ); + } + } + b.toc(); + if ( !isArray( out ) ) { + b.fail( 'should return an array' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/array/base/trues/docs/repl.txt b/lib/node_modules/@stdlib/array/base/trues/docs/repl.txt new file mode 100644 index 000000000000..beae09acb45b --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/docs/repl.txt @@ -0,0 +1,22 @@ + +{{alias}}( len ) + Returns a "generic" array filled with `true` values. + + Parameters + ---------- + len: integer + Array length. + + Returns + ------- + out: Array + Output array. + + Examples + -------- + > var out = {{alias}}( 3 ) + [ true, true, true ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/array/base/trues/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/trues/docs/types/index.d.ts new file mode 100644 index 000000000000..ff9b0d4fbe8b --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/docs/types/index.d.ts @@ -0,0 +1,36 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Returns a "generic" array filled with `true` values. +* +* @param len - array length +* @returns output array +* +* @example +* var out = trues( 3 ); +* // returns [ true, true, true ] +*/ +declare function trues( len: number ): Array; + + +// EXPORTS // + +export = trues; diff --git a/lib/node_modules/@stdlib/array/base/trues/docs/types/test.ts b/lib/node_modules/@stdlib/array/base/trues/docs/types/test.ts new file mode 100644 index 000000000000..3cdb1c1f5f51 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 trues = require( './index' ); + + +// TESTS // + +// The function returns an array... +{ + trues( 3 ); // $ExpectType boolean[] +} + +// The compiler throws an error if the function is provided an argument which is not a number... +{ + trues( 'abc' ); // $ExpectError + trues( true ); // $ExpectError + trues( false ); // $ExpectError + trues( null ); // $ExpectError + trues( [] ); // $ExpectError + trues( {} ); // $ExpectError + trues( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + trues(); // $ExpectError + trues( 3, 2 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/array/base/trues/examples/index.js b/lib/node_modules/@stdlib/array/base/trues/examples/index.js new file mode 100644 index 000000000000..6171bfbad8ec --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/examples/index.js @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 trues = require( './../lib' ); + +// Create a `true` value array: +var arr = trues( 10 ); + +console.log( arr ); +// => [ true, true, true, true, true, true, true, true, true, true ] diff --git a/lib/node_modules/@stdlib/array/base/trues/lib/index.js b/lib/node_modules/@stdlib/array/base/trues/lib/index.js new file mode 100644 index 000000000000..5146d6e4fa61 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/lib/index.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Create a "generic" array filled with `true` values. +* +* @module @stdlib/array/base/trues +* +* @example +* var trues = require( '@stdlib/array/base/trues' ); +* +* var out = trues( 3 ); +* // returns [ true, true, true ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/array/base/trues/lib/main.js b/lib/node_modules/@stdlib/array/base/trues/lib/main.js new file mode 100644 index 000000000000..1603a5232afd --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/lib/main.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var filled = require( '@stdlib/array/base/filled' ); + + +// MAIN // + +/** +* Returns a "generic" array filled with `true` values. +* +* @param {NonNegativeInteger} len - array length +* @returns {Array} output array +* +* @example +* var out = trues( 3 ); +* // returns [ true, true, true ] +*/ +function trues( len ) { + return filled( true, len ); +} + + +// EXPORTS // + +module.exports = trues; diff --git a/lib/node_modules/@stdlib/array/base/trues/package.json b/lib/node_modules/@stdlib/array/base/trues/package.json new file mode 100644 index 000000000000..3916e79dcfb5 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/package.json @@ -0,0 +1,65 @@ +{ + "name": "@stdlib/array/base/trues", + "version": "0.0.0", + "description": "Create a generic array filled with true values.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "data", + "structure", + "array", + "generic", + "allocate", + "alloc", + "fill", + "filled", + "true" + ] +} diff --git a/lib/node_modules/@stdlib/array/base/trues/test/test.js b/lib/node_modules/@stdlib/array/base/trues/test/test.js new file mode 100644 index 000000000000..bf7441a02b89 --- /dev/null +++ b/lib/node_modules/@stdlib/array/base/trues/test/test.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 trues = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof trues, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a "generic" array filled with `true` values', function test( t ) { + var expected; + var actual; + + expected = [ true, true, true ]; + actual = trues( 3 ); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an empty array if provided a length of `0`', function test( t ) { + var expected; + var actual; + + expected = []; + actual = trues( 0 ); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/array/bool/README.md b/lib/node_modules/@stdlib/array/bool/README.md index 2150b9367fda..3533675071e4 100644 --- a/lib/node_modules/@stdlib/array/bool/README.md +++ b/lib/node_modules/@stdlib/array/bool/README.md @@ -1813,8 +1813,6 @@ logEach( '%s', out ); arr = new Uint8Array( [ 1, 0, 1, 1, 0, 1 ] ); out = new BooleanArray( arr.buffer, 1, 2 ); logEach( '%s', out ); - -console.log( '%s', false ); ```
diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.at.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.at.js index 674a02850afa..cd4a1b383d69 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.at.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.at.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+'::nonnegative_indices:at', function benchmark( b ) { +bench( format( '%s::nonnegative_indices:at', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -56,7 +57,7 @@ bench( pkg+'::nonnegative_indices:at', function benchmark( b ) { b.end(); }); -bench( pkg+'::negative_indices:at', function benchmark( b ) { +bench( format( '%s::negative_indices:at', pkg ), function benchmark( b ) { var arr; var N; var v; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.js index b2675cfda09a..2c8271e56301 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var buf; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.length.js index 259434b7edcc..520a54add003 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.entries.js index 01781590d0ad..2fce00b49207 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.js index 31de61739ed4..156837f6404b 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.length.js index ac36b2c8bc81..fd1e0458d926 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.every.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':every:len='+len, f ); + bench( format( '%s:every:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.js index 388e8cff97ae..f94f2c925208 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var values; var arr; var out; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.length.js index bac49a2cb534..ffd677efe533 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.fill.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -93,7 +94,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.js index aa04c6ac4454..cf1ae5533c4f 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.length.js index d9c3986d723f..f3d898929d57 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.js index 5401d45bd3b3..71a96811d98b 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.length.js index 7fd45a1f89d8..a14dc0cbdacf 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -110,7 +111,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.js index c1be2df5937d..64021b8b6b99 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var arr; var idx; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.length.js index d1def6840f3b..8f68d645ca85 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_index.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -110,7 +111,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.js index f0878a99fc07..45eacf6c7336 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':findLast', function benchmark( b ) { +bench( format( '%s:findLast', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.length.js index 1aef5ed9bc25..b39033eead0f 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -110,7 +111,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findLast:len='+len, f ); + bench( format( '%s:findLast:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.js index 2c2429f72de3..dd8f1d17aaa7 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':findLastIndex', function benchmark( b ) { +bench( format( '%s:findLastIndex', pkg ), function benchmark( b ) { var arr; var idx; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.length.js index d0b620e05cf4..86852608ab78 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.find_last_index.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -110,7 +111,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findLastIndex:len='+len, f ); + bench( format( '%s:findLastIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.js index 284f955509ab..8839c28edf35 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.length.js index 62b02b9a39f7..d9bf17ab563c 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.from.js index d949868a56db..6607030e91f6 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var Uint8Array = require( '@stdlib/array/uint8' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -80,7 +81,7 @@ bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -128,7 +129,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:from:len=5', function benchmark( b ) { +bench( format( '%s::array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -150,7 +151,7 @@ bench( pkg+'::array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -176,7 +177,7 @@ bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -213,7 +214,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -259,7 +260,7 @@ bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.get.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.get.js index 597b1a30b8aa..27c7dce8ad7f 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.get.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.get.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':get', function benchmark( b ) { +bench( format( '%s:get', pkg ), function benchmark( b ) { var arr; var N; var v; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.js index 42d559998fbc..be68aa7666a9 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.length.js index d7b4b81beee7..5e95852c8958 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.js index 875befae707d..238d1b3fbfe9 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var arr; var idx; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.length.js index 6f800919e4ce..c34c1bf0d431 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.index_of.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.js index d96ca36ae5ea..a8ba440ad281 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.length.js index 51581532239f..0e69f89bf9de 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.join.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.js index 34ecde54196d..bfb2bcbcd1b4 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.js @@ -26,6 +26,7 @@ var Uint8Array = require( '@stdlib/array/uint8' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -39,7 +40,7 @@ var opts = { // MAIN // -bench( pkg+'::instantiation,new', function benchmark( b ) { +bench( format( '%s::instantiation,new', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -57,7 +58,7 @@ bench( pkg+'::instantiation,new', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,no_new', function benchmark( b ) { +bench( format( '%s::instantiation,no_new', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -79,7 +80,7 @@ bench( pkg+'::instantiation,no_new', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,length', function benchmark( b ) { +bench( format( '%s::instantiation,length', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -97,7 +98,7 @@ bench( pkg+'::instantiation,length', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,typed_array', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -119,7 +120,7 @@ bench( pkg+'::instantiation,typed_array', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,array', function benchmark( b ) { +bench( format( '%s::instantiation,array', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -141,7 +142,7 @@ bench( pkg+'::instantiation,array', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,iterable', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -178,7 +179,7 @@ bench( pkg+'::instantiation,iterable', opts, function benchmark( b ) { } }); -bench( pkg+'::instantiation,arraybuffer', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -200,7 +201,7 @@ bench( pkg+'::instantiation,arraybuffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -222,7 +223,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -244,7 +245,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset,length', function benchmark( b.end(); }); -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -267,7 +268,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -290,7 +291,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -313,7 +314,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.js index b39411e677ad..89ca36ed7fb8 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.length.js index 4cda0778b0a6..1f4ad274abcc 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.keys.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':keys:len='+len, f ); + bench( format( '%s:keys:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.js index 6a8ee0c6380f..20acb111bc1e 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var arr; var idx; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.length.js index 76171de79195..79cc64d58eeb 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.last_index_of.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.length.js index 2f1bc80e1f6d..6802c6d2edce 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -85,7 +86,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.js index 7bade7313ade..67a4a68b7d53 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.length.js index 29b06c9aa426..12cb3f3e5ac2 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.map.length.js @@ -25,6 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); var identity = require( '@stdlib/utils/identity-function' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.of.js index 87fd2c3efa0b..710bcbc82077 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; @@ -46,7 +47,7 @@ bench( pkg+':of', function benchmark( b ) { b.end(); }); -bench( pkg+':len=5', function benchmark( b ) { +bench( format( '%s:of:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.js index 52b3166a043a..7eb2304d9151 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -47,7 +48,7 @@ function reducer( acc, value ) { // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.length.js index 03e391b16a55..49751b346b46 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.js index 3026a51a4dd3..42684ade5f83 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -47,7 +48,7 @@ function reducer( acc, value ) { // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.length.js index 8de497b055ec..ecf19e69eab3 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reduce_right.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.js index 722b0b80fee4..f1fbf2a00fa9 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.length.js index b3e3b7c5b510..a14d4069e4d3 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.reverse.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.js index f06a3cca318d..21870b1f7c0d 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var Uint8Array = require( '@stdlib/array/uint8' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+'::boolean:set', function benchmark( b ) { +bench( format( '%s::boolean:set', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+'::boolean:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -86,7 +87,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var arr; var buf; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.length.js index 4f48138040ce..0497abe9d401 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randu = require( '@stdlib/random/base/randu' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -109,7 +110,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.js index 06f31754d2ff..7c6c8f0c62e3 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.length.js index 5b077fe4f4d9..8c42495192ff 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.slice.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var Boolean = require( '@stdlib/boolean/ctor' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.js index 5024c006204b..1e2e8b73076e 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.length.js index 4cf28e18cf3d..8b1fc6f8e8bd 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.some.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -110,7 +111,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.js index a8e15baa82b2..39d732829442 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -52,7 +53,7 @@ function compareFcn( a, b ) { // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.length.js index 2efc4b813f15..e7c39f52a0fe 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var Boolean = require( '@stdlib/boolean/ctor' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -117,7 +118,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.js index 60f38ba51637..73907ddf6c34 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.length.js index 17ec983b8825..c18b236c0db0 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.subarray.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.js index 67d577c7c884..441833f79f20 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.length.js index 431b75bd58fd..57cc71e172d0 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -94,7 +95,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.js index f8f840da5593..aa354943eb36 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':toReversed', function benchmark( b ) { +bench( format( '%s:toReversed', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.length.js index da5511f65516..6ed17e4974d0 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_reversed.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toReversed:len='+len, f ); + bench( format( '%s:toReversed:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.js index cab83d5f81cf..bd7986942299 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -52,7 +53,7 @@ function compareFcn( a, b ) { // MAIN // -bench( pkg+':toSorted', function benchmark( b ) { +bench( format( '%s:toSorted', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.length.js index 0e94fef16fae..acc33a791480 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_sorted.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -117,7 +118,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toSorted:len='+len, f ); + bench( format( '%s:toSorted:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.js index d549731f6887..665ff2d1153e 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.length.js index 36834b583007..fbc2c471c692 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.to_string.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var Boolean = require( '@stdlib/boolean/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.js index 48283aaed099..b65aad36c241 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.length.js index 585ff42b8d08..f97aff32a0c6 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.values.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isIteratorLike = require( '@stdlib/assert/is-iterator-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':values:len='+len, f ); + bench( format( '%s:values:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.js index b7e3e68d6e37..dd7bd2ccdd6b 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); // MAIN // -bench( pkg+':with', function benchmark( b ) { +bench( format( '%s:with', pkg ), function benchmark( b ) { var values; var arr; var out; diff --git a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.length.js b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.length.js index 508e63f185c2..6548e2ff44a9 100644 --- a/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.length.js +++ b/lib/node_modules/@stdlib/array/bool/benchmark/benchmark.with.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var BooleanArray = require( './../lib' ); @@ -93,7 +94,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':with:len='+len, f ); + bench( format( '%s:with:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/bool/docs/repl.txt b/lib/node_modules/@stdlib/array/bool/docs/repl.txt index 88ca25a130d7..8bedabbfb8fd 100644 --- a/lib/node_modules/@stdlib/array/bool/docs/repl.txt +++ b/lib/node_modules/@stdlib/array/bool/docs/repl.txt @@ -321,10 +321,10 @@ ---------- target: integer Target start index position. - + start: integer Source start index position. - + end: integer (optional) Source end index position. Default: out.length. @@ -332,7 +332,7 @@ ------- out: BooleanArray Modified array. - + Examples -------- > var arr = new {{alias}}( [ true, false, false, true ] ) @@ -421,7 +421,7 @@ ------- out: BooleanArray Modified array. - + Examples -------- > var arr = new {{alias}}( 3 ) @@ -461,7 +461,7 @@ ------- out: BooleanArray A new typed array. - + Examples -------- > function predicate( v ) { return ( v === true ); }; @@ -633,7 +633,7 @@ thisArg: Any (optional) Execution context. - + Examples -------- > var str = '%'; @@ -759,7 +759,7 @@ ------- iterator: Iterator Iterator for iterating over array index keys. - + Examples -------- > var arr = new {{alias}}( [ true, false ] ) @@ -912,12 +912,12 @@ initialValue: any (optional) Initial accumulation value. - + Returns ------- out: any Accumulated result. - + Examples -------- > function reducer( acc, v ) { return ( acc && v ); }; @@ -1122,10 +1122,10 @@ ---------- locales: string|Array (optional) Locale identifier(s). - + options: Object (optional) An object containing serialization options. - + Returns ------- str: string @@ -1221,7 +1221,7 @@ ------- iterator: Iterator Iterator for iterating over array values. - + Examples -------- > var arr = new {{alias}}( [ true, false ] ) @@ -1236,22 +1236,22 @@ {{alias}}.prototype.with( index, value ) - Returns a new typed array with the element at a provided index replaced - with a provided value. + Returns a new typed array with the element at a provided index replaced with + a provided value. Parameters ---------- index: integer Element index. - + value: boolean - Element value. + Element value. Returns ------- out: BooleanArray New typed array. - + Examples -------- > var arr = new {{alias}}( [ true, false, true ] ) diff --git a/lib/node_modules/@stdlib/array/bool/examples/index.js b/lib/node_modules/@stdlib/array/bool/examples/index.js index d1e28c46bfc7..a5b15221aef0 100644 --- a/lib/node_modules/@stdlib/array/bool/examples/index.js +++ b/lib/node_modules/@stdlib/array/bool/examples/index.js @@ -40,5 +40,3 @@ logEach( '%s', out ); arr = new Uint8Array( [ 1, 0, 1, 1, 0, 1 ] ); out = new BooleanArray( arr.buffer, 1, 2 ); logEach( '%s', out ); - -console.log( '%s', false ); diff --git a/lib/node_modules/@stdlib/array/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/docs/types/index.d.ts index cf5545f7d1de..582c8788c674 100644 --- a/lib/node_modules/@stdlib/array/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/docs/types/index.d.ts @@ -62,6 +62,7 @@ import mskreject = require( '@stdlib/array/mskreject' ); import nans = require( '@stdlib/array/nans' ); import nansLike = require( '@stdlib/array/nans-like' ); import nextDataType = require( '@stdlib/array/next-dtype' ); +import nulls = require( '@stdlib/array/nulls' ); import oneTo = require( '@stdlib/array/one-to' ); import oneToLike = require( '@stdlib/array/one-to-like' ); import ones = require( '@stdlib/array/ones' ); @@ -1008,6 +1009,27 @@ interface Namespace { */ nextDataType: typeof nextDataType; + /** + * Creates an array filled with nulls and having a specified length. + * + * The function recognizes the following data types: + * + * - `generic`: generic JavaScript values + * + * @param length - array length + * @param dtype - data type (default: 'generic') + * @returns filled array + * + * @example + * var arr = ns.nulls( 2 ); + * // returns [ null, null ] + * + * @example + * var arr = ns.nulls( 2, 'generic' ); + * // returns [ null, null ] + */ + nulls: typeof nulls; + /** * Generates a linearly spaced numeric array whose elements increment by 1 starting from one. * diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.js index 37b898ec74a6..f7181f1d1ce8 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -52,7 +53,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float64' ), function benchmark( b ) { var arr; var x; var i; @@ -74,7 +75,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float32' ), function benchmark( b ) { var arr; var x; var i; @@ -96,7 +97,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=bool', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'bool' ), function benchmark( b ) { var arr; var x; var i; @@ -118,7 +119,7 @@ bench( pkg+':dtype=bool', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex128', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'complex128' ), function benchmark( b ) { var arr; var x; var i; @@ -140,7 +141,7 @@ bench( pkg+':dtype=complex128', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex64', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'complex64' ), function benchmark( b ) { var arr; var x; var i; @@ -162,7 +163,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int32' ), function benchmark( b ) { var arr; var x; var i; @@ -184,7 +185,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint32' ), function benchmark( b ) { var arr; var x; var i; @@ -206,7 +207,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int16' ), function benchmark( b ) { var arr; var x; var i; @@ -228,7 +229,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint16' ), function benchmark( b ) { var arr; var x; var i; @@ -250,7 +251,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int8' ), function benchmark( b ) { var arr; var x; var i; @@ -272,7 +273,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8' ), function benchmark( b ) { var arr; var x; var i; @@ -294,7 +295,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8c' ), function benchmark( b ) { var arr; var x; var i; @@ -316,7 +317,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=generic', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'generic' ), function benchmark( b ) { var arr; var x; var i; diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.bool.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.bool.js index 9f0bde188d7e..d90b0d55715f 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.bool.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.bool.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=bool,len='+len, f ); + bench( format( '%s:dtype=bool,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex128.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex128.js index f956256250cb..95db91cdf3d6 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex128.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex128.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex128,len='+len, f ); + bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex64.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex64.js index 4938a38cb9d3..57356ad84efc 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex64.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.complex64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex64,len='+len, f ); + bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float32.js index 1aaf4d42c733..1c8797186c6e 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=float32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float64.js index 44b034933b42..d6607da93369 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.float64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=float64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.generic.js index 1fcdf309a8af..b9c2975c953b 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.generic.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.generic.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int16.js index 5700381df234..9fdef9ee6159 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=int16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int32.js index 2b8527449a21..18cd4f2f7245 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=int32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int8.js index 09c542b0a1dd..3c0199bb6f21 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.int8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=int8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint16.js index 58303ddba218..37a464050fec 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=uint16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint32.js index 3a6e1d3232cc..e97d18c1c986 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=uint32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8.js index 479a23efa1e4..ed77366ef3a6 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=uint8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8c.js index f5578678791f..bff3f9b754fe 100644 --- a/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/empty-like/benchmark/benchmark.length.uint8c.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var emptyLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=uint8c,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.js index 7f7ffb83cf5b..9e9a5f102e47 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -47,7 +48,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float64' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -65,7 +66,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -83,7 +84,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=bool', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'bool' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -101,7 +102,7 @@ bench( pkg+':dtype=bool', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex128', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'complex128' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -119,7 +120,7 @@ bench( pkg+':dtype=complex128', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex64', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'complex64' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -137,7 +138,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -155,7 +156,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -173,7 +174,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int16' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -191,7 +192,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint16' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -209,7 +210,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int8' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -227,7 +228,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -245,7 +246,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8c' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -263,7 +264,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=generic', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'generic' ), function benchmark( b ) { var arr; var i; b.tic(); diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.bool.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.bool.js index 3b1bf8d8798f..0fd837429f2d 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.bool.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.bool.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=bool,len='+len, f ); + bench( format( '%s:dtype=bool,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex128.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex128.js index 03a6aec59ff1..6087f8c88f7d 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex128.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex128.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex128,len='+len, f ); + bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex64.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex64.js index c21e4469acb0..79bbbb444d79 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex64.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.complex64.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex64,len='+len, f ); + bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float32.js index 18ce2885e778..abb61ea96025 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=float32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float64.js index ff0d09ffff33..82a8541c80f1 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.float64.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=float64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.generic.js index 553c67cfd555..4344dd4b24f0 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.generic.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.generic.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int16.js index 4c7ced1fd6b5..66c9d70e4577 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=int16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int32.js index e99124b6f9c9..5a3d6f48ecb8 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=int32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int8.js index dfe7ce82a54a..1ac8d3ee7b60 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.int8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=int8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint16.js index 661def4990c7..ac16a315d78a 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=uint16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint32.js index f1719042a874..42452b0d1de4 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=uint32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8.js index d2106d864e58..65a485cf2740 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=uint8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8c.js index 16d786b0ca45..ec5c45035a43 100644 --- a/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/empty/benchmark/benchmark.length.uint8c.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var empty = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=uint8c,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.of.js index 676ab5794f04..1555f002b184 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.of.js @@ -52,7 +52,7 @@ bench( format( '%s:of', pkg ), function benchmark( b ) { b.end(); }); -bench( format( '%s:len=5', pkg ), function benchmark( b ) { +bench( format( '%s:of:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.from.js index bd4ad567b3a0..245abe722ba2 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var Float32Array = require( '@stdlib/array/float32' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -80,7 +81,7 @@ bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -128,7 +129,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:from:len=5', function benchmark( b ) { +bench( format( '%s::array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -150,7 +151,7 @@ bench( pkg+'::array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -176,7 +177,7 @@ bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -213,7 +214,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -259,7 +260,7 @@ bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.get.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.get.js index 525940eb0ee6..9d12f48950e1 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.get.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.get.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { +bench( format( '%s:get:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -56,7 +57,7 @@ bench( pkg+':get:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { +bench( format( '%s:get:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var N; var v; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.js index bd61533749d2..b5a498f762ea 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.js @@ -26,6 +26,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); @@ -66,7 +67,7 @@ function createIterable() { // MAIN // -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,new:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -84,7 +85,7 @@ bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,new:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -102,7 +103,7 @@ bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) b.end(); }); -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,no_new:endianness=little-endian', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -124,7 +125,7 @@ bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark b.end(); }); -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,no_new:endianness=big-endian', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -146,7 +147,7 @@ bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,length:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -164,7 +165,7 @@ bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark b.end(); }); -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,length:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -182,7 +183,7 @@ bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -204,7 +205,7 @@ bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benc b.end(); }); -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -226,7 +227,7 @@ bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchma b.end(); }); -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,array:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -248,7 +249,7 @@ bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b.end(); }); -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,array:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -270,7 +271,7 @@ bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable:endianness=little-endian', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -289,7 +290,7 @@ bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function b b.end(); }); -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable:endianness=big-endian', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -308,7 +309,7 @@ bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benc b.end(); }); -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -330,7 +331,7 @@ bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benc b.end(); }); -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -352,7 +353,7 @@ bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchma b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -374,7 +375,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', f b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -396,7 +397,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', func b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -418,7 +419,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-end b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -440,7 +441,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian b.end(); }); -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -463,7 +464,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -486,7 +487,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -509,7 +510,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.of.js index 6b9670ab85df..496435846516 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; @@ -46,7 +47,7 @@ bench( pkg+':of', function benchmark( b ) { b.end(); }); -bench( pkg+':len=5', function benchmark( b ) { +bench( format( '%s:of:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.js index b8aaa75ed41a..6761a432bc4b 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::number:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::number:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -86,7 +87,7 @@ bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::array:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -115,7 +116,7 @@ bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::array:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -144,7 +145,7 @@ bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::typed_array:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var buf; @@ -176,7 +177,7 @@ bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) b.end(); }); -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::typed_array:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var buf; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.length.js index 0281c407ed3c..6b4b3c2eca6a 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randu = require( '@stdlib/random/array/randu' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.js index 3e1e5a1dcdb2..d93f49587fbf 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.length.js index 4fffa5908b77..59ce59bc47b7 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float32/benchmark/benchmark.to_string.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var zeroTo = require( '@stdlib/array/zero-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float32ArrayFE = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.from.js index 14aa3d2c4bb7..ac944cfe8a09 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var Float64Array = require( '@stdlib/array/float64' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -80,7 +81,7 @@ bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -128,7 +129,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:from:len=5', function benchmark( b ) { +bench( format( '%s::array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -150,7 +151,7 @@ bench( pkg+'::array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -176,7 +177,7 @@ bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -213,7 +214,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -259,7 +260,7 @@ bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.get.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.get.js index 5ac1002f5796..2a6c27780e57 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.get.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.get.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { +bench( format( '%s:get:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -56,7 +57,7 @@ bench( pkg+':get:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { +bench( format( '%s:get:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var N; var v; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.js index 936288399880..3e3530c90143 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.js @@ -26,6 +26,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); @@ -66,7 +67,7 @@ function createIterable() { // MAIN // -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,new:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -84,7 +85,7 @@ bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,new:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -102,7 +103,7 @@ bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) b.end(); }); -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,no_new:endianness=little-endian', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -124,7 +125,7 @@ bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark b.end(); }); -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,no_new:endianness=big-endian', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -146,7 +147,7 @@ bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,length:endianness=little-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -164,7 +165,7 @@ bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark b.end(); }); -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,length:endianness=big-endian', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -182,7 +183,7 @@ bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -204,7 +205,7 @@ bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benc b.end(); }); -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -226,7 +227,7 @@ bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchma b.end(); }); -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,array:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -248,7 +249,7 @@ bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b.end(); }); -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,array:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -270,7 +271,7 @@ bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b b.end(); }); -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable:endianness=little-endian', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -289,7 +290,7 @@ bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function b b.end(); }); -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable:endianness=big-endian', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -308,7 +309,7 @@ bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benc b.end(); }); -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -330,7 +331,7 @@ bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benc b.end(); }); -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -352,7 +353,7 @@ bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchma b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -374,7 +375,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', f b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -396,7 +397,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', func b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -418,7 +419,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-end b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -440,7 +441,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian b.end(); }); -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -463,7 +464,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -486,7 +487,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -509,7 +510,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.of.js index 2222d5c8230f..7b9d2648ceec 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; @@ -46,7 +47,7 @@ bench( pkg+':of', function benchmark( b ) { b.end(); }); -bench( pkg+':len=5', function benchmark( b ) { +bench( format( '%s:of:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.js index 0ec66f557b99..38cbd7d0d0f1 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::number:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::number:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -86,7 +87,7 @@ bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::array:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -115,7 +116,7 @@ bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::array:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -144,7 +145,7 @@ bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { +bench( format( '%s::typed_array:set:endianness=little-endian', pkg ), function benchmark( b ) { var values; var arr; var buf; @@ -176,7 +177,7 @@ bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) b.end(); }); -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { +bench( format( '%s::typed_array:set:endianness=big-endian', pkg ), function benchmark( b ) { var values; var arr; var buf; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.length.js index 5848832e7f09..f6bd998258dc 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randu = require( '@stdlib/random/array/randu' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.js index f042a11e1d91..68cfb7a779b5 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.length.js index 799a3351ef7b..044e01a6d117 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-float64/benchmark/benchmark.to_string.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var zeroTo = require( '@stdlib/array/zero-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64ArrayFE = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.js index 52cb63a752b7..cc526a7d9f37 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.length.js index ebfc0c9544db..9f54ebb72f37 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.data.js index f4a417b02bd2..6e74f6881e61 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.data.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+'::get,index', function benchmark( b ) { +bench( format( '%s::get,index', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -51,7 +52,7 @@ bench( pkg+'::get,index', function benchmark( b ) { b.end(); }); -bench( pkg+'::set,index', function benchmark( b ) { +bench( format( '%s::set,index', pkg ), function benchmark( b ) { var arr; var N; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.entries.js index 0eee5195673b..b78b2a7e2f30 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.js index 7499ada3d0af..4b36719704b8 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':every', function benchmark( b ) { } }); -bench( pkg+'::this_context:every', function benchmark( b ) { +bench( format( '%s::this_context:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.length.js index b90ff3e26502..edfc34cfbbfe 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.every.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':every:len='+len, f ); + bench( format( '%s:every:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.js index 7137c71f2555..61f381b3ff56 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.length.js index f896f8ee3596..97aea3279656 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.fill.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.js index 8e4ce6a5bf6e..33c2f4f54019 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var arr; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+':filter', function benchmark( b ) { } }); -bench( pkg+'::this_context:filter', function benchmark( b ) { +bench( format( '%s::this_context:filter', pkg ), function benchmark( b ) { var arr; var out; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.length.js index ebcae45a6825..4b5a4db1ecc6 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.js index 196c22c0a6b4..a483423d90af 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':find', function benchmark( b ) { } }); -bench( pkg+'::this_context:find', function benchmark( b ) { +bench( format( '%s::this_context:find', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.length.js index 07c5444804b1..f8b869640041 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.js index 44f1b1da025b..085fb3337dd8 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':findIndex', function benchmark( b ) { } }); -bench( pkg+'::this_context:findIndex', function benchmark( b ) { +bench( format( '%s::this_context:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.length.js index 78d12368bf43..facb53687cf3 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.find_index.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.js index a5d013bc0492..1b7ff0a91620 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+':forEach', function benchmark( b ) { } }); -bench( pkg+'::this_context:forEach', function benchmark( b ) { +bench( format( '%s::this_context:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.length.js index 1b33a73ff379..03923703c13e 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.from.js index 2d3e37593914..2f8b402ee277 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -84,7 +85,7 @@ bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from', function benchmark( b ) { +bench( format( '%s::array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -132,7 +133,7 @@ bench( pkg+'::array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -182,7 +183,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.js index 411edf6a20c4..09b8116e8ce8 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.length.js index 9c649244ec91..9a485e64b09d 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.js index ccbf9a329628..060ccddc347c 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.length.js index 6f5742809262..93c93f8d50f9 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.js index 96c057f1ea43..a77bdbdbc3fb 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.length.js index 55bf7ae0fdb0..b2830a48003a 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.join.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.keys.js index e01f172d12b4..5034202933cd 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.keys.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.js index 3bd0469b6bfa..e640766a6553 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.length.js index 4843100c8bd2..5f553b14f888 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.last_index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.length.js index 5be86c4026fd..aa3238f167ff 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ctor = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.js index 652e648381f0..d4c9f2b12f98 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':map', function benchmark( b ) { } }); -bench( pkg+'::this_context:map', function benchmark( b ) { +bench( format( '%s::this_context:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.length.js index 5b974ee49455..7e36b05288c6 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.map.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.of.js index 25d5c5e3c0d1..8b95f2f5c9bf 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.properties.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.properties.js index 8fbfb46d9b79..c3bc297e9886 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.properties.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.properties.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -52,7 +53,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -75,7 +76,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -98,7 +99,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { +bench( format( '%s::get:BYTES_PER_ELEMENT', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -121,7 +122,7 @@ bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.js index fd1a058bef69..c4ca433db7fb 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduce', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduce', function benchmark( b ) { +bench( format( '%s::initial_value:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.length.js index 7b4fd8835ca3..1057db78c492 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.js index 738859bbf822..5974b51ef95e 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduceRight', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduceRight', function benchmark( b ) { +bench( format( '%s::initial_value:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.length.js index bb2b39bff2f8..c897be930ab8 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reduce_right.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.js index 972570e08e16..266b00f5c202 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.length.js index 05138a8298fe..647838d91b84 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.reverse.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.js index 026c58dd6ba8..c5ceec24d814 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; @@ -60,7 +61,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.length.js index d93bcd493742..ded75cecc8d7 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.js index 27eb72d8a850..eba8677b1234 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.length.js index a808ebf91f49..e16a1ccfe71f 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.slice.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.js index 9cec5ef7b3e6..9a921e1b5a15 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':some', function benchmark( b ) { +bench( format( '%s:some', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':some', function benchmark( b ) { } }); -bench( pkg+'::this_context:some', function benchmark( b ) { +bench( format( '%s::this_context:some', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.length.js index efa5670b7c0d..cd8dec851e34 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.some.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.js index caf0421c9751..ef9ce8effb93 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var randi = require( '@stdlib/random/base/randi' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.length.js index 9f27d46eb3eb..4f44c7cc2d12 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.js index 797cd5e91b9c..e6dc4b16d016 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.length.js index fbfc2c3396ec..c35139947b76 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.subarray.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isFloat64Array = require( '@stdlib/assert/is-float64array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.js index 005b9334ff6e..973660a4f133 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.length.js index 2a99382fc6fc..239499df0214 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.js index a7275fc6259e..699890d8e742 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.length.js index 39f880d653d5..2763808ca211 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.to_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.values.js index 4d4bca6aa1b8..8b36c4fa6406 100644 --- a/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/float64/benchmark/benchmark.values.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Float64Array = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.data.js index b1ff83013a42..30bf0e526a97 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.data.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isCollection = require( '@stdlib/assert/is-collection' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':data', function benchmark( b ) { +bench( format( '%s:data', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.dtype.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.dtype.js index 5a9eea9f0f37..46dc1d1df81b 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.dtype.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.dtype.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':dtype', function benchmark( b ) { +bench( format( '%s:dtype', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.get.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.get.js index 0bdb0bde0491..d7560d5bfd6b 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.get.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.get.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':get', function benchmark( b ) { +bench( format( '%s:get', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.id.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.id.js index 010e132e06c1..4e6fc286a95b 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.id.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.id.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':id', function benchmark( b ) { +bench( format( '%s:id', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.is_cached.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.is_cached.js index c4bccf03409d..c4950b7887f2 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.is_cached.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.is_cached.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':isCached', function benchmark( b ) { +bench( format( '%s:isCached', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.js index 14c89bce36ce..95d868e22d72 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var instanceOf = require( '@stdlib/assert/instance-of' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+'::instantiation,new', function benchmark( b ) { +bench( format( '%s::instantiation,new', pkg ), function benchmark( b ) { var values; var v; var i; @@ -54,7 +55,7 @@ bench( pkg+'::instantiation,new', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,no_new', function benchmark( b ) { +bench( format( '%s::instantiation,no_new', pkg ), function benchmark( b ) { var values; var idx; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_json.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_json.js index 3c99ab764bad..fe09e80decad 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_json.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_json.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':toJSON:len=3', function benchmark( b ) { +bench( format( '%s:toJSON:len=3', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_string.js index e973acb3e30d..ad5f50854725 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.to_string.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':toString:len=3', function benchmark( b ) { +bench( format( '%s:toString:len=3', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.type.js b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.type.js index fa3f11e4e80c..8eff23d70855 100644 --- a/lib/node_modules/@stdlib/array/index/benchmark/benchmark.type.js +++ b/lib/node_modules/@stdlib/array/index/benchmark/benchmark.type.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ArrayIndex = require( './../lib' ); // MAIN // -bench( pkg+':type', function benchmark( b ) { +bench( format( '%s:type', pkg ), function benchmark( b ) { var values; var opts; var v; diff --git a/lib/node_modules/@stdlib/array/lib/index.js b/lib/node_modules/@stdlib/array/lib/index.js index b1846ec1d523..b1ed64c0426a 100644 --- a/lib/node_modules/@stdlib/array/lib/index.js +++ b/lib/node_modules/@stdlib/array/lib/index.js @@ -472,6 +472,15 @@ setReadOnly( ns, 'nansLike', require( '@stdlib/array/nans-like' ) ); */ setReadOnly( ns, 'nextDataType', require( '@stdlib/array/next-dtype' ) ); +/** +* @name nulls +* @memberof ns +* @readonly +* @constructor +* @see {@link module:@stdlib/array/nulls} +*/ +setReadOnly( ns, 'nulls', require( '@stdlib/array/nulls' ) ); + /** * @name oneTo * @memberof ns diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.from.js index 8375c8dfdfdf..d238652f6d83 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.from.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -37,7 +38,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -59,7 +60,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -81,7 +82,7 @@ bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -107,7 +108,7 @@ bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -129,7 +130,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:from:len=5', function benchmark( b ) { +bench( format( '%s::array:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -151,7 +152,7 @@ bench( pkg+'::array:from:len=5', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { +bench( format( '%s::array,clbk:from:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -177,7 +178,7 @@ bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -214,7 +215,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -260,7 +261,7 @@ bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:len=5', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.get.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.get.js index 7ceb453c900a..65aef8ee700e 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.get.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.get.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -33,7 +34,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+':get', function benchmark( b ) { +bench( format( '%s:get', pkg ), function benchmark( b ) { var arr; var N; var v; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.instantiation.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.instantiation.js index c55e2f3f3930..4c6222f82b5b 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.instantiation.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.instantiation.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ArrayBuffer = require( '@stdlib/array/buffer' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -65,7 +66,7 @@ function createIterable() { // MAIN // -bench( pkg+'::instantiation,new', function benchmark( b ) { +bench( format( '%s::instantiation,new', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -83,7 +84,7 @@ bench( pkg+'::instantiation,new', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,no_new', function benchmark( b ) { +bench( format( '%s::instantiation,no_new', pkg ), function benchmark( b ) { var ctor; var arr; var i; @@ -105,7 +106,7 @@ bench( pkg+'::instantiation,no_new', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,length', function benchmark( b ) { +bench( format( '%s::instantiation,length', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -123,7 +124,7 @@ bench( pkg+'::instantiation,length', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,typed_array', function benchmark( b ) { +bench( format( '%s::instantiation,typed_array', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -145,7 +146,7 @@ bench( pkg+'::instantiation,typed_array', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,array', function benchmark( b ) { +bench( format( '%s::instantiation,array', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -167,7 +168,7 @@ bench( pkg+'::instantiation,array', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,iterable', opts, function benchmark( b ) { +bench( format( '%s::instantiation,iterable', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -186,7 +187,7 @@ bench( pkg+'::instantiation,iterable', opts, function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,arraybuffer', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -208,7 +209,7 @@ bench( pkg+'::instantiation,arraybuffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -230,7 +231,7 @@ bench( pkg+'::instantiation,arraybuffer,byte_offset', function benchmark( b ) { b.end(); }); -bench( pkg+'::instantiation,arraybuffer,byte_offset,length', function benchmark( b ) { +bench( format( '%s::instantiation,arraybuffer,byte_offset,length', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.of.js index 538e39a016f4..5a69855f3db7 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.of.js @@ -21,6 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -32,7 +33,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; @@ -51,7 +52,7 @@ bench( pkg+':of', function benchmark( b ) { b.end(); }); -bench( pkg+':len=5', function benchmark( b ) { +bench( format( '%s:of:len=5', pkg ), function benchmark( b ) { var buf; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.property_access.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.property_access.js index c0fea37c87f4..0b31d4f3b1e2 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.property_access.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.property_access.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -34,7 +35,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -57,7 +58,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -80,7 +81,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -103,7 +104,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.js index 88c60c055df0..5aba286e12d7 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -33,7 +34,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+'::number:set', function benchmark( b ) { +bench( format( '%s::number:set', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -62,7 +63,7 @@ bench( pkg+'::number:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var arr; var N; @@ -91,7 +92,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var arr; var buf; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.length.js index 33a1322b64f8..b19c4d297466 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randu = require( '@stdlib/random/array/randu' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.js index dc823451c674..6899d000daca 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.js @@ -21,6 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -32,7 +33,7 @@ var Float64ArrayLE = factory( 'float64' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.length.js index c40fcd69f4c7..9c4c011263e1 100644 --- a/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/little-endian-factory/benchmark/benchmark.to_string.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var zeroTo = require( '@stdlib/array/zero-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var factory = require( './../lib' ); @@ -92,7 +93,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/nans-like/lib/main.js b/lib/node_modules/@stdlib/array/nans-like/lib/main.js index 9f8619b0b86e..1270f02f550b 100644 --- a/lib/node_modules/@stdlib/array/nans-like/lib/main.js +++ b/lib/node_modules/@stdlib/array/nans-like/lib/main.js @@ -20,10 +20,13 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var dtype = require( '@stdlib/array/dtype' ); var full = require( '@stdlib/array/full' ); var Complex128 = require( '@stdlib/complex/float64/ctor' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); @@ -31,7 +34,8 @@ var format = require( '@stdlib/string/format' ); var Z128 = new Complex128( NaN, NaN ); var Z64 = new Complex64( NaN, NaN ); -var DTYPES = [ 'float64', 'float32', 'complex128', 'complex64', 'generic' ]; +var DTYPES = dtypes( 'floating_point_and_generic' ); +var isValidDType = contains( DTYPES ); // MAIN // @@ -63,11 +67,11 @@ function nansLike( x ) { } if ( arguments.length > 1 ) { dt = arguments[ 1 ]; - if ( DTYPES.indexOf( dt ) === -1 ) { - throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', DTYPES.join( '", "' ), dt ) ); + if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } - } else if ( DTYPES.indexOf( dt ) === -1 ) { - throw new TypeError( format( 'invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.', DTYPES.join( '", "' ), dt ) ); + } else if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } if ( dt === 'complex128' ) { v = Z128; diff --git a/lib/node_modules/@stdlib/array/nans/examples/index.js b/lib/node_modules/@stdlib/array/nans/examples/index.js index 49a2d49b2e47..a23e63962786 100644 --- a/lib/node_modules/@stdlib/array/nans/examples/index.js +++ b/lib/node_modules/@stdlib/array/nans/examples/index.js @@ -19,7 +19,7 @@ 'use strict'; var dtypes = require( '@stdlib/array/typed-float-dtypes' ); -var ones = require( './../lib' ); +var nans = require( './../lib' ); // Get a list of array data types: var dt = dtypes(); @@ -28,6 +28,6 @@ var dt = dtypes(); var arr; var i; for ( i = 0; i < dt.length; i++ ) { - arr = ones( 4, dt[ i ] ); + arr = nans( 4, dt[ i ] ); console.log( arr ); } diff --git a/lib/node_modules/@stdlib/array/nans/lib/main.js b/lib/node_modules/@stdlib/array/nans/lib/main.js index d8891d3ce694..5b133d3c26ca 100644 --- a/lib/node_modules/@stdlib/array/nans/lib/main.js +++ b/lib/node_modules/@stdlib/array/nans/lib/main.js @@ -26,6 +26,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var full = require( '@stdlib/array/full' ); var defaults = require( '@stdlib/array/defaults' ); var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); @@ -64,7 +65,7 @@ function nans( length ) { if ( arguments.length > 1 ) { dtype = arguments[ 1 ]; if ( !isValidDType( dtype ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', DTYPES.join( '", "' ), dtype ) ); + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dtype ) ); } } else { dtype = DEFAULT_DTYPE; diff --git a/lib/node_modules/@stdlib/array/nulls/README.md b/lib/node_modules/@stdlib/array/nulls/README.md new file mode 100644 index 000000000000..2f5c8ad13d35 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/README.md @@ -0,0 +1,117 @@ + + +# nulls + +> Create an array filled with nulls and having a specified length. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var nulls = require( '@stdlib/array/nulls' ); +``` + +#### nulls( length\[, dtype] ) + +Creates an array filled with nulls and having a specified length. + +```javascript +var arr = nulls( 2 ); +// returns [ null, null ] +``` + +The function recognizes the following data types: + +- `generic`: generic JavaScript values. + +By default, the output array data type is `'generic'`. To specify an alternative data type, provide a `dtype` argument. + +```javascript +var arr = nulls( 2, 'generic' ); +// returns [ null, null ] +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var nulls = require( '@stdlib/array/nulls' ); + +// Create a filled array: +var x = nulls( 10 ); +console.log( x ); +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.js new file mode 100644 index 000000000000..1762b5a91951 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.js @@ -0,0 +1,66 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isCollection = require( '@stdlib/assert/is-collection' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var nulls = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var arr; + var i; + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + arr = nulls( 0 ); + if ( arr.length !== 0 ) { + b.fail( 'should have length 0' ); + } + } + b.toc(); + if ( !isCollection( arr ) ) { + b.fail( 'should return an array' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( format( '%s:dtype=%s', pkg, 'generic' ), function benchmark( b ) { + var arr; + var i; + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + arr = nulls( 0, 'generic' ); + if ( arr.length !== 0 ) { + b.fail( 'should have length 0' ); + } + } + b.toc(); + if ( !isCollection( arr ) ) { + b.fail( 'should return an array' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.length.generic.js new file mode 100644 index 000000000000..923f9ee5320d --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/benchmark/benchmark.length.generic.js @@ -0,0 +1,94 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isCollection = require( '@stdlib/assert/is-collection' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var nulls = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var arr; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + arr = nulls( len, 'generic' ); + if ( arr.length !== len ) { + b.fail( 'unexpected length' ); + } + } + b.toc(); + if ( !isCollection( arr ) ) { + b.fail( 'should return an array' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'generic', len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/array/nulls/docs/repl.txt b/lib/node_modules/@stdlib/array/nulls/docs/repl.txt new file mode 100644 index 000000000000..95db321731d3 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/docs/repl.txt @@ -0,0 +1,33 @@ + +{{alias}}( length[, dtype] ) + Returns an array filled with nulls and having a specified length. + + The function supports the following data types: + + - generic: generic JavaScript values + + The default array data type is `generic`. + + Parameters + ---------- + length: integer + Array length. + + dtype: string (optional) + Data type. Default: 'generic'. + + Returns + ------- + out: Array + Output array. + + Examples + -------- + > var arr = {{alias}}( 2 ) + [ null, null ] + > arr = {{alias}}( 2, 'generic' ) + [ null, null ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/array/nulls/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/nulls/docs/types/index.d.ts new file mode 100644 index 000000000000..8042364a429a --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/docs/types/index.d.ts @@ -0,0 +1,63 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Data type. +*/ +type DataType = 'generic'; + +/** +* Creates an array filled with nulls and having a specified length. +* +* @param length - array length +* @param dtype - data type +* @returns filled array +* +* @example +* var arr = nulls( 2, 'generic' ); +* // returns [ null, null ] +*/ +declare function nulls( length: number, dtype: 'generic' ): Array; + +/** +* Creates an array filled with nulls and having a specified length. +* +* The function recognizes the following data types: +* +* - `generic`: generic JavaScript values +* +* @param length - array length +* @param dtype - data type (default: 'generic') +* @returns filled array +* +* @example +* var arr = nulls( 2 ); +* // returns [ null, null ] +* +* @example +* var arr = nulls( 2, 'generic' ); +* // returns [ null, null ] +*/ +declare function nulls( length: number, dtype?: DataType ): Array; + + +// EXPORTS // + +export = nulls; diff --git a/lib/node_modules/@stdlib/array/nulls/docs/types/test.ts b/lib/node_modules/@stdlib/array/nulls/docs/types/test.ts new file mode 100644 index 000000000000..e6309a4efb06 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/docs/types/test.ts @@ -0,0 +1,67 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 nulls = require( './index' ); + + +// TESTS // + +// The function returns an array... +{ + nulls( 10 ); // $ExpectType null[] + nulls( 10, 'generic' ); // $ExpectType null[] +} + +// The compiler throws an error if the function is not provided a number for the first argument... +{ + nulls( '5' ); // $ExpectError + nulls( false ); // $ExpectError + nulls( true ); // $ExpectError + nulls( null ); // $ExpectError + nulls( undefined ); // $ExpectError + nulls( [] ); // $ExpectError + nulls( {} ); // $ExpectError + nulls( ( x: number ): number => x ); // $ExpectError + + nulls( '5', 'generic' ); // $ExpectError + nulls( false, 'generic' ); // $ExpectError + nulls( true, 'generic' ); // $ExpectError + nulls( null, 'generic' ); // $ExpectError + nulls( undefined, 'generic' ); // $ExpectError + nulls( [], 'generic' ); // $ExpectError + nulls( {}, 'generic' ); // $ExpectError + nulls( ( x: number ): number => x, 'generic' ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is an unrecognized/unsupported data type... +{ + nulls( 10, '10' ); // $ExpectError + nulls( 10, 10 ); // $ExpectError + nulls( 10, false ); // $ExpectError + nulls( 10, true ); // $ExpectError + nulls( 10, null ); // $ExpectError + nulls( 10, [] ); // $ExpectError + nulls( 10, {} ); // $ExpectError + nulls( 10, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + nulls(); // $ExpectError + nulls( 10, 'generic', 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/array/nulls/examples/index.js b/lib/node_modules/@stdlib/array/nulls/examples/index.js new file mode 100644 index 000000000000..569505509fde --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/examples/index.js @@ -0,0 +1,25 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 nulls = require( './../lib' ); + +// Create a filled array: +var x = nulls( 10 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/array/nulls/lib/index.js b/lib/node_modules/@stdlib/array/nulls/lib/index.js new file mode 100644 index 000000000000..bb8c15e676f7 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/lib/index.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Create an array filled with nulls and having a specified length. +* +* @module @stdlib/array/nulls +* +* @example +* var nulls = require( '@stdlib/array/nulls' ); +* +* var arr = nulls( 2 ); +* // returns [ null, null ] +* +* @example +* var nulls = require( '@stdlib/array/nulls' ); +* +* var arr = nulls( 2, 'generic' ); +* // returns [ null, null ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/array/nulls/lib/main.js b/lib/node_modules/@stdlib/array/nulls/lib/main.js new file mode 100644 index 000000000000..548619dc95ac --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/lib/main.js @@ -0,0 +1,72 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var full = require( '@stdlib/array/full' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); + + +// VARIABLES // + +var DTYPES = [ 'generic' ]; +var isValidDType = contains( DTYPES ); +var DEFAULT_DTYPE = 'generic'; + + +// MAIN // + +/** +* Creates an array filled with nulls and having a specified length. +* +* @param {NonNegativeInteger} length - array length +* @param {string} [dtype="generic"] - data type +* @throws {TypeError} first argument must be a nonnegative integer +* @throws {TypeError} second argument must be a supported data type +* @returns {Array} array or typed array +* +* @example +* var arr = nulls( 2 ); +* // returns [ null, null ] +* +* @example +* var arr = nulls( 2, 'generic' ); +* // returns [ null, null ] +*/ +function nulls( length ) { + var dtype; + + if ( arguments.length > 1 ) { + dtype = arguments[ 1 ]; + if ( !isValidDType( dtype ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dtype ) ); + } + } else { + dtype = DEFAULT_DTYPE; + } + return full( length, null, dtype ); +} + + +// EXPORTS // + +module.exports = nulls; diff --git a/lib/node_modules/@stdlib/array/nulls/package.json b/lib/node_modules/@stdlib/array/nulls/package.json new file mode 100644 index 000000000000..851310b3def2 --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/package.json @@ -0,0 +1,64 @@ +{ + "name": "@stdlib/array/nulls", + "version": "0.0.0", + "description": "Create an array filled with nulls and having a specified length.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "data", + "structure", + "typed", + "array", + "vector", + "fill", + "filled", + "nulls" + ] +} diff --git a/lib/node_modules/@stdlib/array/nulls/test/test.js b/lib/node_modules/@stdlib/array/nulls/test/test.js new file mode 100644 index 000000000000..21fdefcac91c --- /dev/null +++ b/lib/node_modules/@stdlib/array/nulls/test/test.js @@ -0,0 +1,157 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 instanceOf = require( '@stdlib/assert/instance-of' ); +var nulls = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof nulls, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided a value other than a nonnegative integer for the first argument', function test( t ) { + var values; + var i; + + values = [ + '5', + -3, + 3.14, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + nulls( value ); + }; + } +}); + +tape( 'the function throws an error if provided a value other than a nonnegative integer for the first argument (dtype)', function test( t ) { + var values; + var i; + + values = [ + '5', + -3, + 3.14, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + nulls( value, 'generic' ); + }; + } +}); + +tape( 'the function throws an error if provided an unrecognized data type', function test( t ) { + var values; + var i; + + values = [ + '5', + 'beep', + 'ones', + 'Int32', + 'Uint32', + 'Int16', + 'Uint16', + 'Int8', + 'Uint8', + 'Uint8c', + 'uint8_clamped', + 'Float64', + 'Float32', + 'FLOAT64', + 'FLOAT32', + 'GENERIC' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + nulls( 10, value ); + }; + } +}); + +tape( 'the function returns a filled array (default)', function test( t ) { + var expected; + var arr; + + arr = nulls( 5 ); + t.strictEqual( instanceOf( arr, Array ), true, 'returns expected value' ); + t.strictEqual( arr.length, 5, 'returns expected value' ); + + expected = [ null, null, null, null, null ]; + t.deepEqual( arr, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a filled array (dtype=generic)', function test( t ) { + var expected; + var arr; + + arr = nulls( 5, 'generic' ); + t.strictEqual( instanceOf( arr, Array ), true, 'returns expected value' ); + t.strictEqual( arr.length, 5, 'returns expected value' ); + + expected = [ null, null, null, null, null ]; + t.deepEqual( arr, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/array/one-to-like/lib/main.js b/lib/node_modules/@stdlib/array/one-to-like/lib/main.js index 6eabfd107132..be7f8447815b 100644 --- a/lib/node_modules/@stdlib/array/one-to-like/lib/main.js +++ b/lib/node_modules/@stdlib/array/one-to-like/lib/main.js @@ -20,11 +20,20 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var oneTo = require( '@stdlib/array/one-to' ); var dtype = require( '@stdlib/array/dtype' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); +// VARIABLES // + +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); + + // MAIN // /** @@ -51,6 +60,11 @@ function oneToLike( x ) { } if ( arguments.length > 1 ) { dt = arguments[ 1 ]; + if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); + } + } else if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } return oneTo( x.length, dt ); } diff --git a/lib/node_modules/@stdlib/array/ones-like/lib/main.js b/lib/node_modules/@stdlib/array/ones-like/lib/main.js index 6393e17f3f82..91e59b51e3b3 100644 --- a/lib/node_modules/@stdlib/array/ones-like/lib/main.js +++ b/lib/node_modules/@stdlib/array/ones-like/lib/main.js @@ -20,10 +20,13 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var dtype = require( '@stdlib/array/dtype' ); var full = require( '@stdlib/array/full' ); var Complex128 = require( '@stdlib/complex/float64/ctor' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); @@ -31,6 +34,8 @@ var format = require( '@stdlib/string/format' ); var Z128 = new Complex128( 1.0, 0.0 ); var Z64 = new Complex64( 1.0, 0.0 ); +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); // MAIN // @@ -62,6 +67,11 @@ function onesLike( x ) { } if ( arguments.length > 1 ) { dt = arguments[ 1 ]; + if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); + } + } else if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } if ( dt === 'complex128' ) { v = Z128; diff --git a/lib/node_modules/@stdlib/array/ones/lib/main.js b/lib/node_modules/@stdlib/array/ones/lib/main.js index 3eddae8369bb..3125fe2cfc16 100644 --- a/lib/node_modules/@stdlib/array/ones/lib/main.js +++ b/lib/node_modules/@stdlib/array/ones/lib/main.js @@ -20,16 +20,22 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var Complex128 = require( '@stdlib/complex/float64/ctor' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var full = require( '@stdlib/array/full' ); +var dtypes = require( '@stdlib/array/dtypes' ); var defaults = require( '@stdlib/array/defaults' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); // VARIABLES // var Z128 = new Complex128( 1.0, 0.0 ); var Z64 = new Complex64( 1.0, 0.0 ); +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); var DEFAULT_DTYPE = defaults.get( 'dtypes.default' ); @@ -58,6 +64,9 @@ function ones( length ) { if ( arguments.length > 1 ) { dtype = arguments[ 1 ]; + if ( !isValidDType( dtype ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dtype ) ); + } } else { dtype = DEFAULT_DTYPE; } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.js index c1fc183cb58b..5292f84ab64b 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -46,7 +47,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float64' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -64,7 +65,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'float32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -82,7 +83,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -100,7 +101,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint32' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -118,7 +119,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int16' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -136,7 +137,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint16' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -154,7 +155,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'int8' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -172,7 +173,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8' ), function benchmark( b ) { var arr; var i; b.tic(); @@ -190,7 +191,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=%s', pkg, 'uint8c' ), function benchmark( b ) { var arr; var i; b.tic(); diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float32.js index 7b314ea4b89e..57df37e4f5de 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'float32', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float64.js index b92107d296c2..49f8cb4386a9 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.float64.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'float64', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int16.js index a26a4169877c..c65b1478db2d 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'int16', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int32.js index c2107bc5ce31..a23fcb60ea50 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'int32', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int8.js index 5478bc9bbe75..980b52491a66 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.int8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'int8', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint16.js index 6ff01fc72f7e..e86caaa037b6 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'uint16', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint32.js index 312a36afd8d5..e3077aca5a3e 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'uint32', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8.js index bfb8fa1240ba..565a249dbe36 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'uint8', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8c.js index 605f557dcf16..839d2378016d 100644 --- a/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/typed-real/benchmark/benchmark.length.uint8c.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var realarray = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=%s,len=%d', pkg, 'uint8c', len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.js index 7c903c34f681..2203359eb83d 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.length.js index 84e9cd61c87c..dd540c3567e5 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.data.js index fb912ea2b923..8d64bb260cc6 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.data.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+'::get,index', function benchmark( b ) { +bench( format( '%s::get,index', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -51,7 +52,7 @@ bench( pkg+'::get,index', function benchmark( b ) { b.end(); }); -bench( pkg+'::set,index', function benchmark( b ) { +bench( format( '%s::set,index', pkg ), function benchmark( b ) { var arr; var N; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.entries.js index 072c7c53b1bc..543aaf872984 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.js index 93a5d357c9a7..640f4afdbbd4 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':every', function benchmark( b ) { } }); -bench( pkg+'::this_context:every', function benchmark( b ) { +bench( format( '%s::this_context:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.length.js index 3340d9833df0..f65092bc43b8 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.every.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':every:len='+len, f ); + bench( format( '%s:every:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.js index f0983e0d62a8..3b48e2167b27 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.length.js index 33877794be96..2ea658dc56f8 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.fill.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.js index e9d36969a51c..77da5b3ee05b 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var arr; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+':filter', function benchmark( b ) { } }); -bench( pkg+'::this_context:filter', function benchmark( b ) { +bench( format( '%s::this_context:filter', pkg ), function benchmark( b ) { var arr; var out; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.length.js index 6941c0a61fe2..307746464e40 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.js index 1d347e492b3b..1e9d9a8ba050 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':find', function benchmark( b ) { } }); -bench( pkg+'::this_context:find', function benchmark( b ) { +bench( format( '%s::this_context:find', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.length.js index b1cfa5ec7178..ace67beec8c7 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.js index c1e86611cc27..479821c6b6bf 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':findIndex', function benchmark( b ) { } }); -bench( pkg+'::this_context:findIndex', function benchmark( b ) { +bench( format( '%s::this_context:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.length.js index 83fd164a2998..69faf1289926 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.find_index.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.js index 67594f8de5fe..4836008a2485 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+':forEach', function benchmark( b ) { } }); -bench( pkg+'::this_context:forEach', function benchmark( b ) { +bench( format( '%s::this_context:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.length.js index ed6ad3f5f47d..9f1526ba84e7 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.from.js index 44de0b6ffb57..075c8f053fd7 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -84,7 +85,7 @@ bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from', function benchmark( b ) { +bench( format( '%s::array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -132,7 +133,7 @@ bench( pkg+'::array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -182,7 +183,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.js index 45b77212c999..560ecfe0ddb9 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.length.js index 6bc43f188835..83cfb965f96a 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.js index c3f4e8655e7d..de0fc076c70c 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.length.js index 70ae6f9c2973..4d61dda7a2e5 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.js index bc8234cfc873..6e8fd174a9b6 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.length.js index 94f15eab5bc3..cf932dcdb05c 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.join.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.keys.js index d65e8f0f343d..297b18c0333d 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.keys.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.js index 318584ae6337..37c72f3ce9d3 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.length.js index 2f711a7311cf..85c0af738333 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.last_index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.length.js index a91be0152e02..3f8f07ae3a67 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ctor = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.js index a6389e1de64e..09e5b14e21b2 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':map', function benchmark( b ) { } }); -bench( pkg+'::this_context:map', function benchmark( b ) { +bench( format( '%s::this_context:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.length.js index 460ac0681885..f02f43a8a6ee 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.map.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.of.js index a82d4ffead17..26d177161147 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.properties.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.properties.js index 7805cb961afe..86e52ba269bc 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.properties.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.properties.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -52,7 +53,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -75,7 +76,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -98,7 +99,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { +bench( format( '%s::get:BYTES_PER_ELEMENT', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -121,7 +122,7 @@ bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.js index dd3dfdd13e9f..ecb518ba372d 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduce', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduce', function benchmark( b ) { +bench( format( '%s::initial_value:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.length.js index 1023c90771d9..7bf2bc8c8d7a 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.js index ec3f69b913c1..df325eccf17e 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduceRight', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduceRight', function benchmark( b ) { +bench( format( '%s::initial_value:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.length.js index f2e544b70205..c13556038091 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reduce_right.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.js index 4ead6ff88633..3ccc1fcb9236 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.length.js index 653f41a31184..2578446f4572 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.reverse.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.js index 1598ea324145..186cfebe1509 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; @@ -60,7 +61,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.length.js index be2a0c9f5d9b..9cd8ec138d4d 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.js index e5c0dbb54127..1283fbf353c8 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.length.js index f5b60c8b543f..b9f3aa2adc61 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.slice.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.js index 6a9ede19e4e4..c75a1015a31e 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':some', function benchmark( b ) { +bench( format( '%s:some', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':some', function benchmark( b ) { } }); -bench( pkg+'::this_context:some', function benchmark( b ) { +bench( format( '%s::this_context:some', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.length.js index f5fc249e32d4..a03c4ffb875a 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.some.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.js index ce9f91244cf6..29eba9292f26 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var randi = require( '@stdlib/random/base/randi' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.length.js index 5af89301b0d8..a16baf4d8e05 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.js index ecfbb3e8e1da..d9c76d8554dd 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.length.js index b0931b06dc7e..9b09de50a458 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.subarray.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint16Array = require( '@stdlib/assert/is-uint16array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.js index 2afdc4538f9e..96aef0872aba 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.length.js index f08d59c6a906..f814d4f51fc5 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.js index 4e731b56150a..75b50eca9841 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.length.js index 94478a00141f..0071b247c7a2 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.to_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.values.js index 5e39e6c164e4..53a0e060149b 100644 --- a/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/uint16/benchmark/benchmark.values.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint16Array = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.js index c9ddce74d0d0..62673bff80b0 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.length.js index 1822878d220a..cc57180905cf 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.data.js index e29992213ec2..0685598f3cc1 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.data.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+'::get,index', function benchmark( b ) { +bench( format( '%s::get,index', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -51,7 +52,7 @@ bench( pkg+'::get,index', function benchmark( b ) { b.end(); }); -bench( pkg+'::set,index', function benchmark( b ) { +bench( format( '%s::set,index', pkg ), function benchmark( b ) { var arr; var N; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.entries.js index b14d89bd1e03..6f5e90da8926 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.js index 27e2f00d2b53..92eb6831f0b3 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':every', function benchmark( b ) { } }); -bench( pkg+'::this_context:every', function benchmark( b ) { +bench( format( '%s::this_context:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.length.js index 92bc5336ddab..f15ad18e41c6 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.every.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':every:len='+len, f ); + bench( format( '%s:every:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.js index ad81b7bf25e0..3b984e2c652c 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.length.js index cd975c94b76a..6a25a2bc99f4 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.fill.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.js index 2482f7986a9a..1207a64ce501 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var arr; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+':filter', function benchmark( b ) { } }); -bench( pkg+'::this_context:filter', function benchmark( b ) { +bench( format( '%s::this_context:filter', pkg ), function benchmark( b ) { var arr; var out; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.length.js index 9f0be6f7e1da..a8bdd18b2138 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.js index ed2e4fd0cfd9..0403ca9ab786 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':find', function benchmark( b ) { } }); -bench( pkg+'::this_context:find', function benchmark( b ) { +bench( format( '%s::this_context:find', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.length.js index 594f6f3af05e..32755385c876 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.js index e724bed51e4e..9c6e877d5645 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':findIndex', function benchmark( b ) { } }); -bench( pkg+'::this_context:findIndex', function benchmark( b ) { +bench( format( '%s::this_context:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.length.js index 6cbba8cef1a2..774a5e2a6987 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.find_index.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.js index 8b5ae0152527..fe90c691a30c 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+':forEach', function benchmark( b ) { } }); -bench( pkg+'::this_context:forEach', function benchmark( b ) { +bench( format( '%s::this_context:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.length.js index d888fdf7628a..e56b2f63ad18 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.from.js index 4ff139dfaaeb..c5d73f441521 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -84,7 +85,7 @@ bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from', function benchmark( b ) { +bench( format( '%s::array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -132,7 +133,7 @@ bench( pkg+'::array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -182,7 +183,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.js index e161e273fff9..1f95ba15c59f 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.length.js index 3472fabb999e..1feae1e44d0d 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.js index 7f04d9653a7f..d00b85186be4 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.length.js index 9adbbeec50c2..98fdbaec6026 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.js index 74605f53f0c5..59210ec08556 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.length.js index 8533a1299b4b..884da5474da5 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.join.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.keys.js index e3d8e656726a..853a09a534e2 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.keys.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.js index dd0e58474873..433a000ba6e2 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.length.js index 03ab92e987cc..ff24424ff4c7 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.last_index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.length.js index 75638104c293..3eeff4beab34 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ctor = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.js index b57414a6c98b..678573705d11 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':map', function benchmark( b ) { } }); -bench( pkg+'::this_context:map', function benchmark( b ) { +bench( format( '%s::this_context:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.length.js index 0fed7073d447..706b53744f01 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.map.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.of.js index 4b7f085c2784..09df310551ec 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.properties.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.properties.js index 75282035bb31..103c230d4d0d 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.properties.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.properties.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -52,7 +53,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -75,7 +76,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -98,7 +99,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { +bench( format( '%s::get:BYTES_PER_ELEMENT', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -121,7 +122,7 @@ bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.js index 1a8a085847ac..7231849858cd 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduce', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduce', function benchmark( b ) { +bench( format( '%s::initial_value:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.length.js index 36d875fb0327..4081d7fe9428 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.js index 22685d203775..687a56bb3e78 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduceRight', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduceRight', function benchmark( b ) { +bench( format( '%s::initial_value:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.length.js index fcba6798a3dc..d5b1f7b3e913 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reduce_right.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.js index 49e486c34e24..28633ef71019 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.length.js index bc78f719c7d6..19c6bd9f7d40 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.reverse.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.js index fdcd920dbc4c..5033dd927005 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; @@ -60,7 +61,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.length.js index 8d28e8263d7e..6a669e589244 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.js index 00e73452ecc7..4ce476ba586c 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.length.js index e46ac89f529a..ec681cf87989 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.slice.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.js index 3abaeec284a8..74196fbc9a2b 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':some', function benchmark( b ) { +bench( format( '%s:some', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':some', function benchmark( b ) { } }); -bench( pkg+'::this_context:some', function benchmark( b ) { +bench( format( '%s::this_context:some', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.length.js index 8b8b2a53a003..11c43f9dd522 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.some.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.js index dd4f6a2446a2..9775ed3c0e29 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var randi = require( '@stdlib/random/base/randi' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.length.js index c40b6ec9380d..c7b2d62866e6 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.js index 5014eb4da356..81db06412e68 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.length.js index 1bca9ab45cc4..5194c4e8741a 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.subarray.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.js index e947d2ad6777..9d8eaec4cb83 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.length.js index a4da2c1834ef..ffe16520797d 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.js index 78c524a444c4..56f6013814f4 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.length.js index af13a8cc738c..f2c8d5a5c289 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.to_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.values.js index 3854804a69db..3bc7d7bc9ba4 100644 --- a/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/uint32/benchmark/benchmark.values.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint32Array = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.js index fd94b25461f8..5ecc3211929c 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.length.js index 7dd8aae099cb..bd2e5f9efc30 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.data.js index c494b681f138..297a391220cd 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.data.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+'::get,index', function benchmark( b ) { +bench( format( '%s::get,index', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -51,7 +52,7 @@ bench( pkg+'::get,index', function benchmark( b ) { b.end(); }); -bench( pkg+'::set,index', function benchmark( b ) { +bench( format( '%s::set,index', pkg ), function benchmark( b ) { var arr; var N; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.entries.js index fefbd578947e..0d9ec880fe0e 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.every.js index d22cc45dfa85..84c4d42a50ef 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':every', function benchmark( b ) { } }); -bench( pkg+'::this_context:every', function benchmark( b ) { +bench( format( '%s::this_context:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.js index ba36b1313c3d..0bf93944584c 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.length.js index 010fbc572ade..7d48f6acd6b1 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.fill.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.js index 1dae0041ea23..1a2e176b69f1 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var arr; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+':filter', function benchmark( b ) { } }); -bench( pkg+'::this_context:filter', function benchmark( b ) { +bench( format( '%s::this_context:filter', pkg ), function benchmark( b ) { var arr; var out; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.length.js index 37014c67521b..18a137d7fe12 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.js index 5327e0ebaa1e..f836a2a2a660 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':find', function benchmark( b ) { } }); -bench( pkg+'::this_context:find', function benchmark( b ) { +bench( format( '%s::this_context:find', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.length.js index c3628e40055c..1fd2683cce35 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.js index b4d8cd4244f0..7f3cac3758bd 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':findIndex', function benchmark( b ) { } }); -bench( pkg+'::this_context:findIndex', function benchmark( b ) { +bench( format( '%s::this_context:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.length.js index bf124a9938a5..8cc6c415921a 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.find_index.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.js index 404a9c9dfdd0..1c4b70a464f1 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+':forEach', function benchmark( b ) { } }); -bench( pkg+'::this_context:forEach', function benchmark( b ) { +bench( format( '%s::this_context:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.length.js index a7ef3a42a06d..7f2c9fba323a 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.from.js index abe60a0518e6..c7c173473a70 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -84,7 +85,7 @@ bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from', function benchmark( b ) { +bench( format( '%s::array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -132,7 +133,7 @@ bench( pkg+'::array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -182,7 +183,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.js index 12a1656c8364..910ba8b406a8 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.length.js index fdb98c85a978..b3b1f90166d7 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.js index 8fa6d85b43ed..6e823d5b9611 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.length.js index dd76a68acbd6..5c1f8406cef8 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.js index 958aa5489b70..aed2a2ed9df4 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.length.js index c25d21214e9d..01a50d4b0271 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.join.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.keys.js index 2c70df05ee1d..700509a99e0b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.keys.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.js index 0e80fc654916..50899f661622 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.length.js index b36aa4c73cd0..65c79d607b76 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.last_index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.length.js index e40be57e470d..c4c96929864e 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ctor = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.js index 106bc120486b..d1a0fe640033 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':map', function benchmark( b ) { } }); -bench( pkg+'::this_context:map', function benchmark( b ) { +bench( format( '%s::this_context:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.length.js index f0200bd5778f..15a154bf8d7c 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.map.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.of.js index 6aaa2bf409fa..f176a904311b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.properties.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.properties.js index 891b634f69b5..0fb3b00a3a31 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.properties.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.properties.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -52,7 +53,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -75,7 +76,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -98,7 +99,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { +bench( format( '%s::get:BYTES_PER_ELEMENT', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -121,7 +122,7 @@ bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.js index 21498da836a4..9d04851410c8 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduce', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduce', function benchmark( b ) { +bench( format( '%s::initial_value:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.length.js index 82c3ceb41797..fa1b6d10de4b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.js index e452af1d4b5c..587fc8b93b6e 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduceRight', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduceRight', function benchmark( b ) { +bench( format( '%s::initial_value:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.length.js index 6e1b422e37a5..1b45a0fab326 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reduce_right.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.js index 84bcc28b59c0..6acdc9de57c4 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.length.js index e5e360eec52e..e9befa95f3eb 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.reverse.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.js index 59827e1ee005..684f1de0c145 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; @@ -60,7 +61,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.length.js index 052293f4472b..392e71146739 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.js index 874b535e5f9e..f1599250fd8b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.length.js index 78e2b7e1deea..ffcba6f39ac6 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.slice.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.js index f20c59cad266..62baf994a6fb 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':some', function benchmark( b ) { +bench( format( '%s:some', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':some', function benchmark( b ) { } }); -bench( pkg+'::this_context:some', function benchmark( b ) { +bench( format( '%s::this_context:some', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.length.js index 647c0768d9d1..11a701e86d34 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.some.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.js index 4d36b9d6d06c..f0970b798bb3 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var randi = require( '@stdlib/random/base/randi' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.length.js index ca66eda0949a..eb6f04ebe33b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.js index 2c91017e90e6..4d0bc1748853 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.length.js index e353f0178d8d..4a13b7be222b 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.subarray.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8Array = require( '@stdlib/assert/is-uint8array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.js index 7631518acd30..418d44799fba 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.length.js index 824ebc2967d1..f07d560c85cd 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.js index 75f8bcb25d6d..40b641725d5c 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.length.js index de8020da3c07..e802f4740190 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.to_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.values.js index f59323841a3a..5776191f52b7 100644 --- a/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/uint8/benchmark/benchmark.values.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8Array = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.js index e2731bd2b643..de8f1dd01487 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':copyWithin', function benchmark( b ) { +bench( format( '%s:copyWithin', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.length.js index bd70626c57cf..251ddca14273 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.copy_within.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':copyWithin:len='+len, f ); + bench( format( '%s:copyWithin:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.data.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.data.js index 5cbb9007fbc8..cd466c1084bb 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.data.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.data.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+'::get,index', function benchmark( b ) { +bench( format( '%s::get,index', pkg ), function benchmark( b ) { var arr; var N; var v; @@ -51,7 +52,7 @@ bench( pkg+'::get,index', function benchmark( b ) { b.end(); }); -bench( pkg+'::set,index', function benchmark( b ) { +bench( format( '%s::set,index', pkg ), function benchmark( b ) { var arr; var N; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.entries.js index 0b2af25f1eac..1f82075867a6 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.entries.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':entries', function benchmark( b ) { +bench( format( '%s:entries', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.js index c2dea91d5390..6e51dd61d58d 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':every', function benchmark( b ) { +bench( format( '%s:every', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':every', function benchmark( b ) { } }); -bench( pkg+'::this_context:every', function benchmark( b ) { +bench( format( '%s::this_context:every', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.length.js index 0ec67464564c..59c22c63a17c 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.every.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':every:len='+len, f ); + bench( format( '%s:every:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.js index d98109597e11..9130c1191f36 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':fill', function benchmark( b ) { +bench( format( '%s:fill', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.length.js index 60c5757ae89d..130b175a1742 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.fill.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':fill:len='+len, f ); + bench( format( '%s:fill:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.js index e1c52ee7263a..f80891506243 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':filter', function benchmark( b ) { +bench( format( '%s:filter', pkg ), function benchmark( b ) { var arr; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+':filter', function benchmark( b ) { } }); -bench( pkg+'::this_context:filter', function benchmark( b ) { +bench( format( '%s::this_context:filter', pkg ), function benchmark( b ) { var arr; var out; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.length.js index dffa04ec88b8..52d106c7d120 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.filter.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':filter:len='+len, f ); + bench( format( '%s:filter:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.js index d1f8b34316a7..d64162410620 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':find', function benchmark( b ) { +bench( format( '%s:find', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':find', function benchmark( b ) { } }); -bench( pkg+'::this_context:find', function benchmark( b ) { +bench( format( '%s::this_context:find', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.length.js index bbdca5941bf5..5f958031fcf0 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':find:len='+len, f ); + bench( format( '%s:find:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.js index 439909a4e3da..6db61d27ff71 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':findIndex', function benchmark( b ) { +bench( format( '%s:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':findIndex', function benchmark( b ) { } }); -bench( pkg+'::this_context:findIndex', function benchmark( b ) { +bench( format( '%s::this_context:findIndex', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.length.js index 5aadd9b1153b..d2912a8f7689 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.find_index.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':findIndex:len='+len, f ); + bench( format( '%s:findIndex:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.js index 0666c43c243f..079a50d175d5 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':forEach', function benchmark( b ) { +bench( format( '%s:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; @@ -57,7 +58,7 @@ bench( pkg+':forEach', function benchmark( b ) { } }); -bench( pkg+'::this_context:forEach', function benchmark( b ) { +bench( format( '%s::this_context:forEach', pkg ), function benchmark( b ) { var count; var arr; var N; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.length.js index e24aed6a8f0c..bf07cb19241c 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.for_each.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':forEach:len='+len, f ); + bench( format( '%s:forEach:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.from.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.from.js index 9ed431a30434..3465c4795ab2 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.from.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.from.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+'::typed_array:from', function benchmark( b ) { +bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -58,7 +59,7 @@ bench( pkg+'::typed_array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { +bench( format( '%s::typed_array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -84,7 +85,7 @@ bench( pkg+'::typed_array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::array:from', function benchmark( b ) { +bench( format( '%s::array:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -106,7 +107,7 @@ bench( pkg+'::array:from', function benchmark( b ) { b.end(); }); -bench( pkg+'::array,clbk:from', function benchmark( b ) { +bench( format( '%s::array,clbk:from', pkg ), function benchmark( b ) { var buf; var arr; var i; @@ -132,7 +133,7 @@ bench( pkg+'::array,clbk:from', function benchmark( b ) { } }); -bench( pkg+'::iterable:from', opts, function benchmark( b ) { +bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) { var arr; var i; @@ -182,7 +183,7 @@ bench( pkg+'::iterable:from', opts, function benchmark( b ) { } }); -bench( pkg+'::iterable,clbk:from:', opts, function benchmark( b ) { +bench( format( '%s::iterable,clbk:from:', pkg ), opts, function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.js index b709e50ca208..0a73a05b31f1 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':includes', function benchmark( b ) { +bench( format( '%s:includes', pkg ), function benchmark( b ) { var bool; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.length.js index d6ff5c71fb7f..a8857b457587 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.includes.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':includes:len='+len, f ); + bench( format( '%s:includes:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.js index 8cb378320567..85a04447bed4 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':indexOf', function benchmark( b ) { +bench( format( '%s:indexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.length.js index 9b55a7f8ead6..826a69bee41a 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':indexOf:len='+len, f ); + bench( format( '%s:indexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.js index ee4ac6254824..40b3087e931f 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':join', function benchmark( b ) { +bench( format( '%s:join', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.length.js index 7b7c9d89fdf5..dcb66a59fc31 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.join.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':join:len='+len, f ); + bench( format( '%s:join:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.keys.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.keys.js index 9f472e0b5d47..ec0643412e7b 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.keys.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.keys.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':keys', function benchmark( b ) { +bench( format( '%s:keys', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.js index 97746402a0cf..2fd65f57a19d 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':lastIndexOf', function benchmark( b ) { +bench( format( '%s:lastIndexOf', pkg ), function benchmark( b ) { var out; var arr; var v; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.length.js index e509fd027c2a..ac1d556a40cc 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.last_index_of.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':lastIndexOf:len='+len, f ); + bench( format( '%s:lastIndexOf:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.length.js index faf73d883c40..2938f4d8c7fe 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ctor = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.js index a28681c855e4..a1ffd91ab920 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':map', function benchmark( b ) { +bench( format( '%s:map', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':map', function benchmark( b ) { } }); -bench( pkg+'::this_context:map', function benchmark( b ) { +bench( format( '%s::this_context:map', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.length.js index 40011ea58bac..8c00a3c1ae58 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.map.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':map:len='+len, f ); + bench( format( '%s:map:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.of.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.of.js index 41b32ac8a314..5107dee49e78 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.of.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.of.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':of', function benchmark( b ) { +bench( format( '%s:of', pkg ), function benchmark( b ) { var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.properties.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.properties.js index ca8f308cea44..32034d1bbcf2 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.properties.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.properties.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' ); var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+'::get:buffer', function benchmark( b ) { +bench( format( '%s::get:buffer', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -52,7 +53,7 @@ bench( pkg+'::get:buffer', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteLength', function benchmark( b ) { +bench( format( '%s::get:byteLength', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -75,7 +76,7 @@ bench( pkg+'::get:byteLength', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:byteOffset', function benchmark( b ) { +bench( format( '%s::get:byteOffset', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -98,7 +99,7 @@ bench( pkg+'::get:byteOffset', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { +bench( format( '%s::get:BYTES_PER_ELEMENT', pkg ), function benchmark( b ) { var arr; var v; var i; @@ -121,7 +122,7 @@ bench( pkg+'::get:BYTES_PER_ELEMENT', function benchmark( b ) { b.end(); }); -bench( pkg+'::get:length', function benchmark( b ) { +bench( format( '%s::get:length', pkg ), function benchmark( b ) { var arr; var v; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.js index b28a5ddb1b49..5772a8338058 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':reduce', function benchmark( b ) { +bench( format( '%s:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduce', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduce', function benchmark( b ) { +bench( format( '%s::initial_value:reduce', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.length.js index eb3e2e507c8f..16e8f7faec4a 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduce:len='+len, f ); + bench( format( '%s:reduce:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.js index 0e2cefa21289..6f727974fa4c 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':reduceRight', function benchmark( b ) { +bench( format( '%s:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; @@ -53,7 +54,7 @@ bench( pkg+':reduceRight', function benchmark( b ) { } }); -bench( pkg+'::initial_value:reduceRight', function benchmark( b ) { +bench( format( '%s::initial_value:reduceRight', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.length.js index cd48ec9e8c82..fe1bc2bd6bf9 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reduce_right.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reduceRight:len='+len, f ); + bench( format( '%s:reduceRight:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.js index 17e6ec0e95bb..bc22800cef21 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':reverse', function benchmark( b ) { +bench( format( '%s:reverse', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.length.js index 6e77be0c79a0..f6328f88c9cf 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.reverse.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':reverse:len='+len, f ); + bench( format( '%s:reverse:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.js index f4076722bf60..9e15eeff0fc8 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+'::array:set', function benchmark( b ) { +bench( format( '%s::array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; @@ -60,7 +61,7 @@ bench( pkg+'::array:set', function benchmark( b ) { b.end(); }); -bench( pkg+'::typed_array:set', function benchmark( b ) { +bench( format( '%s::typed_array:set', pkg ), function benchmark( b ) { var values; var buf; var arr; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.length.js index 8aa8938813b0..7fb9ee000484 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.set.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); + bench( format( '%s:set:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.js index d1e0cda9ac5d..1dd48a7c288e 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':slice', function benchmark( b ) { +bench( format( '%s:slice', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.length.js index 82e5f69152e0..696201839066 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.slice.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':slice:len='+len, f ); + bench( format( '%s:slice:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.js index ad545e25e680..9fa523f458a9 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':some', function benchmark( b ) { +bench( format( '%s:some', pkg ), function benchmark( b ) { var bool; var arr; var i; @@ -54,7 +55,7 @@ bench( pkg+':some', function benchmark( b ) { } }); -bench( pkg+'::this_context:some', function benchmark( b ) { +bench( format( '%s::this_context:some', pkg ), function benchmark( b ) { var bool; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.length.js index 79f4623f1b4b..cbb7ed8456f3 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.some.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':some:len='+len, f ); + bench( format( '%s:some:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.js index 291a17351033..c65f47da6357 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var randi = require( '@stdlib/random/base/randi' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':sort', function benchmark( b ) { +bench( format( '%s:sort', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.length.js index cc51978659d5..d9767d1cb625 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.sort.length.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var randi = require( '@stdlib/random/base/randi' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':sort:len='+len, f ); + bench( format( '%s:sort:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.js index 6fac854ff905..ba414f348821 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.js @@ -22,13 +22,14 @@ var bench = require( '@stdlib/bench' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':subarray', function benchmark( b ) { +bench( format( '%s:subarray', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.length.js index 70c5d0c4cb60..b6a8106bb301 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.subarray.length.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':subarray:len='+len, f ); + bench( format( '%s:subarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.js index d214048edb6a..d579284acd33 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':toLocaleString', function benchmark( b ) { +bench( format( '%s:toLocaleString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.length.js index 0963f1db0ac3..3fe31dd1e70c 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_locale_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toLocaleString:len='+len, f ); + bench( format( '%s:toLocaleString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.js index 0eb5fa464e97..05326241f495 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':toString', function benchmark( b ) { +bench( format( '%s:toString', pkg ), function benchmark( b ) { var out; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.length.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.length.js index d0eaa01f2116..025cefa86d28 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.length.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.to_string.length.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); @@ -87,7 +88,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); + bench( format( '%s:toString:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.values.js b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.values.js index 64345b080222..95f7d17e0fb7 100644 --- a/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.values.js +++ b/lib/node_modules/@stdlib/array/uint8c/benchmark/benchmark.values.js @@ -21,13 +21,14 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var Uint8ClampedArray = require( './../lib' ); // MAIN // -bench( pkg+':values', function benchmark( b ) { +bench( format( '%s:values', pkg ), function benchmark( b ) { var iter; var arr; var i; diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.js index 22039e672094..ed95f287c50f 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -52,7 +53,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=float64', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -74,7 +75,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=float32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -96,7 +97,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex128', function benchmark( b ) { +bench( format( '%s:dtype=complex128', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -118,7 +119,7 @@ bench( pkg+':dtype=complex128', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex64', function benchmark( b ) { +bench( format( '%s:dtype=complex64', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -140,7 +141,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=int32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -162,7 +163,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=uint32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -184,7 +185,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=int16', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -206,7 +207,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=uint16', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -228,7 +229,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=int8', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -250,7 +251,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=uint8', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -272,7 +273,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=uint8c', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -294,7 +295,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=generic', function benchmark( b ) { +bench( format( '%s:dtype=generic', pkg ), function benchmark( b ) { var arr; var x; var i; diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex128.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex128.js index 1957676456a1..18cf60e3ff49 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex128.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex128.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex128,len='+len, f ); + bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex64.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex64.js index b9e0ebb51060..c438b1abdb30 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex64.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.complex64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex64,len='+len, f ); + bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float32.js index 460a96aee36e..85c8510a9f85 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=float32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float64.js index c22df2479ac8..77ad9ad5daa9 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.float64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=float64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.generic.js index 5f6fccabf65e..b19f713b36eb 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.generic.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.generic.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int16.js index 0864f3b4e09f..117d6a858d33 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=int16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int32.js index 96c061dfa29b..2b612f50c169 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=int32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int8.js index 08fef1407709..ca02aa88b71e 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.int8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=int8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint16.js index 704670a38309..151c759f6d13 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=uint16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint32.js index 86aca5524735..cb64f3ecfaed 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=uint32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8.js index c165cfb98a4c..b2890bda39a0 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=uint8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8c.js index 9ef89af9461a..4928d820dfc5 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/benchmark/benchmark.length.uint8c.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroToLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=uint8c,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to-like/lib/main.js b/lib/node_modules/@stdlib/array/zero-to-like/lib/main.js index 8e3cf24054e7..d5c6cea6a298 100644 --- a/lib/node_modules/@stdlib/array/zero-to-like/lib/main.js +++ b/lib/node_modules/@stdlib/array/zero-to-like/lib/main.js @@ -20,11 +20,20 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var zeroTo = require( '@stdlib/array/zero-to' ); var dtype = require( '@stdlib/array/dtype' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); +// VARIABLES // + +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); + + // MAIN // /** @@ -51,6 +60,11 @@ function zeroToLike( x ) { } if ( arguments.length > 1 ) { dt = arguments[ 1 ]; + if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); + } + } else if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } return zeroTo( x.length, dt ); } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.js index d3f48e0cf83d..80e28cd36c35 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -47,7 +48,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=float64', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -65,7 +66,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=float32', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -83,7 +84,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex128', function benchmark( b ) { +bench( format( '%s:dtype=complex128', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -101,7 +102,7 @@ bench( pkg+':dtype=complex128', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex64', function benchmark( b ) { +bench( format( '%s:dtype=complex64', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -119,7 +120,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=int32', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -137,7 +138,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=uint32', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -155,7 +156,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=int16', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -173,7 +174,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=uint16', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -191,7 +192,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=int8', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -209,7 +210,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=uint8', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -227,7 +228,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=uint8c', pkg ), function benchmark( b ) { var arr; var i; b.tic(); @@ -245,7 +246,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=generic', function benchmark( b ) { +bench( format( '%s:dtype=generic', pkg ), function benchmark( b ) { var arr; var i; b.tic(); diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex128.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex128.js index f33aae512704..a42197727433 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex128.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex128.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex128,len='+len, f ); + bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex64.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex64.js index e466588292de..3f2cdd646a9f 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex64.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.complex64.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex64,len='+len, f ); + bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float32.js index 9bb252d013bd..10048b2d2f54 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=float32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float64.js index e48bda063d39..158fd963ac21 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.float64.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=float64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.generic.js index 73d0ad6ddec1..711d2f6575f2 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.generic.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.generic.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int16.js index b49a5d588861..d60acea63154 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=int16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int32.js index 51f2f53b5d31..6a017da67df4 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=int32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int8.js index d5cb7cbd71a9..709b38856a88 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.int8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=int8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint16.js index 786ea71f5f75..8812949dadcd 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint16.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=uint16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint32.js index 0336f99ce842..922d97e9eea2 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint32.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=uint32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8.js index a9b389a98073..5d0025fbb134 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=uint8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8c.js index ad5ca190b615..a1282d423881 100644 --- a/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/zero-to/benchmark/benchmark.length.uint8c.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zeroTo = require( './../lib' ); @@ -86,7 +87,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=uint8c,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.js index 803ad4f099c6..de4c86716027 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -52,7 +53,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float64', function benchmark( b ) { +bench( format( '%s:dtype=float64', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -74,7 +75,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=float32', function benchmark( b ) { +bench( format( '%s:dtype=float32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -96,7 +97,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex128', function benchmark( b ) { +bench( format( '%s:dtype=complex128', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -118,7 +119,7 @@ bench( pkg+':dtype=complex128', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=complex64', function benchmark( b ) { +bench( format( '%s:dtype=complex64', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -140,7 +141,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int32', function benchmark( b ) { +bench( format( '%s:dtype=int32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -162,7 +163,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint32', function benchmark( b ) { +bench( format( '%s:dtype=uint32', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -184,7 +185,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int16', function benchmark( b ) { +bench( format( '%s:dtype=int16', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -206,7 +207,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint16', function benchmark( b ) { +bench( format( '%s:dtype=uint16', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -228,7 +229,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=int8', function benchmark( b ) { +bench( format( '%s:dtype=int8', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -250,7 +251,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8', function benchmark( b ) { +bench( format( '%s:dtype=uint8', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -272,7 +273,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=uint8c', function benchmark( b ) { +bench( format( '%s:dtype=uint8c', pkg ), function benchmark( b ) { var arr; var x; var i; @@ -294,7 +295,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) { b.end(); }); -bench( pkg+':dtype=generic', function benchmark( b ) { +bench( format( '%s:dtype=generic', pkg ), function benchmark( b ) { var arr; var x; var i; diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex128.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex128.js index c407229fe4d4..5b563a073964 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex128.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex128.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex128,len='+len, f ); + bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex64.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex64.js index ebaed99f7bbb..f7deb6107005 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex64.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.complex64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=complex64,len='+len, f ); + bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float32.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float32.js index f57fe4d6f590..0da3d9c5d938 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float32.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float32,len='+len, f ); + bench( format( '%s:dtype=float32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float64.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float64.js index 4ded3028951a..fe491f188daf 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float64.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.float64.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=float64,len='+len, f ); + bench( format( '%s:dtype=float64,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.generic.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.generic.js index 21ec3aed0aa6..e4898939e33d 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.generic.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.generic.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=generic,len='+len, f ); + bench( format( '%s:dtype=generic,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int16.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int16.js index 9f134451db69..1cfa1187e518 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int16.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int16,len='+len, f ); + bench( format( '%s:dtype=int16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int32.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int32.js index 103d5a3533e2..50af00a8f8b6 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int32.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int32,len='+len, f ); + bench( format( '%s:dtype=int32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int8.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int8.js index 9555ad6ce609..c372385d0e70 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int8.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.int8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=int8,len='+len, f ); + bench( format( '%s:dtype=int8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint16.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint16.js index f13951f87d00..d7c92f763e2d 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint16.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint16.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint16,len='+len, f ); + bench( format( '%s:dtype=uint16,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint32.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint32.js index 930153c2ce45..7e84c84b2d93 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint32.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint32.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint32,len='+len, f ); + bench( format( '%s:dtype=uint32,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8.js index c31f7aa10b1e..0caf525b57c4 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8,len='+len, f ); + bench( format( '%s:dtype=uint8,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8c.js b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8c.js index 314c30092a02..8c5380b4bd80 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8c.js +++ b/lib/node_modules/@stdlib/array/zeros-like/benchmark/benchmark.length.uint8c.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isTypedArray = require( '@stdlib/assert/is-typed-array' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var zerosLike = require( './../lib' ); @@ -88,7 +89,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':dtype=uint8c,len='+len, f ); + bench( format( '%s:dtype=uint8c,len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/array/zeros-like/lib/main.js b/lib/node_modules/@stdlib/array/zeros-like/lib/main.js index 7276f4d6054e..4566b44d8e28 100644 --- a/lib/node_modules/@stdlib/array/zeros-like/lib/main.js +++ b/lib/node_modules/@stdlib/array/zeros-like/lib/main.js @@ -20,9 +20,18 @@ // MODULES // -var format = require( '@stdlib/string/format' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var dtype = require( '@stdlib/array/dtype' ); var zeros = require( '@stdlib/array/zeros' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); + + +// VARIABLES // + +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); // MAIN // @@ -51,6 +60,11 @@ function zerosLike( x ) { } if ( arguments.length > 1 ) { dt = arguments[ 1 ]; + if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); + } + } else if ( !isValidDType( dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Value: `%s`.', join( DTYPES, '", "' ), dt ) ); } return zeros( x.length, dt ); } diff --git a/lib/node_modules/@stdlib/array/zeros/lib/main.js b/lib/node_modules/@stdlib/array/zeros/lib/main.js index fbd8ef6e678a..352585e6df49 100644 --- a/lib/node_modules/@stdlib/array/zeros/lib/main.js +++ b/lib/node_modules/@stdlib/array/zeros/lib/main.js @@ -20,16 +20,21 @@ // MODULES // +var contains = require( '@stdlib/array/base/assert/contains' ).factory; var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; var ctors = require( '@stdlib/array/ctors' ); var gzeros = require( '@stdlib/array/base/zeros' ); +var dtypes = require( '@stdlib/array/dtypes' ); var defaults = require( '@stdlib/array/defaults' ); +var join = require( '@stdlib/array/base/join' ); var format = require( '@stdlib/string/format' ); // VARIABLES // var DEFAULT_DTYPE = defaults.get( 'dtypes.default' ); +var DTYPES = dtypes( 'numeric_and_generic' ); +var isValidDType = contains( DTYPES ); // MAIN // @@ -59,6 +64,9 @@ function zeros( length ) { } if ( arguments.length > 1 ) { dtype = arguments[ 1 ]; + if ( !isValidDType( dtype ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', join( DTYPES, '", "' ), dtype ) ); + } } else { dtype = DEFAULT_DTYPE; } diff --git a/lib/node_modules/@stdlib/assert/has-dataview-support/test/test.js b/lib/node_modules/@stdlib/assert/has-dataview-support/test/test.js index bd567cf5f144..9b2f4c819056 100644 --- a/lib/node_modules/@stdlib/assert/has-dataview-support/test/test.js +++ b/lib/node_modules/@stdlib/assert/has-dataview-support/test/test.js @@ -71,9 +71,9 @@ tape( 'if `DataView` is supported, detection result is `true`', function test( t } out = {}; out.buffer = buf; - out._buffer = new Array( byteLength ); // eslint-disable-line no-underscore-dangle + out._buffer = []; // eslint-disable-line no-underscore-dangle for ( i = 0; i < byteLength; i++ ) { - out._buffer[ i ] = 0; // eslint-disable-line no-underscore-dangle + out._buffer.push( 0 ); // eslint-disable-line no-underscore-dangle } out.byteLength = byteLength; out.byteOffset = byteOffset; diff --git a/lib/node_modules/@stdlib/assert/has-property/examples/index.js b/lib/node_modules/@stdlib/assert/has-property/examples/index.js index 131d9edbddf9..4978a2822bc2 100644 --- a/lib/node_modules/@stdlib/assert/has-property/examples/index.js +++ b/lib/node_modules/@stdlib/assert/has-property/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/assert/is-accessor-array/README.md b/lib/node_modules/@stdlib/assert/is-accessor-array/README.md index 01c7ae37476e..d0812cf079f8 100644 --- a/lib/node_modules/@stdlib/assert/is-accessor-array/README.md +++ b/lib/node_modules/@stdlib/assert/is-accessor-array/README.md @@ -28,7 +28,7 @@ An accessor array is defined as either an [`Array`][mdn-array], [`Typed Array`][ - +
@@ -71,7 +71,7 @@ var bool = isAccessorArray( arr ); ## Examples - + diff --git a/lib/node_modules/@stdlib/assert/is-accessor-array/examples/index.js b/lib/node_modules/@stdlib/assert/is-accessor-array/examples/index.js index 88a9ec4bbdc9..f16f3989c6fe 100644 --- a/lib/node_modules/@stdlib/assert/is-accessor-array/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-accessor-array/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js b/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js index b3232562f791..4b1a656249ee 100644 --- a/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js @@ -74,7 +74,7 @@ bool = isBigUint64Array( new Float32Array( 10 ) ); console.error( bool ); // => false -bool = isBigUint64Array( new Array( 10 ) ); +bool = isBigUint64Array( [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ); console.error( bool ); // => false diff --git a/lib/node_modules/@stdlib/assert/is-capitalized/README.md b/lib/node_modules/@stdlib/assert/is-capitalized/README.md index a619cbef38e2..231472eafd99 100644 --- a/lib/node_modules/@stdlib/assert/is-capitalized/README.md +++ b/lib/node_modules/@stdlib/assert/is-capitalized/README.md @@ -107,6 +107,8 @@ Options:
+ +
@@ -128,8 +130,6 @@ Options: - -
### Examples @@ -139,8 +139,6 @@ $ is-capitalized Beep true ``` -
- To use as a [standard stream][standard-streams], ```bash @@ -156,6 +154,8 @@ false true ``` +
+ diff --git a/lib/node_modules/@stdlib/assert/is-collection/README.md b/lib/node_modules/@stdlib/assert/is-collection/README.md index 917e5d892453..f795b6578b60 100644 --- a/lib/node_modules/@stdlib/assert/is-collection/README.md +++ b/lib/node_modules/@stdlib/assert/is-collection/README.md @@ -28,7 +28,7 @@ A collection is defined as either an [`Array`][mdn-array], [`Typed Array`][mdn-t - +
@@ -55,7 +55,7 @@ var bool = isCollection( [] ); ## Examples - + diff --git a/lib/node_modules/@stdlib/assert/is-collection/examples/index.js b/lib/node_modules/@stdlib/assert/is-collection/examples/index.js index 19370c012c7b..18e3922d3c2c 100644 --- a/lib/node_modules/@stdlib/assert/is-collection/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-collection/examples/index.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable object-curly-newline */ +/* eslint-disable object-curly-newline, stdlib/eol-open-bracket-spacing, stdlib/line-closing-bracket-spacing */ 'use strict'; diff --git a/lib/node_modules/@stdlib/assert/is-domain-name/README.md b/lib/node_modules/@stdlib/assert/is-domain-name/README.md index b977b2f41b1d..e2a2a888400a 100644 --- a/lib/node_modules/@stdlib/assert/is-domain-name/README.md +++ b/lib/node_modules/@stdlib/assert/is-domain-name/README.md @@ -58,7 +58,9 @@ bool = isDomainName( 'foo@bar.com' ); - Validation adheres to [RFC 2181][rfc-2181], which defines the syntax for domain names and stipulates that domain names must be 255 characters or less. - +
+ +
diff --git a/lib/node_modules/@stdlib/assert/is-duration-string/README.md b/lib/node_modules/@stdlib/assert/is-duration-string/README.md index ef825221f69a..bba733f5786c 100644 --- a/lib/node_modules/@stdlib/assert/is-duration-string/README.md +++ b/lib/node_modules/@stdlib/assert/is-duration-string/README.md @@ -178,6 +178,8 @@ false + diff --git a/lib/node_modules/@stdlib/assert/is-email-address/README.md b/lib/node_modules/@stdlib/assert/is-email-address/README.md index 6e4334bcc3f3..b1171c2d9f90 100644 --- a/lib/node_modules/@stdlib/assert/is-email-address/README.md +++ b/lib/node_modules/@stdlib/assert/is-email-address/README.md @@ -56,7 +56,9 @@ var bool = isEmail( 'beep@boop.com' ); - Validation is **not** rigorous, nor [should it be][validate-email-address]. **9** RFCs relate to email addresses, and accounting for all of them is a fool's errand. This module performs the simplest validation; i.e., requiring **at least** one `@` symbol. - For rigorous validation, send a confirmation email. If the email bounces, consider the email invalid. - +
+ +
diff --git a/lib/node_modules/@stdlib/assert/is-empty-collection/test/test.js b/lib/node_modules/@stdlib/assert/is-empty-collection/test/test.js index 65008fa09c6f..8ae21df24ba5 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-collection/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-empty-collection/test/test.js @@ -81,7 +81,7 @@ tape( 'the function returns `false` if not provided an empty collection', functi null, void 0, [ 1, 2, 3 ], - new Array( 10 ), + [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], {}, function noop() {} ]; diff --git a/lib/node_modules/@stdlib/assert/is-negative-zero/benchmark/benchmark.js b/lib/node_modules/@stdlib/assert/is-negative-zero/benchmark/benchmark.js index f1f29385cc05..3841b6921b58 100644 --- a/lib/node_modules/@stdlib/assert/is-negative-zero/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/assert/is-negative-zero/benchmark/benchmark.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */ +/* eslint-disable no-undefined, no-empty-function */ 'use strict'; diff --git a/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/benchmark/benchmark.js b/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/benchmark/benchmark.js index c89da004202e..467b37a96ec5 100644 --- a/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/assert/is-nonpositive-number-array/benchmark/benchmark.js @@ -50,7 +50,7 @@ function createBenchmark( fcn, len, primitives ) { } } else { for ( i = 0; i < len; i++ ) { - x.push( new Number( -1.0 ) ); // eslint-disable-line no-new-wrappers + x.push( new Number( -1.0 ) ); } } return benchmark; diff --git a/lib/node_modules/@stdlib/assert/is-pascalcase/README.md b/lib/node_modules/@stdlib/assert/is-pascalcase/README.md index 2c816747b526..90422ca3b84e 100644 --- a/lib/node_modules/@stdlib/assert/is-pascalcase/README.md +++ b/lib/node_modules/@stdlib/assert/is-pascalcase/README.md @@ -107,6 +107,8 @@ Options:
+ +
@@ -128,8 +130,6 @@ Options: - -
### Examples @@ -139,8 +139,6 @@ $ is-pascalcase Beep true ``` -
- To use as a [standard stream][standard-streams], ```bash @@ -156,6 +154,8 @@ false true ``` +
+ diff --git a/lib/node_modules/@stdlib/assert/is-snakecase/README.md b/lib/node_modules/@stdlib/assert/is-snakecase/README.md index 1d4fcf4f4e88..57b077529fd3 100644 --- a/lib/node_modules/@stdlib/assert/is-snakecase/README.md +++ b/lib/node_modules/@stdlib/assert/is-snakecase/README.md @@ -107,6 +107,8 @@ Options: + +
@@ -128,8 +130,6 @@ Options: - -
### Examples @@ -139,8 +139,6 @@ $ is-snakecase foo_bar true ``` -
- To use as a [standard stream][standard-streams], ```bash @@ -156,6 +154,8 @@ false true ``` +
+ diff --git a/lib/node_modules/@stdlib/bench/harness/examples/no_benchmark.js b/lib/node_modules/@stdlib/bench/harness/examples/no_benchmark.js index 34da7aba3316..7af848c2084d 100644 --- a/lib/node_modules/@stdlib/bench/harness/examples/no_benchmark.js +++ b/lib/node_modules/@stdlib/bench/harness/examples/no_benchmark.js @@ -25,4 +25,4 @@ var bench = require( './../lib' ); bench( 'beep' ); bench( 'boop' ); bench( 'foo', {} ); -bench( 'bar', { 'skip': false } ); +bench( 'bar', { 'skip': false } ); // eslint-disable-line stdlib/line-closing-bracket-spacing diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js index 26764f6febd6..917ea2fe5ea2 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js @@ -27,6 +27,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var caxpy = require( './../lib/caxpy.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js index 382409abf439..1969a602cf89 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js index 85f5d25d4bf6..8e57c331e5b5 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var caxpy = require( './../lib/ndarray.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js index df92020cfa39..e1f65fafd45c 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.js index 8cec4ce5f6e3..821c3a83c309 100644 --- a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib/ccopy.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.native.js index 6c4e99a041f7..6cb84989a92f 100644 --- a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.js index 2a96afec67ec..907557ed02e7 100644 --- a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib/ndarray.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.native.js index c539cc9a2ab1..09ec3ec39287 100644 --- a/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/ccopy/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.js index 5ba13a2efe57..a3bb3ed653a7 100644 --- a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib/csrot.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.native.js index 4716c87325e7..30ea59c410e3 100644 --- a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.js index 617ce0e69564..91bc77f9e085 100644 --- a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib/ndarray.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.native.js index 02e4db88f5ff..5536180d185d 100644 --- a/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/csrot/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.js index dee197c7b13f..3b9ec0afe9c7 100644 --- a/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csscal = require( './../lib/csscal.js' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.ndarray.js index 38daa8f164c6..90ce8e9495b5 100644 --- a/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/csscal/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csscal = require( './../lib/ndarray.js' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.js index c519ed4a0048..782876fcde2c 100644 --- a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cswap = require( './../lib/cswap.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.native.js index 250ed05090ee..5425744493e8 100644 --- a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.js index 20f2c80d603c..05cd6505e0b1 100644 --- a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cswap = require( './../lib/ndarray.js' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.native.js index 94336267dc0c..44d27adab4fa 100644 --- a/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cswap/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -113,7 +114,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.js index 6c9a975b2f7d..ae40757b107a 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib/dasum.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.native.js index 1020ba258344..e01a8b1cfaa1 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.js index b59cffa08532..5c56cad2d16a 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.native.js index 935efd7b9885..2b396d84a62f 100644 --- a/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dasum/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.js index 1d025ad7d2ba..52d4ea3932db 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib/daxpy.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.native.js index e28d6b92bec8..0031e6e868d5 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.js index 358932112d2c..eca4239006cc 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.native.js index 4ded04c3acfa..4267ac32191e 100644 --- a/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/daxpy/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ddot/src/ddot_cblas.c b/lib/node_modules/@stdlib/blas/base/ddot/src/ddot_cblas.c index c77635695512..57ae6e62b299 100644 --- a/lib/node_modules/@stdlib/blas/base/ddot/src/ddot_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/ddot/src/ddot_cblas.c @@ -50,5 +50,5 @@ double API_SUFFIX(c_ddot)( const CBLAS_INT N, const double *X, const CBLAS_INT s double API_SUFFIX(c_ddot_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer Y += stdlib_strided_min_view_buffer_index( N, strideY, offsetY ); // adjust array pointer - return API_SUFFIX(cblas_ddot_ndarray)( N, X, strideX, Y, strideY ); + return API_SUFFIX(cblas_ddot)( N, X, strideX, Y, strideY ); } diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/README.md b/lib/node_modules/@stdlib/blas/base/dgemm/README.md index b8bd1feb27e0..377c6b7ee422 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dgemm/README.md @@ -55,12 +55,12 @@ The function has the following parameters: - **K**: number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)`. - **α**: scalar constant. - **A**: first input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. -- **lda**: stride of the first dimension of `A` (leading dimension of `A`). +- **lda**: stride between successive contiguous vectors of the matrix `A` (a.k.a., leading dimension of `A`). - **B**: second input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. -- **ldb**: stride of the first dimension of `B` (leading dimension of `B`). +- **ldb**: stride between successive contiguous vectors of the matrix `B` (a.k.a., leading dimension of `B`). - **β**: scalar constant. - **C**: third input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. -- **ldc**: stride of the first dimension of `C` (leading dimension of `C`). +- **ldc**: stride between successive contiguous vectors of the matrix `C` (a.k.a., leading dimension of `C`). The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dgemm/docs/repl.txt index 15c3bb9bbdf7..6ea7dfe0af1a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dgemm/docs/repl.txt @@ -43,15 +43,15 @@ First matrix. lda: integer - Stride of the first dimension of `A` (a.k.a., leading dimension of the - matrix `A`). + Stride between successive contiguous vectors of the matrix `A` (a.k.a., + leading dimension of the matrix `A`). B: Float64Array Second matrix. ldb: integer - Stride of the first dimension of `B` (a.k.a., leading dimension of the - matrix `B`). + Stride between successive contiguous vectors of the matrix `B` (a.k.a., + leading dimension of the matrix `B`). β: number Scalar constant. @@ -60,8 +60,8 @@ Third matrix. ldc: integer - Stride of the first dimension of `C` (a.k.a., leading dimension of the - matrix `C`). + Stride between successive contiguous vectors of the matrix `C` (a.k.a., + leading dimension of the matrix `C`). Returns ------- diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dgemm/docs/types/index.d.ts index a84449deee19..c808df159da2 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dgemm/docs/types/index.d.ts @@ -37,12 +37,12 @@ interface Routine { * @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` * @param alpha - scalar constant * @param A - first matrix - * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param LDA - stride between successive contiguous vectors of the matrix `A` (a.k.a., leading dimension of the matrix `A`) * @param B - second matrix - * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) + * @param LDB - stride between successive contiguous vectors of the matrix `B` (a.k.a., leading dimension of the matrix `B`) * @param beta - scalar constant * @param C - third matrix - * @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) + * @param LDC - stride between successive contiguous vectors of the matrix `C` (a.k.a., leading dimension of the matrix `C`) * @returns `C` * * @example @@ -105,12 +105,12 @@ interface Routine { * @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` * @param alpha - scalar constant * @param A - first matrix -* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param LDA - stride between successive contiguous vectors of the matrix `A` (a.k.a., leading dimension of the matrix `A`) * @param B - second matrix -* @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param LDB - stride between successive contiguous vectors of the matrix `B` (a.k.a., leading dimension of the matrix `B`) * @param beta - scalar constant * @param C - third matrix -* @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param LDC - stride between successive contiguous vectors of the matrix `C` (a.k.a., leading dimension of the matrix `C`) * @returns `C` * * @example diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js index eedda5fe03b2..6bb253c98777 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js @@ -42,12 +42,12 @@ var base = require( './base.js' ); * @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` * @param {number} alpha - scalar constant * @param {Float64Array} A - first matrix -* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {PositiveInteger} LDA - stride between successive contiguous vectors of the matrix `A` (a.k.a., leading dimension of the matrix `A`) * @param {Float64Array} B - second matrix -* @param {PositiveInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param {PositiveInteger} LDB - stride between successive contiguous vectors of the matrix `B` (a.k.a., leading dimension of the matrix `B`) * @param {number} beta - scalar constant * @param {Float64Array} C - third matrix -* @param {PositiveInteger} LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param {PositiveInteger} LDC - stride between successive contiguous vectors of the matrix `C` (a.k.a., leading dimension of the matrix `C`) * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must be a valid transpose operation * @throws {TypeError} third argument must be a valid transpose operation @@ -95,7 +95,7 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', M ) ); } if ( N < 0 ) { - throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', M ) ); + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); } if ( K < 0 ) { throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', K ) ); diff --git a/lib/node_modules/@stdlib/blas/base/dgemv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dgemv/test/test.ndarray.js index 8b239302273c..0687216267e0 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dgemv/test/test.ndarray.js @@ -44,7 +44,6 @@ var cxpyp = require( './fixtures/column_major_xpyp.json' ); var cx = require( './fixtures/column_major_x_zeros.json' ); var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); var ca = require( './fixtures/column_major_alpha_zero.json' ); - var rap = require( './fixtures/row_major_complex_access_pattern.json' ); var rnt = require( './fixtures/row_major_nt.json' ); var rt = require( './fixtures/row_major_t.json' ); diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/benchmark/benchmark.js index e0aff4b8bd3e..27573a99a964 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-enum/benchmark/benchmark.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/benchmark/benchmark.js index c6b8be8d66fe..b6d5e97ccb0c 100644 --- a/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/diagonal-type-resolve-str/benchmark/benchmark.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.js index a8e0a7fc12e0..75d085cc3bf0 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib/dnrm2.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.native.js index 0033925a7c84..4fc0783d47b8 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.js index b13544e179df..3ff89af84df9 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.native.js index a5d7e32c41c9..9e6933b5d9ce 100644 --- a/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dnrm2/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts index 9d39f6416085..855c6d22d5aa 100644 --- a/lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts @@ -83,6 +83,7 @@ import matrixTriangleResolveEnum = require( '@stdlib/blas/base/matrix-triangle-r import matrixTriangleResolveStr = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); import matrixTriangleStr2Enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); import matrixTriangles = require( '@stdlib/blas/base/matrix-triangles' ); +import ndarray = require( '@stdlib/blas/base/ndarray' ); import operationSideEnum2Str = require( '@stdlib/blas/base/operation-side-enum2str' ); import operationSideResolveEnum = require( '@stdlib/blas/base/operation-side-resolve-enum' ); import operationSideResolveStr = require( '@stdlib/blas/base/operation-side-resolve-str' ); @@ -1705,6 +1706,11 @@ interface Namespace { */ matrixTriangles: typeof matrixTriangles; + /** + * Base ndarray BLAS functions. + */ + ndarray: typeof ndarray; + /** * Returns the BLAS operation side string associated with a BLAS operation side enumeration constant. * diff --git a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.js index 826cd264b4ba..fd33dbc532c1 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.native.js index 222070618266..e3dbedacb8e3 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.js index 3d1ad0194561..47231cd5955c 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.native.js index f4429833da3c..fade054733e5 100644 --- a/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dscal/benchmark/benchmark.ndarray.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.js index 690eb21ff9d7..f2091d12620a 100644 --- a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.native.js index c6c29c99f694..a87374ee08da 100644 --- a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.js index 1400ca59ad72..67ed3fd816ba 100644 --- a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.native.js index 73dbeb8a6cec..2103642a9ab3 100644 --- a/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsdot/benchmark/benchmark.ndarray.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.js index 7a27e9cbf7ab..6ccfe2d3bac0 100644 --- a/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.ndarray.js index a28774630047..f9674ca3fc07 100644 --- a/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dspmv/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:ndarray:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.js index b58be056c17f..6280d7c598f5 100644 --- a/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.ndarray.js index e551208abd39..e711c27c5854 100644 --- a/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dspr/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:ndarray:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.js index 8fdf905f6ffa..8f38466ff199 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.native.js index 8f036687ab09..9abbfed62a63 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.js index 2d0130ae23cb..863f7b0def0b 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.native.js index 86f7db80f5f4..b00cdbcd85d5 100644 --- a/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dswap/benchmark/benchmark.ndarray.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.js index 3268a80cf94b..9cb745717f88 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js index b612f6e7c380..b149883696f7 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js index 4dbc0ae345b7..c82374cd695d 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js @@ -41,7 +41,6 @@ var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); - var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); var cxp = require( './fixtures/column_major_xp.json' ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js index 23ab41fce88b..5c14930cadc1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js @@ -36,7 +36,6 @@ var rxpyp = require( './fixtures/row_major_xpyp.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); var rxnyn = require( './fixtures/row_major_xnyn.json' ); - var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); var cx0 = require( './fixtures/column_major_x0.json' ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js index d0d2fbb1cf89..add088ff5e9c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var format = require( '@stdlib/string/format' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js index 46840080337b..b2eaed070ccd 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var format = require( '@stdlib/string/format' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.js index 4c3cf8cbe0c5..8c7304e711e5 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var format = require( '@stdlib/string/format' ); var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.ndarray.js index 15be75120743..3fd5bfdca84b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsv/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var format = require( '@stdlib/string/format' ); var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js index 262e8cd657c3..1e8020ffd5a1 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib/dznrm2.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js index 65c2eef377ca..c3c48d694709 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js index b18262ce03b1..64cbe4b0bf7c 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib/ndarray.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js index b419ff5d0d2f..336a49b4e1ed 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.js index a9a1619decd5..8f0b9adbd804 100644 --- a/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.ndarray.js index 5afbfaa90a70..5b341c8cb796 100644 --- a/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gasum/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.js index f6906e789f21..50df6ecbc557 100644 --- a/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.ndarray.js index 778f6c0de3cb..2048cfe5651f 100644 --- a/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gdot/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js index af2a8a5d4fb1..aec3335903d7 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js index b0b7721f3e7b..cc449ff6326f 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js index f710c20c44b1..eacb45a0c5c2 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js index b097d1095dfa..bec847a54e65 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js index f414bb1a3c8c..b29c9fabe64d 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js index 05b21e9eaa4f..6684cdc0ace8 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js index 5f3cd21ef12e..92d9764d3b14 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js index 2e7b27739b46..c446dacd8e67 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js index d9c5f87a9450..8a868b5bdbad 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js index c84ed94cc69d..4c6e52622216 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js index 6f633033e5f1..7074250fae4a 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js index a3b76d916044..24c7fc975e66 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js index cba3558ff882..fe705b7044ad 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js index c7f75ab7adbb..3267bdeb908e 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js index 0b4c69861fdb..41d8c3c49dc2 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js index 2d347b99194b..0e66cd004503 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_ntb.js index c6cb13e18255..2b1b5461ed89 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_tb.js index 3623f431d34d..70628b755f86 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_nta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_ntb.js index f4f6dd01ca03..5efc7216723f 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_tb.js index 0fe24dd7a257..dc4acf4f0e20 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_column_major_ta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js index 6c3bfe868832..e26e4ff34fca 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js index ab78935115cb..b022e5f785a3 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js index 4c1064a54eef..39449c31e95e 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js index a2003238c094..1beb3e052cd7 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js index 8ed793d66b06..8292dfe5a803 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js index ddc08394861e..637126089d91 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js index d9c9c1b4d889..121de60621a5 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js index 00d085d30c4c..2d8e68fd095f 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js index 879e3d9a5c3b..73ba96641ec2 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js index 4793876bf1b6..e70e2429e0c5 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js index 9712f5f9a175..d552d54850af 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js index 699d50afd7ea..173fe9ab5163 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js index b29fb949d5e9..79c25048815c 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js index ab919162f6b9..7295d5f7c33d 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js index 59c7ba7402c7..d2596e3d0a28 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js index 522bec1655ac..3c857d8adf83 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_ntb.js index 28ebff86682c..a37f1365cffe 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_tb.js index 0b1d39c24e2a..ad3d12f2ec53 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_nta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_ntb.js index 38cf7c6dc349..256e64be1353 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_tb.js index 597a1ec186e9..0dd5572c35d4 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/benchmark/benchmark_row_major_ta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ggemm = require( './../lib' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.js index 893b7a39b36b..9949f53db38b 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -80,6 +81,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -93,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.ndarray.js index b29b26aa7dec..6a3f5229bba8 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ggemv/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -80,6 +81,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -93,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.js index 40b7fe09ab7d..c19ba91c1c66 100644 --- a/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -80,6 +81,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -93,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.ndarray.js index c0162906a424..74d2d93b5fb9 100644 --- a/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gger/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -80,6 +81,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -93,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.js index 2dee29443116..5d87178e7cd5 100644 --- a/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.ndarray.js index c598d5840dd0..5e42db0cb7e0 100644 --- a/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gnrm2/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.js index 8fd62d843a13..a5160762d4de 100644 --- a/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.ndarray.js index 45b8d05aa4d2..f72fda91f8eb 100644 --- a/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gscal/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.js index f752a32fd9d2..02df1aa4f293 100644 --- a/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.ndarray.js index 6bc064d5f7ab..0d2c8f5a42d5 100644 --- a/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gswap/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.js index 8b4b23086c1b..1f7cf97fd772 100644 --- a/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -79,6 +80,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -92,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.ndarray.js index 0f6d355e8065..9d7f3d96e30b 100644 --- a/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); @@ -79,6 +80,11 @@ function createBenchmark( N ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var min; var max; @@ -92,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.js index d6f878f64857..e87b4cf2464f 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.native.js index 1db2678ab8e6..01eff24cadc8 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.js index 294297bf3814..8ba3bcaa24b2 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.native.js index 4e04fd028703..1f274ab10510 100644 --- a/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/idamax/benchmark/benchmark.ndarray.native.js @@ -23,6 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.js index a2fbd3d9155b..46e62661efbe 100644 --- a/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.ndarray.js index e4a26b9114da..5717d45424dc 100644 --- a/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/igamax/benchmark/benchmark.ndarray.js @@ -22,6 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var pkg = require( './../package.json' ).name; @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.js index becf6f216b74..1f229a9807c5 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var isamax = require( './../lib/isamax.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.native.js index 042f70076a3b..82a86bbd4764 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.js index 4e58ddee51ae..2538a74122b4 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var isamax = require( './../lib/ndarray.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.native.js index 703203c05895..d1436ad4cdd8 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js b/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js index a758db12f425..a74c00f9215f 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js @@ -66,13 +66,13 @@ tape( 'the function finds the index of the element with the maximum absolute val idx = isamax( 4, x, 1 ); t.strictEqual( idx, expected, 'returns expected value' ); - x = new Float32Array( [ + x = new Float32Array([ 0.2, // 1 -0.6, // 2 0.3, // 3 5.0, 5.0 - ] ); + ]); expected = 1; idx = isamax( 3, x, 1 ); @@ -86,11 +86,11 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', o var idx; var x; - x = new Float32Array( [ + x = new Float32Array([ 1.0, 2.0, 3.0 - ] ); + ]); expected = -1; idx = isamax( 0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/benchmark/benchmark.js index d4991566022d..b830ca1bda2b 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/layout-resolve-enum/benchmark/benchmark.js @@ -21,6 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); var pkg = require( './../package.json' ).name; @@ -29,7 +30,7 @@ var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/layout-resolve-str/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/layout-resolve-str/benchmark/benchmark.js index 5864598759dd..99627a253079 100644 --- a/lib/node_modules/@stdlib/blas/base/layout-resolve-str/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/layout-resolve-str/benchmark/benchmark.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/lib/index.js b/lib/node_modules/@stdlib/blas/base/lib/index.js index b63ddb3bf93d..7c7a5968ff35 100644 --- a/lib/node_modules/@stdlib/blas/base/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/lib/index.js @@ -612,6 +612,15 @@ setReadOnly( blas, 'matrixTriangleStr2Enum', require( '@stdlib/blas/base/matrix- */ setReadOnly( blas, 'matrixTriangles', require( '@stdlib/blas/base/matrix-triangles' ) ); +/** +* @name ndarray +* @memberof blas +* @readonly +* @type {Namespace} +* @see {@link module:@stdlib/blas/base/ndarray} +*/ +setReadOnly( blas, 'ndarray', require( '@stdlib/blas/base/ndarray' ) ); + /** * @name operationSideEnum2Str * @memberof blas diff --git a/lib/node_modules/@stdlib/blas/base/matrix-orientation-resolve-str/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/matrix-orientation-resolve-str/benchmark/benchmark.js index 55f35e4ef87a..8b98752e305c 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-orientation-resolve-str/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/matrix-orientation-resolve-str/benchmark/benchmark.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/matrix-orientation-str2enum' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/benchmark/benchmark.js index d69a10e8393d..512fbc82bdee 100644 --- a/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/matrix-triangle-resolve-str/benchmark/benchmark.js @@ -23,13 +23,14 @@ var bench = require( '@stdlib/bench' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var resolve = require( './../lib' ); // MAIN // -bench( pkg+'::string', function benchmark( b ) { +bench( format( '%s::string', pkg ), function benchmark( b ) { var values; var out; var i; @@ -54,7 +55,7 @@ bench( pkg+'::string', function benchmark( b ) { b.end(); }); -bench( pkg+'::integer', function benchmark( b ) { +bench( format( '%s::integer', pkg ), function benchmark( b ) { var values; var out; var i; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/README.md b/lib/node_modules/@stdlib/blas/base/ndarray/README.md new file mode 100644 index 000000000000..f29b88ecb016 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/README.md @@ -0,0 +1,112 @@ + + +# Base + +> Base ndarray BLAS functions. + +
+ +## Usage + +```javascript +var ns = require( '@stdlib/blas/base/ndarray' ); +``` + +#### ns + +Namespace containing base ndarray BLAS functions. + +```javascript +var o = ns; +// returns {...} +``` + +The namespace exposes the following APIs: + + + +
+ +- [`dasum( arrays )`][@stdlib/blas/base/ndarray/dasum]: calculate the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. +- [`ddot( arrays )`][@stdlib/blas/base/ndarray/ddot]: calculate the dot product of two one-dimensional double-precision floating-point ndarrays. +- [`gasum( arrays )`][@stdlib/blas/base/ndarray/gasum]: calculate the sum of absolute values for all elements in a one-dimensional ndarray. +- [`gdot( arrays )`][@stdlib/blas/base/ndarray/gdot]: calculate the dot product of two one-dimensional ndarrays. +- [`sasum( arrays )`][@stdlib/blas/base/ndarray/sasum]: calculate the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. +- [`sdot( arrays )`][@stdlib/blas/base/ndarray/sdot]: calculate the dot product of two one-dimensional single-precision floating-point ndarrays. + +
+ + + +
+ + + +
+ +## Examples + + + + + +```javascript +var objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( '@stdlib/blas/base/ndarray' ); + +console.log( objectKeys( ns ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/README.md b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/README.md new file mode 100644 index 000000000000..9dc08c7c6dd4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/README.md @@ -0,0 +1,127 @@ + + +# dasum + +> Calculate the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. + +
+ +The [_L1_ norm][l1norm] is defined as + + + +```math +\|\mathbf{x}\|_1 = \sum_{i=0}^{n-1} \vert x_i \vert +``` + + + + + +
+ + + +
+ +## Usage + +```javascript +var dasum = require( '@stdlib/blas/base/ndarray/dasum' ); +``` + +#### dasum( arrays ) + +Computes the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + +var y = dasum( [ x ] ); +// returns 15.0 +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var dasum = require( '@stdlib/blas/base/ndarray/dasum' ); + +var opts = { + 'dtype': 'float64' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = dasum( [ x ] ); +console.log( out ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/benchmark/benchmark.js new file mode 100644 index 000000000000..8a4ef4422fbc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/benchmark/benchmark.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dasum = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len, -100.0, 100.0, options ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dasum( [ x ] ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/img/equation_l1norm.svg b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/img/equation_l1norm.svg new file mode 100644 index 000000000000..4dbb928da546 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/img/equation_l1norm.svg @@ -0,0 +1,44 @@ + +double-vertical-bar bold x double-vertical-bar Subscript 1 Baseline equals sigma-summation Underscript i equals 0 Overscript n minus 1 Endscripts StartAbsoluteValue x Subscript i Baseline EndAbsoluteValue + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/repl.txt new file mode 100644 index 000000000000..3ae9fff65a0d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Computes the sum of absolute values for all elements in a one-dimensional + double-precision floating-point ndarray. + + If provided an empty input ndarray, the function returns `0.0`. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: number + The sum of absolute values. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + > var dt = 'float64'; + > var sh = [ xbuf.length ]; + > var st = [ 1 ]; + > var oo = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, st, oo, ord ); + > {{alias}}( [ x ] ) + 15.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/index.d.ts new file mode 100644 index 000000000000..ee11f1ec1fd8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/index.d.ts @@ -0,0 +1,46 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { float64ndarray } from '@stdlib/types/ndarray'; + +/** +* Computes the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns sum +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = dasum( [ x ] ); +* // returns 15.0 +*/ +declare function dasum( arrays: [ float64ndarray ] ): number; + + +// EXPORTS // + +export = dasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/test.ts new file mode 100644 index 000000000000..537c34ce200b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import dasum = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + + dasum( [ x ] ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + dasum( '10' ); // $ExpectError + dasum( 10 ); // $ExpectError + dasum( true ); // $ExpectError + dasum( false ); // $ExpectError + dasum( null ); // $ExpectError + dasum( undefined ); // $ExpectError + dasum( [] ); // $ExpectError + dasum( {} ); // $ExpectError + dasum( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + + dasum(); // $ExpectError + dasum( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/examples/index.js new file mode 100644 index 000000000000..24eae860b500 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var dasum = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = dasum( [ x ] ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/index.js new file mode 100644 index 000000000000..38f71c43554d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/index.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 1 routine to compute the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. +* +* @module @stdlib/blas/base/ndarray/dasum +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var dasum = require( '@stdlib/blas/base/ndarray/dasum' ); +* +* var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = dasum( [ x ] ); +* // returns 15.0 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/main.js b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/main.js new file mode 100644 index 000000000000..f36a3bda9be7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/lib/main.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/base/dasum' ).ndarray; + + +// MAIN // + +/** +* Computes the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {number} sum +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = dasum( [ x ] ); +* // returns 15.0 +*/ +function dasum( arrays ) { + var x = arrays[ 0 ]; + return strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/package.json b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/package.json new file mode 100644 index 000000000000..6e1f3649fd48 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/blas/base/ndarray/dasum", + "version": "0.0.0", + "description": "Compute the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 1", + "linear", + "algebra", + "subroutines", + "dasum", + "sasum", + "asum", + "sum", + "absolute", + "absolute value", + "norm", + "vector", + "ndarray" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/dasum/test/test.js b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/test/test.js new file mode 100644 index 000000000000..d416ac8b809b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/dasum/test/test.js @@ -0,0 +1,154 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var dasum = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Collection} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'float64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dasum, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( dasum.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function calculates the sum of absolute values for all elements in a one-dimensional ndarray', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + x = vector( xbuf, 5, 1, 0 ); + y = dasum( [ x ] ); + + t.strictEqual( y, 15.0, 'returns expected value' ); + + xbuf = new Float64Array( [ -4.0, -2.0 ] ); + x = vector( xbuf, 2, 1, 0 ); + y = dasum( [ x ] ); + + t.strictEqual( y, 6.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an empty ndarray, the function returns `0.0`', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float64Array( [] ); + x = vector( xbuf, 0, 1, 0 ); + + y = dasum( [ x ] ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float64Array([ + 1.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + x = vector( xbuf, 3, 2, 0 ); + + y = dasum( [ x ] ); + t.strictEqual( y, 12.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float64Array([ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]); + x = vector( xbuf, 3, -2, 4 ); + + y = dasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float64Array([ + 2.0, + 1.0, // 0 + 2.0, + -2.0, // 1 + -2.0, + 2.0, // 2 + 3.0, + 4.0 // 3 + ]); + x = vector( xbuf, 4, 2, 1 ); + + y = dasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/index.d.ts new file mode 100644 index 000000000000..db43a8ae4b05 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/index.d.ts @@ -0,0 +1,158 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/* eslint-disable max-lines */ + +import dasum = require( '@stdlib/blas/base/ndarray/dasum' ); +import ddot = require( '@stdlib/blas/base/ndarray/ddot' ); +import gasum = require( '@stdlib/blas/base/ndarray/gasum' ); +import gdot = require( '@stdlib/blas/base/ndarray/gdot' ); +import sasum = require( '@stdlib/blas/base/ndarray/sasum' ); +import sdot = require( '@stdlib/blas/base/ndarray/sdot' ); + +/** +* Interface describing the `ndarray` namespace. +*/ +interface Namespace { + /** + * Computes the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var y = ns.dasum( [ x ] ); + * // returns 15.0 + */ + dasum: typeof dasum; + + /** + * Computes the dot product of two one-dimensional double-precision floating-point ndarrays. + * + * @param arrays - array-like object containing two one-dimensional input ndarrays + * @returns dot product + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); + * var y = new ndarray( 'float64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var z = ns.ddot( [ x, y ] ); + * // returns -5.0 + */ + ddot: typeof ddot; + + /** + * Computes the sum of absolute values for all elements in a one-dimensional ndarray. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var y = ns.gasum( [ x ] ); + * // returns 15.0 + */ + gasum: typeof gasum; + + /** + * Computes the dot product of two one-dimensional ndarrays. + * + * @param arrays - array-like object containing two one-dimensional input ndarrays + * @returns dot product + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 4.0, 2.0, -3.0, 5.0, -1.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 2.0, 6.0, -1.0, -4.0, 8.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var z = ns.gdot( [ x, y ] ); + * // returns -5.0 + */ + gdot: typeof gdot; + + /** + * Computes the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var y = ns.sasum( [ x ] ); + * // returns 15.0 + */ + sasum: typeof sasum; + + /** + * Computes the dot product of two one-dimensional single-precision floating-point ndarrays. + * + * @param arrays - array-like object containing two one-dimensional input ndarrays + * @returns dot product + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); + * var y = new ndarray( 'float32', ybuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var z = ns.sdot( [ x, y ] ); + * // returns -5.0 + */ + sdot: typeof sdot; +} + +/** +* Base ndarray BLAS functions. +*/ +declare var ns: Namespace; + + +// EXPORTS // + +export = ns; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/test.ts new file mode 100644 index 000000000000..bbdf4147b91e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/docs/types/test.ts @@ -0,0 +1,29 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 @typescript-eslint/no-unused-expressions */ + +import ns = require( './index' ); + + +// TESTS // + +// The exported value is the expected interface... +{ + ns; // $ExpectType Namespace +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/examples/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/examples/index.js new file mode 100644 index 000000000000..8e89f7039b55 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/examples/index.js @@ -0,0 +1,24 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( './../lib' ); + +console.log( objectKeys( ns ) ); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/README.md b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/README.md new file mode 100644 index 000000000000..a80e58654757 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/README.md @@ -0,0 +1,126 @@ + + +# gasum + +> Calculate the sum of absolute values for all elements in a one-dimensional ndarray. + +
+ +The [_L1_ norm][l1norm] is defined as + + + +```math +\|\mathbf{x}\|_1 = \sum_{i=0}^{n-1} \vert x_i \vert +``` + + + + + +
+ + + +
+ +## Usage + +```javascript +var gasum = require( '@stdlib/blas/base/ndarray/gasum' ); +``` + +#### gasum( arrays ) + +Computes the sum of absolute values for all elements in a one-dimensional ndarray. + +```javascript +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; +var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + +var y = gasum( [ x ] ); +// returns 15.0 +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var gasum = require( '@stdlib/blas/base/ndarray/gasum' ); + +var opts = { + 'dtype': 'generic' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = gasum( [ x ] ); +console.log( out ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/benchmark/benchmark.js new file mode 100644 index 000000000000..f51ac432aff6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/benchmark/benchmark.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gasum = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len, -100.0, 100.0, options ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = gasum( [ x ] ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/img/equation_l1norm.svg b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/img/equation_l1norm.svg new file mode 100644 index 000000000000..4dbb928da546 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/img/equation_l1norm.svg @@ -0,0 +1,44 @@ + +double-vertical-bar bold x double-vertical-bar Subscript 1 Baseline equals sigma-summation Underscript i equals 0 Overscript n minus 1 Endscripts StartAbsoluteValue x Subscript i Baseline EndAbsoluteValue + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/repl.txt new file mode 100644 index 000000000000..0d00c815d75c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Computes the sum of absolute values for all elements in a one-dimensional + ndarray. + + If provided an empty input ndarray, the function returns `0.0`. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: number + The sum of absolute values. + + Examples + -------- + > var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; + > var dt = 'generic'; + > var sh = [ xbuf.length ]; + > var st = [ 1 ]; + > var oo = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, st, oo, ord ); + > {{alias}}( [ x ] ) + 15.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/index.d.ts new file mode 100644 index 000000000000..a04a4ad50ea9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/index.d.ts @@ -0,0 +1,45 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { typedndarray } from '@stdlib/types/ndarray'; + +/** +* Computes the sum of absolute values for all elements in a one-dimensional ndarray. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns sum +* +* @example +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = gasum( [ x ] ); +* // returns 15.0 +*/ +declare function gasum = typedndarray>( arrays: [ T ] ): number; + + +// EXPORTS // + +export = gasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/test.ts new file mode 100644 index 000000000000..a3cf2fa9ffff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import gasum = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = zeros( [ 10 ], { + 'dtype': 'generic' + }); + + gasum( [ x ] ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + gasum( '10' ); // $ExpectError + gasum( 10 ); // $ExpectError + gasum( true ); // $ExpectError + gasum( false ); // $ExpectError + gasum( null ); // $ExpectError + gasum( undefined ); // $ExpectError + gasum( [] ); // $ExpectError + gasum( {} ); // $ExpectError + gasum( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'generic' + }); + + gasum(); // $ExpectError + gasum( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/examples/index.js new file mode 100644 index 000000000000..62a3ebc9ccd3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var gasum = require( './../lib' ); + +var opts = { + 'dtype': 'generic' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = gasum( [ x ] ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/index.js new file mode 100644 index 000000000000..e71317edb666 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/index.js @@ -0,0 +1,44 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 1 routine to compute the sum of absolute values for all elements in a one-dimensional ndarray. +* +* @module @stdlib/blas/base/ndarray/gasum +* +* @example +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var gasum = require( '@stdlib/blas/base/ndarray/gasum' ); +* +* var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = gasum( [ x ] ); +* // returns 15.0 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/main.js b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/main.js new file mode 100644 index 000000000000..752c7fcae541 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/lib/main.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/base/gasum' ).ndarray; + + +// MAIN // + +/** +* Computes the sum of absolute values for all elements in a one-dimensional ndarray. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {number} sum +* +* @example +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = gasum( [ x ] ); +* // returns 15.0 +*/ +function gasum( arrays ) { + var x = arrays[ 0 ]; + return strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = gasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/package.json b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/package.json new file mode 100644 index 000000000000..de35d7b4c397 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/base/ndarray/gasum", + "version": "0.0.0", + "description": "Compute the sum of absolute values for all elements in a one-dimensional ndarray.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 1", + "linear", + "algebra", + "subroutines", + "gasum", + "asum", + "sum", + "absolute", + "absolute value", + "generic", + "sasum", + "dasum", + "norm", + "vector", + "ndarray" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gasum/test/test.js b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/test/test.js new file mode 100644 index 000000000000..987c995f96e2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gasum/test/test.js @@ -0,0 +1,153 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var gasum = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Collection} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'generic', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gasum, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( gasum.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function calculates the sum of absolute values for all elements in a one-dimensional ndarray', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = [ 1.0, -2.0, 3.0, -4.0, 5.0 ]; + x = vector( xbuf, 5, 1, 0 ); + y = gasum( [ x ] ); + + t.strictEqual( y, 15.0, 'returns expected value' ); + + xbuf = [ -4.0, -2.0 ]; + x = vector( xbuf, 2, 1, 0 ); + y = gasum( [ x ] ); + + t.strictEqual( y, 6.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an empty ndarray, the function returns `0.0`', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = []; + x = vector( xbuf, 0, 1, 0 ); + + y = gasum( [ x ] ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = [ + 1.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]; + x = vector( xbuf, 3, 2, 0 ); + + y = gasum( [ x ] ); + t.strictEqual( y, 12.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = [ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]; + x = vector( xbuf, 3, -2, 4 ); + + y = gasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = [ + 2.0, + 1.0, // 0 + 2.0, + -2.0, // 1 + -2.0, + 2.0, // 2 + 3.0, + 4.0 // 3 + ]; + x = vector( xbuf, 4, 2, 1 ); + + y = gasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/gdot/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ndarray/gdot/docs/types/index.d.ts index e02c1c7bb389..e9cf0672cfe6 100644 --- a/lib/node_modules/@stdlib/blas/base/ndarray/gdot/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/ndarray/gdot/docs/types/index.d.ts @@ -20,7 +20,7 @@ /// -import { ndarray } from '@stdlib/types/ndarray'; +import { typedndarray } from '@stdlib/types/ndarray'; /** * Computes the dot product of two one-dimensional ndarrays. @@ -40,7 +40,7 @@ import { ndarray } from '@stdlib/types/ndarray'; * var z = gdot( [ x, y ] ); * // returns -5.0 */ -declare function gdot( arrays: [ T, T ] ): number; +declare function gdot = typedndarray>( arrays: [ T, T ] ): number; // EXPORTS // diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/lib/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/lib/index.js new file mode 100644 index 000000000000..7a951b8152d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/lib/index.js @@ -0,0 +1,96 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/* +* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); + + +// MAIN // + +/** +* Top-level namespace. +* +* @namespace ns +*/ +var ns = {}; + +/** +* @name dasum +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/dasum} +*/ +setReadOnly( ns, 'dasum', require( '@stdlib/blas/base/ndarray/dasum' ) ); + +/** +* @name ddot +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/ddot} +*/ +setReadOnly( ns, 'ddot', require( '@stdlib/blas/base/ndarray/ddot' ) ); + +/** +* @name gasum +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/gasum} +*/ +setReadOnly( ns, 'gasum', require( '@stdlib/blas/base/ndarray/gasum' ) ); + +/** +* @name gdot +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/gdot} +*/ +setReadOnly( ns, 'gdot', require( '@stdlib/blas/base/ndarray/gdot' ) ); + +/** +* @name sasum +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/sasum} +*/ +setReadOnly( ns, 'sasum', require( '@stdlib/blas/base/ndarray/sasum' ) ); + +/** +* @name sdot +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/blas/base/ndarray/sdot} +*/ +setReadOnly( ns, 'sdot', require( '@stdlib/blas/base/ndarray/sdot' ) ); + + +// EXPORTS // + +module.exports = ns; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/package.json b/lib/node_modules/@stdlib/blas/base/ndarray/package.json new file mode 100644 index 000000000000..a7a9fd0be6e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/package.json @@ -0,0 +1,63 @@ +{ + "name": "@stdlib/blas/base/ndarray", + "version": "0.0.0", + "description": "Base ndarray BLAS functions.", + "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": { + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "standard", + "library", + "std", + "lib", + "mathematics", + "math", + "blas", + "ndarray", + "base" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/README.md b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/README.md new file mode 100644 index 000000000000..7565ab0eebc8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/README.md @@ -0,0 +1,127 @@ + + +# sasum + +> Calculate the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. + +
+ +The [_L1_ norm][l1norm] is defined as + + + +```math +\|\mathbf{x}\|_1 = \sum_{i=0}^{n-1} \vert x_i \vert +``` + + + + + +
+ + + +
+ +## Usage + +```javascript +var sasum = require( '@stdlib/blas/base/ndarray/sasum' ); +``` + +#### sasum( arrays ) + +Computes the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + +var y = sasum( [ x ] ); +// returns 15.0 +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var sasum = require( '@stdlib/blas/base/ndarray/sasum' ); + +var opts = { + 'dtype': 'float32' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = sasum( [ x ] ); +console.log( out ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/benchmark/benchmark.js new file mode 100644 index 000000000000..1a1ba182758c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/benchmark/benchmark.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var sasum = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len, -100.0, 100.0, options ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = sasum( [ x ] ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/img/equation_l1norm.svg b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/img/equation_l1norm.svg new file mode 100644 index 000000000000..4dbb928da546 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/img/equation_l1norm.svg @@ -0,0 +1,44 @@ + +double-vertical-bar bold x double-vertical-bar Subscript 1 Baseline equals sigma-summation Underscript i equals 0 Overscript n minus 1 Endscripts StartAbsoluteValue x Subscript i Baseline EndAbsoluteValue + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/repl.txt new file mode 100644 index 000000000000..7d02a555bef8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Computes the sum of absolute values for all elements in a one-dimensional + single-precision floating-point ndarray. + + If provided an empty input ndarray, the function returns `0.0`. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: number + The sum of absolute values. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + > var dt = 'float32'; + > var sh = [ xbuf.length ]; + > var st = [ 1 ]; + > var oo = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, st, oo, ord ); + > {{alias}}( [ x ] ) + 15.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/index.d.ts new file mode 100644 index 000000000000..ebdf65ceef88 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/index.d.ts @@ -0,0 +1,46 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { float32ndarray } from '@stdlib/types/ndarray'; + +/** +* Computes the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns sum +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = sasum( [ x ] ); +* // returns 15.0 +*/ +declare function sasum( arrays: [ float32ndarray ] ): number; + + +// EXPORTS // + +export = sasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/test.ts new file mode 100644 index 000000000000..c2f2af9d3113 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import sasum = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float32' + }); + + sasum( [ x ] ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + sasum( '10' ); // $ExpectError + sasum( 10 ); // $ExpectError + sasum( true ); // $ExpectError + sasum( false ); // $ExpectError + sasum( null ); // $ExpectError + sasum( undefined ); // $ExpectError + sasum( [] ); // $ExpectError + sasum( {} ); // $ExpectError + sasum( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float32' + }); + + sasum(); // $ExpectError + sasum( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/examples/index.js new file mode 100644 index 000000000000..9e8c04054da1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var sasum = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; + +var xbuf = discreteUniform( 10, -500, 500, opts ); +var x = new ndarray( opts.dtype, xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var out = sasum( [ x ] ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/index.js b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/index.js new file mode 100644 index 000000000000..011dfba9dbde --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/index.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 1 routine to compute the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. +* +* @module @stdlib/blas/base/ndarray/sasum +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var sasum = require( '@stdlib/blas/base/ndarray/sasum' ); +* +* var xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = sasum( [ x ] ); +* // returns 15.0 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/main.js b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/main.js new file mode 100644 index 000000000000..06b5279e3dbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/lib/main.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/base/sasum' ).ndarray; + + +// MAIN // + +/** +* Computes the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {number} sum +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); +* var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var y = sasum( [ x ] ); +* // returns 15.0 +*/ +function sasum( arrays ) { + var x = arrays[ 0 ]; + return strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = sasum; diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/package.json b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/package.json new file mode 100644 index 000000000000..4bfcc3696503 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/base/ndarray/sasum", + "version": "0.0.0", + "description": "Compute the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 1", + "linear", + "algebra", + "subroutines", + "sasum", + "dasum", + "asum", + "sum", + "absolute", + "absolute value", + "norm", + "float32", + "single", + "vector", + "ndarray" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/sasum/test/test.js b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/test/test.js new file mode 100644 index 000000000000..b3a923f65567 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/sasum/test/test.js @@ -0,0 +1,154 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 Float32Array = require( '@stdlib/array/float32' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var sasum = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Collection} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'float32', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof sasum, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( sasum.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function calculates the sum of absolute values for all elements in a one-dimensional ndarray', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] ); + x = vector( xbuf, 5, 1, 0 ); + y = sasum( [ x ] ); + + t.strictEqual( y, 15.0, 'returns expected value' ); + + xbuf = new Float32Array( [ -4.0, -2.0 ] ); + x = vector( xbuf, 2, 1, 0 ); + y = sasum( [ x ] ); + + t.strictEqual( y, 6.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an empty ndarray, the function returns `0.0`', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float32Array( [] ); + x = vector( xbuf, 0, 1, 0 ); + + y = sasum( [ x ] ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float32Array([ + 1.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + x = vector( xbuf, 3, 2, 0 ); + + y = sasum( [ x ] ); + t.strictEqual( y, 12.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float32Array([ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]); + x = vector( xbuf, 3, -2, 4 ); + + y = sasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { + var xbuf; + var x; + var y; + + xbuf = new Float32Array([ + 2.0, + 1.0, // 0 + 2.0, + -2.0, // 1 + -2.0, + 2.0, // 2 + 3.0, + 4.0 // 3 + ]); + x = vector( xbuf, 4, 2, 1 ); + + y = sasum( [ x ] ); + t.strictEqual( y, 9.0, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/ndarray/test/test.js b/lib/node_modules/@stdlib/blas/base/ndarray/test/test.js new file mode 100644 index 000000000000..ce1d03b78d0d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ndarray/test/test.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( './../lib' ); + + +// TESTS // + +tape( 'main export is an object', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ns, 'object', 'main export is an object' ); + t.end(); +}); + +tape( 'the exported object contains key-value pairs', function test( t ) { + var keys = objectKeys( ns ); + t.strictEqual( keys.length > 0, true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.js index badd7ee3c1c1..29c7db4107ec 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sasum = require( './../lib/sasum.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.native.js index cc1051bc0024..82168c9d6430 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.js index dd0e3e59fc88..7bcd1a50f1a5 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sasum = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.native.js index f03aba50b1c1..5900b3adda3f 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js index ceec78efa317..ca313bc0ba65 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var scasum = require( './../lib/scasum.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js index b1ed20f81c1a..38c9966c7eb2 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js index 82752c392281..2da8844ceb07 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var scasum = require( './../lib/ndarray.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js index 8df7cbb001bd..53f582913934 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js index 3b9b16857b9f..3559a62792e3 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var scnrm2 = require( './../lib/scnrm2.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js index 5280572ff6c4..ff23287f24f8 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js index 253dfb69ad17..12c6b9100e2c 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var scnrm2 = require( './../lib/ndarray.js' ); @@ -78,6 +79,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -91,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js index 3ecd307f0d21..42eab109ff78 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -83,6 +84,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -96,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js index 48ffb089479f..d0180b3c302d 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js index 6f8cc5b08849..d9b652071c7e 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js index dc7f2132a263..74fc92091ccb 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js index d56b46304822..e11e0262cb1c 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js index 3d99c35a2db2..9a54c1298d0b 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js index d1c0b3b58e3c..4a9fdb2171f1 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js index d1ee9bd9ba2f..7ed1b1440df4 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js index 1e7e5c4fb996..a0b8c0e0e721 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js index 74907eb5bce9..4339274b05bb 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js index f5363e58abb5..9519ff4661cf 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js index 73be234147d9..27e89984f991 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js index aa3ace995b1d..13121bdb3e4a 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js index 4944de7163fc..e540b9c574a8 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js index 69d0ce6c9707..0dbc546870d7 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js index 3b8c02daaf66..6081facef056 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js index 9a7809c4ef07..47c48e3a23ce 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_ntb.js index 9a3636f8afa8..c626b23e8ed2 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_tb.js index baff16b529ca..6fa91d2c2132 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_nta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_ntb.js index 1dde84e66a32..a9a2eb0cad8d 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_tb.js index 53319b42ab6e..5bcada2dd3b6 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_column_major_ta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js index 90c31329a835..93165df67351 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js index 89fb6955f8c0..d6dfddfd4623 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js index f0b88b7bdbe5..4aa2e85d4268 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,ndarray:size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js index 04ea3b0e10a2..cdd7242df60b 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js index a3bfb12c21d3..8e122567fc22 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js index fdc7d7ca406d..5dd82f4840c4 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js index 38bca2912ed3..48666bf730cf 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js index fa842578f45d..a802aafddd6a 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js index 1345e16a4372..1af6aa5244fa 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js index af1b07570fb0..16e22745ce2e 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js index bfe498438154..dda6d2247d70 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js index d9d45c88367b..f7d53175002d 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js index 0d2fa631d445..33d10430e94a 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js index 5523fb2d957d..f5b2ebf8d238 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js index 54231a72c152..11d795ac01ff 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js index 835ca1d2012a..414b36d3d40a 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_ntb.js index 83b3c638270b..d9d863d9889b 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_tb.js index 92ba2f85508a..c56d640fd2f9 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_nta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_ntb.js index e0502301294c..474dc0ccbe04 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_ntb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_ntb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(len*len), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_tb.js index f18346c913d5..50dc885b2349 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_tb.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/benchmark/benchmark_row_major_ta_tb.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemm = require( './../lib/sgemm.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(len*len), f ); + bench( format( '%s:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, (len*len) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.js index fe66a4027c88..9e8dad7fb4ea 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemv = require( './../lib/sgemv.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.native.js index a3d440cc6868..6764c0835781 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:size='+(N*N), opts, f ); + bench( format( '%s::native:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.js index 65b56fc9010b..b299c75799ee 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sgemv = require( './../lib/ndarray.js' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.native.js index 9c3585f60610..ebfedfa9a486 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:ndarray:size='+(N*N), opts, f ); + bench( format( '%s::native:ndarray:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.js index 20835d780fea..6ca48c29d81a 100644 --- a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sger = require( './../lib/sger.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':size='+(len*len), f ); + bench( format( '%s:size=%d', pkg, len*len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.native.js index 243b4e5ab863..3cc85c110792 100644 --- a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+'::native:size='+(len*len), opts, f ); + bench( format( '%s::native:size=%d', pkg, len*len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.js index 5c4ec6a545c6..1bd0f23956ba 100644 --- a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sger = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:size='+(len*len), f ); + bench( format( '%s:ndarray:size=%d', pkg, len*len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.native.js index 4ef80279226f..ac0919ebc06b 100644 --- a/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sger/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:size='+(len*len), opts, f ); + bench( format( '%s::native:ndarray:size=%d', pkg, len*len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.js index a0abef636660..8bb89368c703 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var snrm2 = require( './../lib/snrm2.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.native.js index a252ff29b9d6..928346ed20db 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.js index c2a418e10dcd..ce3fd48792e7 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var snrm2 = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.native.js index 58faa6cdee87..d618eeea74f1 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/srotg/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/srotg/benchmark/benchmark.js index 4f229c376eb9..095ec34dcff6 100644 --- a/lib/node_modules/@stdlib/blas/base/srotg/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/srotg/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var srotg = require( './../lib' ); @@ -61,7 +62,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':assign', function benchmark( b ) { +bench( format( '%s:assign', pkg ), function benchmark( b ) { var out; var x; var y; diff --git a/lib/node_modules/@stdlib/blas/base/srotm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/srotm/test/test.ndarray.js index 494b15be4b4e..e0554456cd2b 100644 --- a/lib/node_modules/@stdlib/blas/base/srotm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/srotm/test/test.ndarray.js @@ -287,20 +287,20 @@ tape( 'the function applies a plane rotation', function test( t ) { srotm( 3, x, 2, 0, y, 2, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -18.0, // 0 2.0, -24.0, // 1 4.0, -30.0 // 2 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 2.0, // 0 7.0, 6.0, // 1 9.0, 10.0 // 2 - ] ); + ]); isApprox( t, x, xe, 1.0 ); isApprox( t, y, ye, 1.0 ); @@ -323,20 +323,20 @@ tape( 'the function applies a plane rotation', function test( t ) { srotm( 2, x, 3, 0, y, 3, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ 6.0, // 0 2.0, 3.0, 9.0, // 1 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ -1.0, // 0 7.0, 8.0, -4.0, // 1 10.0 - ] ); + ]); isApprox( t, x, xe, 1.0 ); isApprox( t, y, ye, 1.0 ); @@ -370,20 +370,20 @@ tape( 'the function supports an `x` stride', function test( t ) { srotm( 2, x, 2, 0, y, 1, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -17.0, // 0 2.0, -18.0, // 1 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 8.0, // 0 13.0, // 1 8.0, 9.0, 10.0 - ] ); + ]); isApprox( t, x, xe, 2.0 ); isApprox( t, y, ye, 2.0 ); @@ -406,20 +406,20 @@ tape( 'the function supports an `x` stride', function test( t ) { srotm( 2, x, 3, 0, y, 1, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -18.0, // 0 2.0, 3.0, -21.0, // 1 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 2.0, // 0 8.0, // 1 8.0, 9.0, 10.0 - ] ); + ]); isApprox( t, x, xe, 1.0 ); isApprox( t, y, ye, 1.0 ); @@ -477,20 +477,20 @@ tape( 'the function supports an `x` offset', function test( t ) { srotm( 2, x, -2, 2, y, 1, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -21.0, // 1 2.0, -18.0, // 0 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 6.0, // 0 2.0, // 1 8.0, 9.0, 10.0 - ] ); + ]); isApprox( t, x, xe, 2.0 ); isApprox( t, y, ye, 2.0 ); @@ -513,20 +513,20 @@ tape( 'the function supports an `x` offset', function test( t ) { srotm( 3, x, -2, 4, y, 1, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ 8.0, // 2 2.0, 7.0, // 1 4.0, 6.0 // 0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ -5.0, // 0 -3.0, // 1 -1.0, // 2 9.0, 10.0 - ] ); + ]); isApprox( t, x, xe, 2.0 ); isApprox( t, y, ye, 2.0 ); @@ -559,20 +559,20 @@ tape( 'the function supports a `y` stride', function test( t ) { srotm( 3, x, 1, 0, y, 2, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -17.0, // 0 -22.0, // 1 -27.0, // 2 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 8.0, // 0 7.0, 12.0, // 1 9.0, 16.0 // 2 - ] ); + ]); isApprox( t, x, xe, 1.0 ); isApprox( t, y, ye, 1.0 ); @@ -595,20 +595,20 @@ tape( 'the function supports a `y` stride', function test( t ) { srotm( 2, x, 1, 0, y, 3, 0, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -18.0, // 0 -27.0, // 1 3.0, 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 2.0, // 0 7.0, 8.0, 4.0, // 1 10.0 - ] ); + ]); isApprox( t, x, xe, 1.0 ); isApprox( t, y, ye, 1.0 ); @@ -666,20 +666,20 @@ tape( 'the function supports a `y` offset', function test( t ) { srotm( 2, x, 1, 0, y, -2, 2, param ); - xe = new Float32Array( [ + xe = new Float32Array([ 8.0, // 0 6.0, // 1 3.0, 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ -2.0, // 1 7.0, -1.0, // 0 9.0, 10.0 - ] ); + ]); isApprox( t, x, xe, 2.0 ); isApprox( t, y, ye, 2.0 ); @@ -702,20 +702,20 @@ tape( 'the function supports a `y` offset', function test( t ) { srotm( 3, x, 1, 0, y, -2, 4, param ); - xe = new Float32Array( [ + xe = new Float32Array([ -30.0, // 0 -24.0, // 1 -18.0, // 2 4.0, 5.0 - ] ); - ye = new Float32Array( [ + ]); + ye = new Float32Array([ 6.0, // 2 7.0, 4.0, // 1 9.0, 2.0 // 0 - ] ); + ]); isApprox( t, x, xe, 2.0 ); isApprox( t, y, ye, 2.0 ); diff --git a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.js index 18fb13a98f6c..3ea8a4ec7985 100644 --- a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sscal = require( './../lib/sscal.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.native.js index 291957c8049b..b438c8152576 100644 --- a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.js index 0b54004b53ad..25e3ab40afc8 100644 --- a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sscal = require( './../lib/ndarray.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.native.js index 6a09c1f67c50..7b1aae757e80 100644 --- a/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sscal/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.js index fee324e074ab..b0c970ccdbc6 100644 --- a/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sspmv = require( './../lib/sspmv.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.ndarray.js index ed179effd94b..95b2fef3c278 100644 --- a/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sspmv/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sspmv = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:ndarray:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.js index 1a26422d87ec..06f6569e2bc0 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sspr = require( './../lib/sspr.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.native.js index ab019ab7ccf0..22df68a12f43 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -102,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+'::native:size='+( len * ( len + 1 ) / 2 ), opts, f ); + bench( format( '%s::native:size=%d', pkg, len * ( len + 1 ) / 2 ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.js index 2d7a06710eb6..273262c8cbda 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sspr = require( './../lib/ndarray.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+':ndarray:size='+( len * ( len + 1 ) / 2 ), f ); + bench( format( '%s:ndarray:size=%d', pkg, len * ( len + 1 ) / 2 ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.native.js index 94b201ac5248..00d52cf7f97e 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -102,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:size='+( len * ( len + 1 ) / 2 ), opts, f ); + bench( format( '%s::native:ndarray:size=%d', pkg, len * ( len + 1 ) / 2 ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/c/benchmark.length.c index 82d92cbef52a..3ba1146f7227 100644 --- a/lib/node_modules/@stdlib/blas/base/sspr/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sspr/benchmark/c/benchmark.length.c @@ -88,11 +88,13 @@ static double tic( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float AP[ len*(len+1)/2 ]; - float x[ len ]; + float *AP; + float *x; double t; int i; + AP = (float *) malloc( ( len*(len+1)/2 ) * sizeof( float ) ); + x = (float *) malloc( len * sizeof( float ) ); stdlib_strided_sfill( len, 0.5f, x, 1 ); stdlib_strided_sfill( len*(len+1)/2, 1.0f, AP, 1 ); t = tic(); @@ -107,6 +109,8 @@ static double benchmark1( int iterations, int len ) { if ( AP[ 0 ] != AP[ 0 ] ) { printf( "should not return NaN\n" ); } + free( AP ); + free( x ); return elapsed; } @@ -119,11 +123,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float AP[ len*(len+1)/2 ]; - float x[ len ]; + float *AP; + float *x; double t; int i; + AP = (float *) malloc( ( len*(len+1)/2 ) * sizeof( float ) ); + x = (float *) malloc( len * sizeof( float ) ); stdlib_strided_sfill( len, 0.5f, x, 1 ); stdlib_strided_sfill( len*(len+1)/2, 1.0f, AP, 1 ); t = tic(); @@ -138,6 +144,8 @@ static double benchmark2( int iterations, int len ) { if ( AP[ 0 ] != AP[ 0 ] ) { printf( "should not return NaN\n" ); } + free( AP ); + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.js index 100641c16110..46475fc2ce48 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sswap = require( './../lib/sswap.js' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.native.js index e164ef15d734..167ab12c6021 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.js index 4d57d7f1d972..a6ed6ccad9f4 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var sswap = require( './../lib/ndarray.js' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.native.js index 70e603cacd27..f80cd9f55b44 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/c/benchmark.length.c index 83ed5534e885..44affcdafa20 100644 --- a/lib/node_modules/@stdlib/blas/base/sswap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sswap/benchmark/c/benchmark.length.c @@ -96,11 +96,13 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; - float y[ len ]; + float *x; + float *y; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); + y = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; y[ i ] = 0.0f; @@ -117,6 +119,8 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } @@ -129,11 +133,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; - float y[ len ]; + float *x; + float *y; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); + y = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; y[ i ] = 0.0f; @@ -150,6 +156,8 @@ static double benchmark2( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.js index 72cea5db73b8..75486f318f82 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssymv = require( './../lib/ssymv.js' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js index 11b6a2f72b38..0e7276b3a751 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssymv = require( './../lib/ndarray.js' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.js index 0d72882080c2..90eff187404e 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssyr = require( './../lib/ssyr.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.native.js index 01c940defb43..af5c78ae20e5 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -102,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:size='+(N*N), opts, f ); + bench( format( '%s::native:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.js index 24ead053e85d..7ecebd2ae3aa 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssyr = require( './../lib/ndarray.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.native.js index 9c4bbad181ad..649464a216b4 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -102,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:ndarray:size='+(N*N), opts, f ); + bench( format( '%s::native:ndarray:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/ssyr/test/test.ndarray.native.js index 6343aca76b09..1432e7db45b8 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/test/test.ndarray.native.js @@ -41,7 +41,6 @@ var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); - var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); var cxp = require( './fixtures/column_major_xp.json' ); diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.js index 265f486ca84d..f3093f8826f2 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssyr2 = require( './../lib/ssyr2.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.native.js index c556db81cb30..204826f16d4b 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:size='+(N*N), opts, f ); + bench( format( '%s::native:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.js index 3ad7c35d797e..f4d1e0ba65ae 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ssyr2 = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.native.js index be173e17a351..a72a5c111d32 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+'::native:ndarray:size='+(N*N), opts, f ); + bench( format( '%s::native:ndarray:size=%d', pkg, N*N ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js index 9c71430bacfb..cca9dc3e48f3 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var strmv = require( './../lib/strmv.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js index 8209b15da447..9c484295118d 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var ones = require( '@stdlib/array/ones' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var strmv = require( './../lib/ndarray.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.js index 2ebd83726c20..8c5478dc28b5 100644 --- a/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.js @@ -26,6 +26,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var strsv = require( './../lib/strsv.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':size='+(N*N), f ); + bench( format( '%s:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.ndarray.js index 2a31e0ee620a..633fa87c1c72 100644 --- a/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strsv/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var strsv = require( './../lib/ndarray.js' ); @@ -98,7 +99,7 @@ function main() { for ( i = min; i <= max; i++ ) { N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); f = createBenchmark( N ); - bench( pkg+':ndarray:size='+(N*N), f ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.js index a246217a2793..0b8f5ef53785 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib' ); @@ -109,7 +110,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.js index 67e59dfc428c..2dbf863393b6 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.main.js index 4a2fddc6933a..bb6fa980b47c 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib' ); @@ -134,7 +135,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.ndarray.js index 1459e2981f36..9a57f7f1a21b 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib' ); @@ -134,7 +135,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.ndarray.js index a343af527c0e..7580da043019 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ccopy/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ccopy = require( './../lib' ); @@ -109,7 +110,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.js index 2d4fe48ee839..c322351c463e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cscal = require( './../lib' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.js index 7eb682354e20..0e8ad84f14e6 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cscal = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.main.js index eaf6f76feb58..9ab04a76eb4c 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.main.js @@ -28,6 +28,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cscal = require( './../lib' ); @@ -137,7 +138,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.ndarray.js index 6aee6cfa6529..a1670ca60390 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.module.ndarray.js @@ -28,6 +28,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cscal = require( './../lib' ); @@ -137,7 +138,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.ndarray.js index e75faec316df..398b41069d8e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/cscal/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var cscal = require( './../lib' ); @@ -108,7 +109,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.js index e37f66aa214d..75073b60902b 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib' ); @@ -109,7 +110,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.js index e461fe1011c7..e6885bda92a2 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.main.js index 729be4111b8f..015242cecb6c 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib' ); @@ -134,7 +135,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.ndarray.js index 4072e8d34f89..57ebbcda9d18 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib' ); @@ -134,7 +135,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.ndarray.js index 667d5505310f..67d158810150 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/csrot/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var csrot = require( './../lib' ); @@ -109,7 +110,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.js index e26c3c94b28e..2da24ae71e26 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.js index be06f7468380..5ff0c0891754 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.main.js index 545df3c36560..461c919e9882 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib' ); @@ -123,7 +124,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.ndarray.js index 96031c32788c..4e03bfbca3f1 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib' ); @@ -123,7 +124,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.ndarray.js index 8f49d8870693..2a050cd3e550 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dasum/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasum = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.js index f574b04b80a4..160ad732616a 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.js index b2d44148c380..7aeafc6732c7 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.main.js index c8da1bfa1e20..1ac7292fc00d 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.ndarray.js index 2b9a9ceba295..5e496365bd96 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.ndarray.js index 0c1bbdeee371..deb2851e7d20 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/daxpy/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var daxpy = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.js index 00ff0915e303..4f001e7e4a35 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcopy = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.js index 1393cfb8367d..7e4fab69d17e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcopy = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.main.js index 45200fc392d8..47f57aa3e49f 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcopy = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.ndarray.js index 4744744962e9..1392bb242529 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcopy = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.ndarray.js index 58ba0633f971..67b8a6459441 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dcopy/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcopy = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.js index 799c80bc20ed..05545ec8f697 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.js index 74b2ee05b842..6fe437f6bcc8 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.main.js index 236dfef3e497..576796523789 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib' ); @@ -126,7 +127,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.ndarray.js index ec01a05ccb0e..228bfab9c445 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib' ); @@ -126,7 +127,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.ndarray.js index c9f2a8754290..3c35b02e23cf 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/ddot/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.js index 5cdbdb971e3c..a34fbe2f6f2e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.js index 5e8eabccb69a..23bf92d9f908 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.main.js index 3d2759228a0b..014d69a94ae3 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib' ); @@ -123,7 +124,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.ndarray.js index 38a3342e109c..cd158cd3119a 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib' ); @@ -123,7 +124,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.ndarray.js index 75b822195218..364b5efe4ce5 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dnrm2/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnrm2 = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.js index 534fcab4d51a..322d9ec98812 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drot = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.js index 41ba6f2c826a..72a2c2a12b32 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drot = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.main.js index 47c8a8f258dc..115b23f14b69 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drot = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.ndarray.js index 171ad4507400..5cf69f7bcc2b 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drot = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.ndarray.js index 4b6ca86fa1fc..93157de081d2 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drot/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drot = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.js index f3ac6b3de43d..4e711c4ea09c 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.js @@ -26,6 +26,7 @@ var zeros = require( '@stdlib/array/zeros' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drotm = require( './../lib' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.js index 952517194c71..2e47bde5395e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drotm = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.main.js index 967425ef0339..50788e5241bf 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.main.js @@ -28,6 +28,7 @@ var zeros = require( '@stdlib/array/zeros' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drotm = require( './../lib' ); @@ -135,7 +136,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.ndarray.js index 84ea58da2a21..d957e38a2fff 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.module.ndarray.js @@ -28,6 +28,7 @@ var zeros = require( '@stdlib/array/zeros' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drotm = require( './../lib' ); @@ -135,7 +136,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.ndarray.js index 6622ffec64a4..c0990bea0a20 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var zeros = require( '@stdlib/array/zeros' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drotm = require( './../lib' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.js index 936a8033c3f6..3fc1d230a6a2 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.js index 71cae7896a50..2bf31465ea96 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.main.js index b9dd64ae49e2..f0050cb84fb4 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib' ); @@ -128,7 +129,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.ndarray.js index 90f9ec078445..ae260284d6c3 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib' ); @@ -128,7 +129,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.ndarray.js index 37ec7b271c98..3de75cce7f45 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dscal/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.js index d3aa2d44146a..52434b24241c 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsdot = require( './../lib' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.js index e2959a1affe0..0eee064ebff2 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsdot = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.main.js index 99c39ffc7cb8..47f37606f6c3 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsdot = require( './../lib' ); @@ -126,7 +127,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.ndarray.js index 62119ce01d7d..58bc47169a48 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsdot = require( './../lib' ); @@ -126,7 +127,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.ndarray.js index 584d606b404d..33f6830b956d 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dsdot/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsdot = require( './../lib' ); @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.js index 1823253f6de8..7d84002e3257 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.js index 0bb14df95f7b..d3c80dcc0adf 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.main.js index bd18ae3ed737..7ef89ba18395 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.ndarray.js index dd0e54bd2588..758523581db6 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.ndarray.js index 66b1fa666b6f..f9ddf1b623ba 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dswap/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib' ); @@ -99,7 +100,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.js index bedf74264765..8f0986995a1f 100755 --- a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib' ); @@ -104,7 +105,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, opts, f ); + bench( format( '%s:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.js b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.js index 5edb49538f72..ffdffd85cfcb 100755 --- a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.js @@ -23,6 +23,7 @@ var bench = require( '@stdlib/bench' ); var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' ); var Memory = require( '@stdlib/wasm/memory' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib' ); @@ -36,7 +37,7 @@ var opts = { // MAIN // -bench( pkg+':Module:constructor', opts, function benchmark( b ) { +bench( format( '%s:Module:constructor', pkg ), opts, function benchmark( b ) { var values; var o; var v; diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.main.js index 43ef2ca9d247..62326dcd3a08 100755 --- a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.main.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:len='+len, opts, f ); + bench( format( '%s::module,pointers:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.ndarray.js index ec3bdb7fb044..b163e91942e1 100755 --- a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.module.ndarray.js @@ -27,6 +27,7 @@ var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib' ); @@ -131,7 +132,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::module,pointers:ndarray:len='+len, opts, f ); + bench( format( '%s::module,pointers:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.ndarray.js index b5388ec30705..0c58107407c5 100755 --- a/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/dznrm2/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex128Array = require( '@stdlib/array/complex128' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dznrm2 = require( './../lib' ); @@ -104,7 +105,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, opts, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ddot/README.md b/lib/node_modules/@stdlib/blas/ddot/README.md index 122e0de701de..2299a95c6829 100644 --- a/lib/node_modules/@stdlib/blas/ddot/README.md +++ b/lib/node_modules/@stdlib/blas/ddot/README.md @@ -63,10 +63,7 @@ var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); var z = ddot( x, y ); -// returns - -var v = z.get(); -// returns -5.0 +// returns [ -5.0 ] ``` The function has the following parameters: @@ -88,13 +85,7 @@ var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 3.0 ] ), opts ); var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0, 2.0 ] ), opts ); var z = ddot( x, y ); -// returns - -var v1 = z.get( 0 ); -// returns 23.0 - -var v2 = z.get( 1 ); -// returns -22.0 +// returns [ 23.0, -22.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.js index f95a0a1c43b5..44b57422eb72 100644 --- a/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.js @@ -25,6 +25,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var uniform = require( '@stdlib/random/array/uniform' ); var array = require( '@stdlib/ndarray/array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib/main.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::vectors:len='+len, f ); + bench( format( '%s::vectors:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.stacks.js b/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.stacks.js index 1f2e03937b14..69fad62ef3ac 100644 --- a/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.stacks.js +++ b/lib/node_modules/@stdlib/blas/ddot/benchmark/benchmark.stacks.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var uniform = require( '@stdlib/random/array/uniform' ); var numel = require( '@stdlib/ndarray/base/numel' ); var array = require( '@stdlib/ndarray/array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var ddot = require( './../lib/main.js' ); @@ -111,11 +112,11 @@ function main() { shape = [ 2, N/2 ]; f = createBenchmark( shape ); - bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f ); + bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f ); shape = [ N/2, 2 ]; f = createBenchmark( shape ); - bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f ); + bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ddot/docs/repl.txt b/lib/node_modules/@stdlib/blas/ddot/docs/repl.txt index 98a26ac66c9e..7ba0e332cc7c 100644 --- a/lib/node_modules/@stdlib/blas/ddot/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ddot/docs/repl.txt @@ -45,9 +45,7 @@ > var ybuf = new {{alias:@stdlib/array/float64}}( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ); > var y = {{alias:@stdlib/ndarray/array}}( ybuf ); > var z = {{alias}}( x, y ) - - > z.get() - -5.0 + [ -5.0 ] See Also -------- diff --git a/lib/node_modules/@stdlib/blas/ddot/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ddot/docs/types/index.d.ts index d145e9d3e2d1..5ba7327091b6 100644 --- a/lib/node_modules/@stdlib/blas/ddot/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ddot/docs/types/index.d.ts @@ -52,10 +52,7 @@ import { float64ndarray } from '@stdlib/types/ndarray'; * var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); * * var z = ddot( x, y ); -* // returns -* -* var v = z.get(); -* // returns -5.0 +* // returns [ -5.0 ] */ declare function ddot( x: float64ndarray, y: float64ndarray, dim?: number ): float64ndarray; diff --git a/lib/node_modules/@stdlib/blas/ddot/lib/index.js b/lib/node_modules/@stdlib/blas/ddot/lib/index.js index 537713e19fc3..fcb839c1d4c7 100644 --- a/lib/node_modules/@stdlib/blas/ddot/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ddot/lib/index.js @@ -32,10 +32,7 @@ * var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); * * var z = ddot( x, y ); -* // returns -* -* var v = z.get(); -* // returns -5.0 +* // returns [ -5.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/ddot/lib/main.js b/lib/node_modules/@stdlib/blas/ddot/lib/main.js index 46d531cd7738..a5a24aa38893 100644 --- a/lib/node_modules/@stdlib/blas/ddot/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ddot/lib/main.js @@ -60,10 +60,7 @@ var format = require( '@stdlib/string/format' ); * var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); * * var z = ddot( x, y ); -* // returns -* -* var v = z.get(); -* // returns -5.0 +* // returns [ -5.0 ] */ function ddot( x, y ) { var dim; diff --git a/lib/node_modules/@stdlib/blas/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/docs/types/index.d.ts index c71569a41e11..5c48fec83606 100644 --- a/lib/node_modules/@stdlib/blas/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/docs/types/index.d.ts @@ -68,10 +68,7 @@ interface Namespace { * var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); * * var z = ns.ddot( x, y ); - * // returns - * - * var v = z.get(); - * // returns -5.0 + * // returns [ -5.0 ] */ ddot: typeof ddot; diff --git a/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.js index 157e978fe653..27cccdf7cd73 100644 --- a/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.js @@ -25,6 +25,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var uniform = require( '@stdlib/random/array/uniform' ); var array = require( '@stdlib/ndarray/array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib/main.js' ); @@ -97,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.stacks.js b/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.stacks.js index 8caa7b37254c..99a9b45f8039 100644 --- a/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.stacks.js +++ b/lib/node_modules/@stdlib/blas/dswap/benchmark/benchmark.stacks.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var uniform = require( '@stdlib/random/array/uniform' ); var numel = require( '@stdlib/ndarray/base/numel' ); var array = require( '@stdlib/ndarray/array' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dswap = require( './../lib/main.js' ); @@ -111,11 +112,11 @@ function main() { shape = [ 2, N/2 ]; f = createBenchmark( shape ); - bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f ); + bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f ); shape = [ N/2, 2 ]; f = createBenchmark( shape ); - bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f ); + bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/README.md b/lib/node_modules/@stdlib/blas/ext/README.md index 36d60cf0b125..8ec5536f200f 100644 --- a/lib/node_modules/@stdlib/blas/ext/README.md +++ b/lib/node_modules/@stdlib/blas/ext/README.md @@ -46,10 +46,12 @@ The namespace contains the following:
- [`base`][@stdlib/blas/ext/base]: base (i.e., lower-level) extensions to basic linear algebra subprograms (BLAS). +- [`circshift( x, k[, options] )`][@stdlib/blas/ext/circshift]: circularly shift the elements of an input ndarray by a specified number of positions along one or more ndarray dimensions. - [`cusum( x[, initial][, options] )`][@stdlib/blas/ext/cusum]: compute the cumulative sum along one or more ndarray dimensions. - [`findIndex( x[, options], clbk[, thisArg] )`][@stdlib/blas/ext/find-index]: return the index of the first element along an ndarray dimension which passes a test implemented by a predicate function. - [`findLastIndex( x[, options], clbk[, thisArg] )`][@stdlib/blas/ext/find-last-index]: return the index of the last element along an ndarray dimension which passes a test implemented by a predicate function. - [`indexOf( x, searchElement[, fromIndex][, options] )`][@stdlib/blas/ext/index-of]: return the first index of a specified search element along an ndarray dimension. +- [`join( x[, options] )`][@stdlib/blas/ext/join]: return an ndarray created by joining elements using a separator along one or more ndarray dimensions. - [`lastIndexOf( x, searchElement[, fromIndex][, options] )`][@stdlib/blas/ext/last-index-of]: return the last index of a specified search element along an ndarray dimension. - [`linspace( shape, start, stop[, endpoint][, options] )`][@stdlib/blas/ext/linspace]: return a new ndarray filled with linearly spaced values over a specified interval along one or more ndarray dimensions. - [`sorthp( x[, sortOrder][, options] )`][@stdlib/blas/ext/sorthp]: sort an input ndarray along one or more ndarray dimensions using heapsort. @@ -99,6 +101,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base +[@stdlib/blas/ext/circshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/circshift + [@stdlib/blas/ext/cusum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/cusum [@stdlib/blas/ext/find-index]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/find-index @@ -107,6 +111,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/index-of +[@stdlib/blas/ext/join]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/join + [@stdlib/blas/ext/last-index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/last-index-of [@stdlib/blas/ext/linspace]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/linspace diff --git a/lib/node_modules/@stdlib/blas/ext/base/README.md b/lib/node_modules/@stdlib/blas/ext/base/README.md index 0fda9489cc67..3b61e4068e73 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/README.md @@ -44,8 +44,11 @@ var o = ns;
- [`cfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/cfill]: fill a single-precision complex floating-point strided array with a specified scalar constant. +- [`cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/cindex-of-row]: return the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +- [`coneTo( N, x, strideX )`][@stdlib/blas/ext/base/cone-to]: fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. - [`csum( N, x, strideX )`][@stdlib/blas/ext/base/csum]: calculate the sum of single-precision complex floating-point strided array elements. - [`csumkbn( N, x, strideX )`][@stdlib/blas/ext/base/csumkbn]: calculate the sum of single-precision complex floating-point strided array elements using an improved Kahan–Babuška algorithm. +- [`czeroTo( N, x, strideX )`][@stdlib/blas/ext/base/czero-to]: fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. - [`dapx( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dapx]: add a scalar constant to each element in a double-precision floating-point strided array. - [`dapxsum( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dapxsum]: add a scalar constant to each double-precision floating-point strided array element and compute the sum. - [`dapxsumkbn( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dapxsumkbn]: add a scalar constant to each double-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm. @@ -53,12 +56,14 @@ var o = ns; - [`dapxsumors( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dapxsumors]: add a scalar constant to each double-precision floating-point strided array element and compute the sum using ordinary recursive summation. - [`dapxsumpw( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dapxsumpw]: add a scalar constant to each double-precision floating-point strided array element and compute the sum using pairwise summation. - [`dasumpw( N, x, strideX )`][@stdlib/blas/ext/base/dasumpw]: calculate the sum of absolute values (_L1_ norm) of double-precision floating-point strided array elements using pairwise summation. +- [`dcircshift( N, k, x, strideX )`][@stdlib/blas/ext/base/dcircshift]: circularly shift the elements of a double-precision floating-point strided array by a specified number of positions. - [`dcusum( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dcusum]: calculate the cumulative sum of double-precision floating-point strided array elements. - [`dcusumkbn( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dcusumkbn]: calculate the cumulative sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. - [`dcusumkbn2( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dcusumkbn2]: calculate the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. - [`dcusumors( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dcusumors]: calculate the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation. - [`dcusumpw( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dcusumpw]: calculate the cumulative sum of double-precision floating-point strided array elements using pairwise summation. - [`dfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dfill]: fill a double-precision floating-point strided array with a specified scalar constant. +- [`dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/dindex-of-row]: return the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. - [`dindexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/dindex-of]: return the first index of a specified search element in a double-precision floating-point strided array. - [`dlastIndexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/dlast-index-of]: return the last index of a specified search element in a double-precision floating-point strided array. - [`dlinspace( N, start, stop, endpoint, x, strideX )`][@stdlib/blas/ext/base/dlinspace]: fill a double-precision floating-point strided array with linearly spaced values over a specified interval. @@ -75,13 +80,19 @@ var o = ns; - [`dnansumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/dnansumkbn2]: calculate the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. - [`dnansumors( N, x, strideX )`][@stdlib/blas/ext/base/dnansumors]: calculate the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. - [`dnansumpw( N, x, strideX )`][@stdlib/blas/ext/base/dnansumpw]: calculate the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation. +- [`doneTo( N, x, strideX )`][@stdlib/blas/ext/base/done-to]: fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. - [`drev( N, x, strideX )`][@stdlib/blas/ext/base/drev]: reverse a double-precision floating-point strided array in-place. +- [`drrss( N, x, strideX, y, strideY )`][@stdlib/blas/ext/base/drrss]: calculate the square root of the residual sum of squares of two double-precision floating-point strided arrays. +- [`drss( N, x, strideX, y, strideY )`][@stdlib/blas/ext/base/drss]: calculate the residual sum of squares of two double-precision floating-point strided arrays. +- [`drssbl( N, x, strideX, y, strideY )`][@stdlib/blas/ext/base/drssbl]: calculate the residual sum of squares of two double-precision floating-point strided arrays using Blue's algorithm. +- [`drsskbn( N, x, strideX, y, strideY )`][@stdlib/blas/ext/base/drsskbn]: calculate the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm. - [`dsapxsum( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dsapxsum]: add a scalar constant to each single-precision floating-point strided array element, and compute the sum using extended accumulation and returning an extended precision result. - [`dsapxsumpw( N, alpha, x, strideX )`][@stdlib/blas/ext/base/dsapxsumpw]: add a constant to each single-precision floating-point strided array element, and compute the sum using pairwise summation with extended accumulation and returning an extended precision result. - [`dsnannsumors( N, x, strideX, out, strideOut )`][@stdlib/blas/ext/base/dsnannsumors]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result. - [`dsnansum( N, x, strideX )`][@stdlib/blas/ext/base/dsnansum]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result. - [`dsnansumors( N, x, strideX )`][@stdlib/blas/ext/base/dsnansumors]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result. - [`dsnansumpw( N, x, strideX )`][@stdlib/blas/ext/base/dsnansumpw]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result. +- [`dsort( N, order, x, strideX )`][@stdlib/blas/ext/base/dsort]: sort a double-precision floating-point strided array. - [`dsort2hp( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dsort2hp]: simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using heapsort. - [`dsort2ins( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dsort2ins]: simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort. - [`dsort2sh( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/dsort2sh]: simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort. @@ -96,6 +107,7 @@ var o = ns; - [`dsumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/dsumkbn2]: calculate the sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. - [`dsumors( N, x, strideX )`][@stdlib/blas/ext/base/dsumors]: calculate the sum of double-precision floating-point strided array elements using ordinary recursive summation. - [`dsumpw( N, x, strideX )`][@stdlib/blas/ext/base/dsumpw]: calculate the sum of double-precision floating-point strided array elements using pairwise summation. +- [`dzeroTo( N, x, strideX )`][@stdlib/blas/ext/base/dzero-to]: fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. - [`gapx( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gapx]: add a scalar constant to each element in a strided array. - [`gapxsum( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gapxsum]: add a scalar constant to each strided array element and compute the sum. - [`gapxsumkbn( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gapxsumkbn]: add a scalar constant to each strided array element and compute the sum using an improved Kahan–Babuška algorithm. @@ -103,6 +115,8 @@ var o = ns; - [`gapxsumors( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gapxsumors]: add a scalar constant to each strided array element and compute the sum using ordinary recursive summation. - [`gapxsumpw( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gapxsumpw]: add a scalar constant to each strided array element and compute the sum using pairwise summation. - [`gasumpw( N, x, strideX )`][@stdlib/blas/ext/base/gasumpw]: calculate the sum of absolute values (_L1_ norm) of strided array elements using pairwise summation. +- [`gcircshift( N, k, x, strideX )`][@stdlib/blas/ext/base/gcircshift]: circularly shift the elements of a strided array by a specified number of positions. +- [`gconjoin( N, prefix, suffix, conjunction, oxfordComma, x, strideX )`][@stdlib/blas/ext/base/gconjoin]: return a string created by joining strided array elements into a human-readable list using a conjunction. - [`gcusum( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gcusum]: calculate the cumulative sum of strided array elements. - [`gcusumkbn( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gcusumkbn]: calculate the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm. - [`gcusumkbn2( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gcusumkbn2]: calculate the cumulative sum of strided array elements using a second-order iterative Kahan–Babuška algorithm. @@ -112,8 +126,11 @@ var o = ns; - [`gfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/gfill]: fill a strided array with a specified scalar constant. - [`gfindIndex( N, x, strideX, clbk[, thisArg] )`][@stdlib/blas/ext/base/gfind-index]: return the index of the first element which passes a test implemented by a predicate function. - [`gfindLastIndex( N, x, strideX, clbk[, thisArg] )`][@stdlib/blas/ext/base/gfind-last-index]: return the index of the last element which passes a test implemented by a predicate function. +- [`gindexOfColumn( order, M, N, A, LDA, x, strideX )`][@stdlib/blas/ext/base/gindex-of-column]: return the index of the first column in an input matrix which has the same elements as a provided search vector. - [`gindexOfRow( order, M, N, A, LDA, x, strideX )`][@stdlib/blas/ext/base/gindex-of-row]: return the index of the first row in an input matrix which has the same elements as a provided search vector. - [`gindexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/gindex-of]: return the first index of a specified search element in a strided array. +- [`gjoinBetween( N, prefix, suffix, x, strideX, separators, strideS )`][@stdlib/blas/ext/base/gjoin-between]: return a string by joining strided array elements using a specified separator for each pair of consecutive elements. +- [`gjoin( N, separator, x, strideX )`][@stdlib/blas/ext/base/gjoin]: return a string created by joining strided array elements using a specified separator. - [`glastIndexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/glast-index-of]: return the last index of a specified search element in a strided array. - [`glinspace( N, start, stop, endpoint, x, strideX )`][@stdlib/blas/ext/base/glinspace]: fill a strided array with linearly spaced values over a specified interval. - [`gnannsumkbn( N, x, strideX, out, strideOut )`][@stdlib/blas/ext/base/gnannsumkbn]: calculate the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. @@ -123,7 +140,9 @@ var o = ns; - [`gnansumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/gnansumkbn2]: calculate the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. - [`gnansumors( N, x, strideX )`][@stdlib/blas/ext/base/gnansumors]: calculate the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation. - [`gnansumpw( N, x, strideX )`][@stdlib/blas/ext/base/gnansumpw]: calculate the sum of strided array elements, ignoring `NaN` values and using pairwise summation. +- [`goneTo( N, x, strideX )`][@stdlib/blas/ext/base/gone-to]: fill a strided array with linearly spaced numeric elements which increment by `1` starting from one. - [`grev( N, x, strideX )`][@stdlib/blas/ext/base/grev]: reverse a strided array in-place. +- [`gsort( N, order, x, strideX )`][@stdlib/blas/ext/base/gsort]: sort a strided array. - [`gsort2hp( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gsort2hp]: simultaneously sort two strided arrays based on the sort order of the first array using heapsort. - [`gsort2ins( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gsort2ins]: simultaneously sort two strided arrays based on the sort order of the first array using insertion sort. - [`gsort2sh( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gsort2sh]: simultaneously sort two strided arrays based on the sort order of the first array using Shellsort. @@ -135,6 +154,7 @@ var o = ns; - [`gsumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/gsumkbn2]: calculate the sum of strided array elements using a second-order iterative Kahan–Babuška algorithm. - [`gsumors( N, x, strideX )`][@stdlib/blas/ext/base/gsumors]: calculate the sum of strided array elements using ordinary recursive summation. - [`gsumpw( N, x, strideX )`][@stdlib/blas/ext/base/gsumpw]: calculate the sum of strided array elements using pairwise summation. +- [`gzeroTo( N, x, strideX )`][@stdlib/blas/ext/base/gzero-to]: fill a strided array with linearly spaced numeric elements which increment by `1` starting from zero. - [`ndarray`][@stdlib/blas/ext/base/ndarray]: base ndarray extended BLAS functions. - [`sapx( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapx]: add a scalar constant to each element in a single-precision floating-point strided array. - [`sapxsum( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsum]: add a scalar constant to each single-precision floating-point strided array element and compute the sum. @@ -143,6 +163,7 @@ var o = ns; - [`sapxsumors( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumors]: add a scalar constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation. - [`sapxsumpw( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumpw]: add a scalar constant to each single-precision floating-point strided array element and compute the sum using pairwise summation. - [`sasumpw( N, x, strideX )`][@stdlib/blas/ext/base/sasumpw]: calculate the sum of absolute values (_L1_ norm) of single-precision floating-point strided array elements using pairwise summation. +- [`scircshift( N, k, x, strideX )`][@stdlib/blas/ext/base/scircshift]: circularly shift the elements of a single-precision floating-point strided array by a specified number of positions. - [`scusum( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusum]: calculate the cumulative sum of single-precision floating-point strided array elements. - [`scusumkbn( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusumkbn]: calculate the cumulative sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm. - [`scusumkbn2( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusumkbn2]: calculate the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. @@ -155,6 +176,7 @@ var o = ns; - [`sdssum( N, x, strideX )`][@stdlib/blas/ext/base/sdssum]: calculate the sum of single-precision floating-point strided array elements using extended accumulation. - [`sdssumpw( N, x, strideX )`][@stdlib/blas/ext/base/sdssumpw]: calculate the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation. - [`sfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sfill]: fill a single-precision floating-point strided array with a specified scalar constant. +- [`sindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/sindex-of-row]: return the index of the first row in a single-precision floating-point input matrix which has the same elements as a provided search vector. - [`sindexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/sindex-of]: return the first index of a specified search element in a single-precision floating-point strided array. - [`slastIndexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/slast-index-of]: return the last index of a specified search element in a single-precision floating-point strided array. - [`slinspace( N, start, stop, endpoint, x, strideX )`][@stdlib/blas/ext/base/slinspace]: fill a single-precision floating-point strided array with linearly spaced values over a specified interval. @@ -163,6 +185,7 @@ var o = ns; - [`snansumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/snansumkbn2]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. - [`snansumors( N, x, strideX )`][@stdlib/blas/ext/base/snansumors]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation. - [`snansumpw( N, x, strideX )`][@stdlib/blas/ext/base/snansumpw]: calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation. +- [`soneTo( N, x, strideX )`][@stdlib/blas/ext/base/sone-to]: fill a single-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. - [`srev( N, x, strideX )`][@stdlib/blas/ext/base/srev]: reverse a single-precision floating-point strided array in-place. - [`ssort2hp( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/ssort2hp]: simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using heapsort. - [`ssort2ins( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/ssort2ins]: simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort. @@ -175,10 +198,14 @@ var o = ns; - [`ssumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/ssumkbn2]: calculate the sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm. - [`ssumors( N, x, strideX )`][@stdlib/blas/ext/base/ssumors]: calculate the sum of single-precision floating-point strided array elements using ordinary recursive summation. - [`ssumpw( N, x, strideX )`][@stdlib/blas/ext/base/ssumpw]: calculate the sum of single-precision floating-point strided array elements using pairwise summation. +- [`szeroTo( N, x, strideX )`][@stdlib/blas/ext/base/szero-to]: fill a single-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. - [`wasm`][@stdlib/blas/ext/base/wasm]: extensions to basic linear algebra subprograms (BLAS) compiled to WebAssembly. - [`zfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/zfill]: fill a double-precision complex floating-point strided array with a specified scalar constant. +- [`zindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/zindex-of-row]: return the index of the first row in a double-precision complex floating-point input matrix which has the same elements as a provided search vector. +- [`zoneTo( N, x, strideX )`][@stdlib/blas/ext/base/zone-to]: fill a double-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. - [`zsum( N, x, strideX )`][@stdlib/blas/ext/base/zsum]: calculate the sum of double-precision complex floating-point strided array elements. - [`zsumkbn( N, x, strideX )`][@stdlib/blas/ext/base/zsumkbn]: calculate the sum of double-precision complex floating-point strided array elements using an improved Kahan–Babuška algorithm. +- [`zzeroTo( N, x, strideX )`][@stdlib/blas/ext/base/zzero-to]: fill a double-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero.
@@ -231,10 +258,16 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/cfill]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cfill +[@stdlib/blas/ext/base/cindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cindex-of-row + +[@stdlib/blas/ext/base/cone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cone-to + [@stdlib/blas/ext/base/csum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/csum [@stdlib/blas/ext/base/csumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/csumkbn +[@stdlib/blas/ext/base/czero-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/czero-to + [@stdlib/blas/ext/base/dapx]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dapx [@stdlib/blas/ext/base/dapxsum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dapxsum @@ -249,6 +282,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/dasumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dasumpw +[@stdlib/blas/ext/base/dcircshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dcircshift + [@stdlib/blas/ext/base/dcusum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dcusum [@stdlib/blas/ext/base/dcusumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dcusumkbn @@ -261,6 +296,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/dfill]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dfill +[@stdlib/blas/ext/base/dindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dindex-of-row + [@stdlib/blas/ext/base/dindex-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dindex-of [@stdlib/blas/ext/base/dlast-index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dlast-index-of @@ -293,8 +330,18 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/dnansumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dnansumpw +[@stdlib/blas/ext/base/done-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/done-to + [@stdlib/blas/ext/base/drev]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/drev +[@stdlib/blas/ext/base/drrss]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/drrss + +[@stdlib/blas/ext/base/drss]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/drss + +[@stdlib/blas/ext/base/drssbl]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/drssbl + +[@stdlib/blas/ext/base/drsskbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/drsskbn + [@stdlib/blas/ext/base/dsapxsum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsapxsum [@stdlib/blas/ext/base/dsapxsumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsapxsumpw @@ -307,6 +354,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/dsnansumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsnansumpw +[@stdlib/blas/ext/base/dsort]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsort + [@stdlib/blas/ext/base/dsort2hp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsort2hp [@stdlib/blas/ext/base/dsort2ins]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsort2ins @@ -335,6 +384,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/dsumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dsumpw +[@stdlib/blas/ext/base/dzero-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dzero-to + [@stdlib/blas/ext/base/gapx]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gapx [@stdlib/blas/ext/base/gapxsum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gapxsum @@ -349,6 +400,10 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/gasumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gasumpw +[@stdlib/blas/ext/base/gcircshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gcircshift + +[@stdlib/blas/ext/base/gconjoin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gconjoin + [@stdlib/blas/ext/base/gcusum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gcusum [@stdlib/blas/ext/base/gcusumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gcusumkbn @@ -367,10 +422,16 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/gfind-last-index]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gfind-last-index +[@stdlib/blas/ext/base/gindex-of-column]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gindex-of-column + [@stdlib/blas/ext/base/gindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gindex-of-row [@stdlib/blas/ext/base/gindex-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gindex-of +[@stdlib/blas/ext/base/gjoin-between]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gjoin-between + +[@stdlib/blas/ext/base/gjoin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gjoin + [@stdlib/blas/ext/base/glast-index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/glast-index-of [@stdlib/blas/ext/base/glinspace]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/glinspace @@ -389,8 +450,12 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/gnansumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gnansumpw +[@stdlib/blas/ext/base/gone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gone-to + [@stdlib/blas/ext/base/grev]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/grev +[@stdlib/blas/ext/base/gsort]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gsort + [@stdlib/blas/ext/base/gsort2hp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gsort2hp [@stdlib/blas/ext/base/gsort2ins]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gsort2ins @@ -413,6 +478,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/gsumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gsumpw +[@stdlib/blas/ext/base/gzero-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/gzero-to + [@stdlib/blas/ext/base/ndarray]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ndarray [@stdlib/blas/ext/base/sapx]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sapx @@ -429,6 +496,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/sasumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sasumpw +[@stdlib/blas/ext/base/scircshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/scircshift + [@stdlib/blas/ext/base/scusum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/scusum [@stdlib/blas/ext/base/scusumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/scusumkbn @@ -453,6 +522,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/sfill]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sfill +[@stdlib/blas/ext/base/sindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sindex-of-row + [@stdlib/blas/ext/base/sindex-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sindex-of [@stdlib/blas/ext/base/slast-index-of]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/slast-index-of @@ -469,6 +540,8 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/snansumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/snansumpw +[@stdlib/blas/ext/base/sone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/sone-to + [@stdlib/blas/ext/base/srev]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/srev [@stdlib/blas/ext/base/ssort2hp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ssort2hp @@ -493,14 +566,22 @@ console.log( objectKeys( ns ) ); [@stdlib/blas/ext/base/ssumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ssumpw +[@stdlib/blas/ext/base/szero-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/szero-to + [@stdlib/blas/ext/base/wasm]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/wasm [@stdlib/blas/ext/base/zfill]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zfill +[@stdlib/blas/ext/base/zindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zindex-of-row + +[@stdlib/blas/ext/base/zone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zone-to + [@stdlib/blas/ext/base/zsum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zsum [@stdlib/blas/ext/base/zsumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zsumkbn +[@stdlib/blas/ext/base/zzero-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/zzero-to + diff --git a/lib/node_modules/@stdlib/blas/ext/base/cfill/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/cfill/benchmark/benchmark.js index 17fb92dfb71c..ccb907c35257 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cfill/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cfill/benchmark/benchmark.js @@ -86,6 +86,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/README.md b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/README.md new file mode 100644 index 000000000000..459e19506a2d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/README.md @@ -0,0 +1,450 @@ + + +# cindexOfRow + +> Return the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' ); +``` + +#### cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) + +Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1+0i, 3+0i ], + [ 2+0i, 4+0i ] + ] +*/ +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +var workspace = new Uint8Array( 2 ); +var out = cindexOfRow( 'column-major', 2, 2, A, 2, x, 1, workspace, 1 ); +// returns 1 +``` + +The function has the following parameters: + +- **order**: storage layout. +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix stored as a [`Complex64Array`][@stdlib/array/complex64]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: search vector stored as a [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: stride length of `x`. +- **workspace**: workspace array stored as a [`Uint8Array`][mdn-uint8array] for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: stride length of `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may provide an empty workspace array. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1+0i, 2+0i ], + [ 3+0i, 4+0i ] + ] +*/ +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +var x = new Complex64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); +var workspace = new Uint8Array( 0 ); +var out = cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, workspace, 1 ); +// returns 1 +``` + +If the function is unable to find a matching row, the function returns `-1`. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1+0i, 3+0i ], + [ 2+0i, 4+0i ] + ] +*/ +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +var x = new Complex64Array( [ -3.0, 0.0, -4.0, 0.0 ] ); +var workspace = new Uint8Array( 2 ); +var out = cindexOfRow( 'column-major', 2, 2, A, 2, x, 1, workspace, 1 ); +// returns -1 +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +// Initial arrays: +var A0 = new Complex64Array( [ 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +var x0 = new Complex64Array( [ 0.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +// Create offset views: +var A1 = new Complex64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + +var workspace = new Uint8Array( 0 ); +var out = cindexOfRow( 'row-major', 1, 2, A1, 2, x1, 1, workspace, 1 ); +// returns 0 +``` + + + +#### cindexOfRow.ndarray( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) + + + +Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1+0i, 3+0i ], + [ 2+0i, 4+0i ] + ] +*/ +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +var workspace = new Uint8Array( 2 ); +var out = cindexOfRow.ndarray( 2, 2, A, 1, 2, 0, x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +The function has the following parameters: + +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix stored as a [`Complex64Array`][@stdlib/array/complex64]. +- **strideA1**: stride of the first dimension of `A`. +- **strideA2**: stride of the second dimension of `A`. +- **offsetA**: starting index for `A`. +- **x**: search vector stored as a [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: stride length of `x`. +- **offsetX**: starting index for `x`. +- **workspace**: workspace array stored as a [`Uint8Array`][mdn-uint8array] for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: stride length of `workspace`. +- **offsetW**: starting index for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may provide an empty workspace array. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1+0i, 2+0i ], + [ 3+0i, 4+0i ] + ] +*/ +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +var x = new Complex64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); +var workspace = new Uint8Array( 0 ); +var out = cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +
+ + + + + +
+ +## Notes + +- When searching for a matching row, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same. + +
+ + + + + +
+ +## Examples + + + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' ); + +var shape = [ 2, 2 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = new Complex64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); +console.log( x ); + +var workspace = new Uint8Array( shape[ 0 ] ); + +var out = cindexOfRow( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, workspace, 1 ); +console.log( out ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/cindex_of_row.h" +``` + + + +#### stdlib_strided_cindex_of_row( order, M, N, \*A, LDA, \*X, strideX, \*workspace, strideW ) + + + +Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. + +```c +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" +#include + +const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f, 0.0f, 0.0f }; +const float x[] = { 2.0f, 0.0f, 4.0f, 0.0f }; +uint8_t workspace[ 3 ]; + +int idx = stdlib_strided_cindex_of_row( CblasColMajor, 3, 2, (const stdlib_complex64_t *)A, 3, (const stdlib_complex64_t *)x, 1, workspace, 1 ); +// returns 1 +``` + +The function accepts the following arguments: + +- **order**: `[in] CBLAS_LAYOUT` storage layout. +- **M**: `[in] CBLAS_INT` number of rows in `A`. +- **N**: `[in] CBLAS_INT` number of columns in `A`. +- **A**: `[in] stdlib_complex64_t*` input matrix. +- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **X**: `[in] stdlib_complex64_t*` search vector. +- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **workspace**: `[inout] uint8_t*` workspace array for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: `[in] CBLAS_INT` stride length for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may either provide an empty workspace array or a `NULL` pointer. + +```c +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" + +const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; +const float x[] = { 3.0f, 0.0f, 4.0f, 0.0f }; + +int idx = stdlib_strided_cindex_of_row( CblasRowMajor, 3, 2, (const stdlib_complex64_t *)A, 2, (const stdlib_complex64_t *)x, 1, NULL, 1 ); +// returns 1 +``` + +```c +CBLAS_INT stdlib_strided_cindex_of_row( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT LDA, const stdlib_complex64_t *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ); +``` + + + +#### stdlib_strided_cindex_of_row_ndarray( M, N, \*A, strideA1, strideA2, offsetA, \*X, strideX, offsetX, \*workspace, strideW, offsetW ) + + + +Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + +```c +#include "stdlib/complex/float32/ctor.h" +#include + +const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f, 0.0f, 0.0f }; +const float x[] = { 2.0f, 0.0f, 4.0f, 0.0f }; +uint8_t workspace[ 3 ]; + +int idx = stdlib_strided_cindex_of_row_ndarray( 3, 2, (const stdlib_complex64_t *)A, 1, 3, 0, (const stdlib_complex64_t *)x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +The function accepts the following arguments: + +- **M**: `[in] CBLAS_INT` number of rows in `A`. +- **N**: `[in] CBLAS_INT` number of columns in `A`. +- **A**: `[in] stdlib_complex64_t*` input matrix. +- **strideA1**: `[in] CBLAS_INT` stride of the first dimension of `A`. +- **strideA2**: `[in] CBLAS_INT` stride of the second dimension of `A`. +- **offsetA**: `[in] CBLAS_INT` index offset for `A`. +- **X**: `[in] stdlib_complex64_t*` search vector. +- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **workspace**: `[inout] uint8_t*` workspace array for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: `[in] CBLAS_INT` stride length for `workspace`. +- **offsetW**: `[in] CBLAS_INT` starting index for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may either provide an empty workspace array or a `NULL` pointer. + +```c +#include "stdlib/complex/float32/ctor.h" + +const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; +const float x[] = { 3.0f, 0.0f, 4.0f, 0.0f }; + +int idx = stdlib_strided_cindex_of_row_ndarray( 3, 2, (const stdlib_complex64_t *)A, 2, 1, 0, (const stdlib_complex64_t *)x, 1, 0, NULL, 1, 0 ); +// returns 1 +``` + +```c +CBLAS_INT stdlib_strided_cindex_of_row_ndarray( const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/cindex_of_row.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create a matrix (row-major, 2x2, interleaved real and imaginary components): + const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f }; + + // Create a search vector (interleaved real and imaginary components): + const float x[] = { 3.0f, 0.0f, 4.0f, 0.0f }; + + // Specify the number of matrix rows and columns: + const int M = 2; + const int N = 2; + + // Perform a search: + int idx = stdlib_strided_cindex_of_row( CblasRowMajor, M, N, (const stdlib_complex64_t *)A, N, (const stdlib_complex64_t *)x, 1, NULL, 1 ); + + // Print the result: + printf( "index value: %d\n", idx ); +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.js new file mode 100644 index 000000000000..e6c2c67dc015 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var cindexOfRow = require( './../lib/cindex_of_row.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace; + var abuf; + var xbuf; + var A; + var x; + + workspace = zeros( N, 'uint8' ); + abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( abuf.buffer ); + xbuf = uniform( N*2, 200.0, 300.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cindexOfRow( order, N, N, A, N, x, 1, workspace, 1 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.native.js new file mode 100644 index 000000000000..a3bb2a4ce248 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.native.js @@ -0,0 +1,132 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var cindexOfRow = tryRequire( resolve( __dirname, './../lib/cindex_of_row.native.js' ) ); +var opts = { + 'skip': ( cindexOfRow instanceof Error ) +}; +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace; + var abuf; + var xbuf; + var A; + var x; + + workspace = zeros( N, 'uint8' ); + abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( abuf.buffer ); + xbuf = uniform( N*2, 200.0, 300.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cindexOfRow( order, N, N, A, N, x, 1, workspace, 1 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::native,square_matrix:order=%s,size=%d', pkg, ord, N*N ), opts, f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..5dc9fd0bedf2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.js @@ -0,0 +1,138 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zeros = require( '@stdlib/array/zeros' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var cindexOfRow = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace; + var abuf; + var xbuf; + var A; + var x; + + workspace = zeros( N, 'uint8' ); + abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( abuf.buffer ); + xbuf = uniform( N*2, 200.0, 300.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var sa1; + var sa2; + var z; + var i; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cindexOfRow( N, N, A, sa1, sa2, 0, x, 1, 0, workspace, 1, 0 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:ndarray:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..5269728398de --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,143 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zeros = require( '@stdlib/array/zeros' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var cindexOfRow = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( cindexOfRow instanceof Error ) +}; +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace; + var abuf; + var xbuf; + var A; + var x; + + workspace = zeros( N, 'uint8' ); + abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( abuf.buffer ); + xbuf = uniform( N*2, 200.0, 300.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var sa1; + var sa2; + var z; + var i; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cindexOfRow( N, N, A, sa1, sa2, 0, x, 1, 0, workspace, 1, 0 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::native,square_matrix:ndarray:order=%s,size=%d', pkg, ord, N*N ), opts, f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/c/Makefile similarity index 100% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/benchmark/c/Makefile rename to lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/c/Makefile diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..0dccaec4904f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/benchmark/c/benchmark.length.c @@ -0,0 +1,222 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cindex_of_row.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" +#include +#include +#include +#include +#include +#include + +#define NAME "cindex_of_row" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + uint8_t *workspace; + double elapsed; + double t; + float *A; + float *x; + int idx; + int i; + int j; + + A = (float *)malloc( (size_t)( N*N*2 ) * sizeof( float ) ); + x = (float *)malloc( (size_t)( N*2 ) * sizeof( float ) ); + workspace = (uint8_t *)malloc( (size_t)N * sizeof( uint8_t ) ); + for ( i = 0; i < N*N*2; i++ ) { + A[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; + } + for ( j = 0; j < N*2; j++ ) { + x[ j ] = 20000.0f; + } + idx = -1; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + idx = stdlib_strided_cindex_of_row( CblasRowMajor, N, N, (stdlib_complex64_t *)A, N, (stdlib_complex64_t *)x, 1, workspace, 1 ); + if ( idx < -2 ) { + printf( "unexpected result\n" ); + break; + } + } + elapsed = tic() - t; + if ( idx < -2 ) { + printf( "unexpected result\n" ); + } + free( A ); + free( x ); + free( workspace ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + uint8_t *workspace; + double elapsed; + double t; + float *A; + float *x; + int idx; + int i; + int j; + + A = (float *)malloc( (size_t)( N*N*2 ) * sizeof( float ) ); + x = (float *)malloc( (size_t)( N*2 ) * sizeof( float ) ); + workspace = (uint8_t *)malloc( (size_t)N * sizeof( uint8_t ) ); + for ( i = 0; i < N*N*2; i++ ) { + A[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; + } + for ( j = 0; j < N*2; j++ ) { + x[ j ] = 20000.0f; + } + idx = -1; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + idx = stdlib_strided_cindex_of_row_ndarray( N, N, (stdlib_complex64_t *)A, N, 1, 0, (stdlib_complex64_t *)x, 1, 0, workspace, 1, 0 ); + if ( idx < -2 ) { + printf( "unexpected result\n" ); + break; + } + } + elapsed = tic() - t; + if ( idx < -2 ) { + printf( "unexpected result\n" ); + } + free( A ); + free( x ); + free( workspace ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int N; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + N = (int)sqrt( (double)len ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::native::%s:square_matrix:order=row-major,size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::native::%s:ndarray:square_matrix:order=row-major,size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/repl.txt new file mode 100644 index 000000000000..15c9e6f2e275 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/repl.txt @@ -0,0 +1,123 @@ + +{{alias}}( order, M, N, A, LDA, x, strideX, workspace, strideW ) + Returns the index of the first row in a single-precision complex floating- + point input matrix which has the same elements as a provided search vector. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If the function is provided an empty matrix or if the function is unable to + find a matching row, the function returns `-1` (i.e., an invalid index). + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Complex64Array + Input matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Complex64Array + Search vector. + + strideX: integer + Stride length for `x`. + + workspace: Uint8Array + Workspace array for tracking row match candidates. This parameter + is ignored if the input matrix is stored in row-major order. + + strideW: integer + Stride length for `workspace`. + + Returns + ------- + out: integer + Row index. + + Examples + -------- + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 2.0, 0.0 ] ); + > var x = new {{alias:@stdlib/array/complex64}}( [ 2.0, 0.0 ] ); + > var w = new {{alias:@stdlib/array/uint8}}( 2 ); + > {{alias}}( 'column-major', 2, 1, A, 2, x, 1, w, 1 ) + 1 + + +{{alias}}.ndarray( M, N, A, sa1, sa2, oa, x, sx, ox, w, sw, ow ) + Returns the index of the first row in a single-precision complex floating- + point input matrix which has the same elements as a provided search vector + using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, offset parameters support indexing semantics based on starting + indices. + + If the method is provided an empty matrix or if the method is unable to find + a matching row, the method returns `-1` (i.e., an invalid index). + + Parameters + ---------- + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Complex64Array + Input matrix `A`. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + x: Complex64Array + Search vector. + + sx: integer + Stride length for `x`. + + ox: integer + Starting index for `x`. + + w: Uint8Array + Workspace array for tracking row match candidates. This parameter + is ignored if the input matrix is stored in row-major order. + + sw: integer + Stride length for `w`. + + ow: integer + Starting index for `w`. + + Returns + ------- + out: integer + Row index. + + Examples + -------- + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 2.0, 0.0 ] ); + > var x = new {{alias:@stdlib/array/complex64}}( [ 2.0, 0.0 ] ); + > var w = new {{alias:@stdlib/array/uint8}}( 2 ); + > {{alias}}.ndarray( 2, 1, A, 1, 2, 0, x, 1, 0, w, 1, 0 ) + 1 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/index.d.ts new file mode 100644 index 000000000000..77446642714b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/index.d.ts @@ -0,0 +1,144 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex64Array } from '@stdlib/types/array'; +import { Layout } from '@stdlib/types/blas'; + +/** +* Interface describing `cindexOfRow`. +*/ +interface Routine { + /** + * Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Complex64Array = require( `@stdlib/array/complex64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + */ + ( order: Layout, M: number, N: number, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number, workspace: Uint8Array, strideW: number ): number; + + /** + * Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param x - search vector + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @param offsetW - starting index for `workspace` + * @returns row index + * + * @example + * var Complex64Array = require( `@stdlib/array/complex64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = cindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + ndarray( M: number, N: number, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number, x: Complex64Array, strideX: number, offsetX: number, workspace: Uint8Array, strideW: number, offsetW: number ): number; +} + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param order - storage layout +* @param M - number of rows in `A` +* @param N - number of columns in `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - search vector +* @param strideX - stride length for `x` +* @param workspace - workspace array for tracking row match candidates +* @param strideW - stride length for `workspace` +* @returns row index +* +* @example +* var Complex64Array = require( `@stdlib/array/complex64` ); +* var Uint8Array = require( `@stdlib/array/uint8` ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +* +* @example +* var Complex64Array = require( `@stdlib/array/complex64` ); +* var Uint8Array = require( `@stdlib/array/uint8` ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +declare var cindexOfRow: Routine; + + +// EXPORTS // + +export = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/test.ts new file mode 100644 index 000000000000..275714e5cb04 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/docs/types/test.ts @@ -0,0 +1,404 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 Complex64Array = require( '@stdlib/array/complex64' ); +import cindexOfRow = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, 1 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 5, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( true, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( false, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( null, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( void 0, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( [], 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( {}, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( ( x: number ): number => x, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', '5', 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', true, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', false, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', null, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', void 0, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', [], 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', {}, 2, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', ( x: number ): number => x, 2, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, '5', A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, true, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, false, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, null, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, void 0, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, [], A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, {}, A, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, ( x: number ): number => x, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Complex64Array... +{ + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, 5, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, true, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, false, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, null, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, void 0, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, {}, 2, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, ( x: number ): number => x, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, A, '5', x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, true, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, false, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, null, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, void 0, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, [], x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, {}, x, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, ( x: number ): number => x, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, A, 2, 5, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, true, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, false, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, null, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, void 0, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, {}, 1, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, ( x: number ): number => x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, A, 2, x, '5', w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, true, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, false, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, null, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, void 0, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, [], w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, {}, w, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, ( x: number ): number => x, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Uint8Array... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, 5, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, true, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, false, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, null, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, void 0, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, {}, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, '5' ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, true ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, false ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, null ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, void 0 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, [] ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, {} ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow(); // $ExpectError + cindexOfRow( 'row-major' ); // $ExpectError + cindexOfRow( 'row-major', 2 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1 ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w ); // $ExpectError + cindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, 1, 0 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectType number +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( '5', 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( true, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( false, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( null, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( void 0, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( [], 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( {}, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( ( x: number ): number => x, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, '5', A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, true, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, false, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, null, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, void 0, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, [], A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, {}, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, ( x: number ): number => x, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Complex64Array... +{ + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, 5, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, true, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, false, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, null, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, void 0, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, {}, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, ( x: number ): number => x, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, '5', 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, true, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, false, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, null, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, void 0, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, [], 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, {}, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, ( x: number ): number => x, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, '5', 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, true, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, false, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, null, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, void 0, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, [], 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, {}, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, ( x: number ): number => x, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, '5', x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, true, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, false, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, null, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, void 0, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, [], x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, {}, x, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, ( x: number ): number => x, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a Complex64Array... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, 5, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, true, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, false, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, null, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, void 0, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, {}, 1, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, ( x: number ): number => x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, '5', 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, true, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, false, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, null, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, void 0, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, [], 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, {}, 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, ( x: number ): number => x, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, '5', w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, true, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, false, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, null, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, void 0, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, [], w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, {}, w, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, ( x: number ): number => x, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a Uint8Array... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, 5, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, true, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, false, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, null, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, void 0, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, {}, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, '5', 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, true, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, false, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, null, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, void 0, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, [], 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, {}, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a number... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, '5' ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, true ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, false ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, null ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, void 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, [] ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, {} ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Complex64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + cindexOfRow.ndarray(); // $ExpectError + cindexOfRow.ndarray( 2 ); // $ExpectError + cindexOfRow.ndarray( 2, 2 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1 ); // $ExpectError + cindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0, 0 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/c/Makefile similarity index 100% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/examples/c/Makefile rename to lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/c/Makefile diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/c/example.c new file mode 100644 index 000000000000..53bf355e29e0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/c/example.c @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cindex_of_row.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create a matrix (row-major, 2x2, interleaved real and imaginary components): + const float A[] = { 1.0f, 0.0f, 2.0f, 0.0f, 3.0f, 0.0f, 4.0f, 0.0f }; + + // Create a search vector (interleaved real and imaginary components): + const float x[] = { 3.0f, 0.0f, 4.0f, 0.0f }; + + // Specify the number of matrix rows and columns: + const int M = 2; + const int N = 2; + + // Perform a search: + int idx = stdlib_strided_cindex_of_row( CblasRowMajor, M, N, (const stdlib_complex64_t *)A, N, (const stdlib_complex64_t *)x, 1, NULL, 1 ); + + // Print the result: + printf( "index value: %d\n", idx ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/index.js new file mode 100644 index 000000000000..92227d535908 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/examples/index.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var cindexOfRow = require( './../lib' ); + +var shape = [ 2, 2 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = new Complex64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); +console.log( x ); + +var workspace = new Uint8Array( shape[ 0 ] ); + +var out = cindexOfRow( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, workspace, 1 ); // eslint-disable-line max-len +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_cindex_of_row)( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT LDA, const stdlib_complex64_t *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ); + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_cindex_of_row_ndarray)( const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_BLAS_EXT_BASE_CINDEX_OF_ROW_H diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js new file mode 100644 index 000000000000..f4e54fccb47d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js @@ -0,0 +1,94 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param {string} order - storage layout +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {integer} row index +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +*/ +function cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { + var sa1; + var sa2; + var s; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) ) { + s = N; + } else { + s = M; + } + if ( LDA < max( 1, s ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js new file mode 100644 index 000000000000..5d1e743c5812 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js @@ -0,0 +1,80 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); +var format = require( '@stdlib/string/format' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +* +* @param {string} order - storage layout +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {integer} row index +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +*/ +function cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { + var s; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) ) { + s = N; + } else { + s = M; + } + if ( LDA < max( 1, s ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); + } + return addon( resolveOrder( order ), M, N, reinterpret( A, 0 ), LDA, reinterpret( x, 0 ), strideX, workspace, strideW ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/index.js new file mode 100644 index 000000000000..5d40aa1b8234 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/index.js @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +* +* @module @stdlib/blas/ext/base/cindex-of-row +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* var cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* var cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var cindexOfRow; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + cindexOfRow = main; +} else { + cindexOfRow = tmp; +} + + +// EXPORTS // + +module.exports = cindexOfRow; + +// exports: { "ndarray": "cindexOfRow.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/main.js new file mode 100644 index 000000000000..baccf32ba44d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var cindexOfRow = require( './cindex_of_row.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( cindexOfRow, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/native.js new file mode 100644 index 000000000000..015cd6b429e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var cindexOfRow = require( './cindex_of_row.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( cindexOfRow, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.js new file mode 100644 index 000000000000..5a9af0aedc26 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.js @@ -0,0 +1,164 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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-params, max-len */ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); + + +// MAIN // + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Complex64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @param {NonNegativeInteger} offsetW - index offset for `workspace` +* @returns {integer} row index +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* // A (column-major) => [ [ 1+0i, 3+0i ], [ 2+0i, 4+0i ], [ 0+0i, 0+0i ] ] +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +function cindexOfRow( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) { + var abuf; + var xbuf; + var da0; + var da1; + var S0; + var S1; + var ia; + var iw; + var ix; + var i0; + var i1; + + // Check whether the matrix is an empty matrix... + if ( M <= 0 || N <= 0 ) { + return -1; + } + // Reinterpret the complex input arrays as real-valued arrays of interleaved real and imaginary components: + abuf = reinterpret( A, 0 ); + xbuf = reinterpret( x, 0 ); + + // Adjust the strides and offsets to account for the interleaved storage: + strideA1 *= 2; + strideA2 *= 2; + offsetA *= 2; + strideX *= 2; + offsetX *= 2; + + // Search for the first row matching the search vector... + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + S0 = N; + S1 = M; + + // Scan a row-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA1 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( abuf[ ia ] !== xbuf[ ix ] || abuf[ ia+1 ] !== xbuf[ ix+1 ] ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA2; + ix += strideX; + } + // If we successfully iterated over all columns, then that means we've found a match... + if ( i0 === S0 ) { + return i1; + } + } + // If we've made it here, then no rows match the search vector: + return -1; + } + // Column-major... + S0 = M; + S1 = N; + + // Resolve loop offset (pointer) increments: + da0 = strideA1; + da1 = strideA2 - ( S0*strideA1 ); + + // Initialize the workspace array for tracking which rows contain matching elements: + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + workspace[ iw ] = 1; + iw += strideW; + } + + // Finding the first matching row when a matrix is stored in column-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan down each column (otherwise, if we went row-by-row, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan down the rows in a column looking for a matching element... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( abuf[ ia ] !== xbuf[ ix ] || abuf[ ia+1 ] !== xbuf[ ix+1 ] ) { + // We found a non-matching element, which means we can exclude this row from the list of row candidates... + workspace[ iw ] = 0; + } + ia += da0; + iw += strideW; + } + ia += da1; + ix += strideX; + } + // Search for the first matching row... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( workspace[ iw ] === 1 ) { + break; + } + iw += strideW; + } + return ( i0 === S0 ) ? -1 : i0; +} + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.native.js new file mode 100644 index 000000000000..bffadd1ceaf7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/ndarray.native.js @@ -0,0 +1,66 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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-params, max-len */ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Complex64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @param {NonNegativeInteger} offsetW - index offset for `workspace` +* @returns {integer} row index +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); +* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = cindexOfRow( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +function cindexOfRow( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) { + return addon.ndarray( M, N, reinterpret( A, 0 ), strideA1, strideA2, offsetA, reinterpret( x, 0 ), strideX, offsetX, workspace, strideW, offsetW ); +} + + +// EXPORTS // + +module.exports = cindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/manifest.json new file mode 100644 index 000000000000..747da73d8ec9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/manifest.json @@ -0,0 +1,91 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/real", + "@stdlib/complex/float32/imag", + "@stdlib/strided/base/stride2offset", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d", + "@stdlib/napi/argv-strided-uint8array", + "@stdlib/napi/create-int32" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/real", + "@stdlib/complex/float32/imag", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/real", + "@stdlib/complex/float32/imag", + "@stdlib/strided/base/stride2offset" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/package.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/package.json new file mode 100644 index 000000000000..c94cdd1901b9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/ext/base/cindex-of-row", + "version": "0.0.0", + "description": "Return the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "blas", + "matrix", + "strided", + "array", + "ndarray", + "vector", + "row", + "index", + "search", + "find", + "index-of", + "indexof", + "complex", + "complex64", + "complex64array" + ] +} diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/Makefile similarity index 100% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/src/Makefile rename to lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/Makefile diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/addon.c new file mode 100644 index 000000000000..59b70e044f13 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/addon.c @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cindex_of_row.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int32.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_complex64array.h" +#include "stdlib/napi/argv_strided_complex64array2d.h" +#include "stdlib/napi/argv_strided_uint8array.h" +#include "stdlib/napi/create_int32.h" +#include +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT MW; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 9 ); + STDLIB_NAPI_ARGV_INT32( env, order, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, M, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, LDA, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 6 ); + STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 8 ); + + if ( order == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + MW = M; + } else { // order == CblasRowMajor + sa1 = LDA; + sa2 = 1; + MW = 0; + } + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY2D( env, A, M, N, sa1, sa2, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 5 ); + STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, W, MW, strideW, argv, 7 ); + STDLIB_NAPI_CREATE_INT32( env, API_SUFFIX(stdlib_strided_cindex_of_row)( order, M, N, (stdlib_complex64_t *)A, LDA, (stdlib_complex64_t *)X, strideX, W, strideW ), idx ); + return idx; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + CBLAS_INT MW; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 12 ); + STDLIB_NAPI_ARGV_INT64( env, M, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideA1, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideA2, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, offsetA, argv, 5 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 7 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 10 ); + STDLIB_NAPI_ARGV_INT64( env, offsetW, argv, 11 ); + + // Only validate workspace elements for column-major matrices: + if ( strideA1 < strideA2 ) { + MW = M; + } else { + MW = 0; + } + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY2D( env, A, M, N, strideA1, strideA2, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 6 ); + STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, W, MW, strideW, argv, 9 ); + STDLIB_NAPI_CREATE_INT32( env, API_SUFFIX(stdlib_strided_cindex_of_row_ndarray)( M, N, (stdlib_complex64_t *)A, strideA1, strideA2, offsetA, (stdlib_complex64_t *)X, strideX, offsetX, W, strideW, offsetW ), idx ); + return idx; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/main.c new file mode 100644 index 000000000000..684bfcea30d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/src/main.c @@ -0,0 +1,164 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cindex_of_row.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/blas/base/shared.h" +#include + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. +* +* @param order storage layout +* @param M number of rows in `A` +* @param N number of columns in `A` +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param X search vector +* @param strideX stride length for `X` +* @param workspace workspace array for tracking row match candidates +* @param strideW stride length for `workspace` +* @return row index +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_cindex_of_row)( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT LDA, const stdlib_complex64_t *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT ox; + CBLAS_INT ow; + + if ( order == CblasRowMajor ) { + sa1 = LDA; + sa2 = 1; + } else { // order == CblasColMajor + sa1 = 1; + sa2 = LDA; + } + ox = stdlib_strided_stride2offset( N, strideX ); + ow = stdlib_strided_stride2offset( M, strideW ); + return API_SUFFIX(stdlib_strided_cindex_of_row_ndarray)( M, N, A, sa1, sa2, 0, X, strideX, ox, workspace, strideW, ow ); +} + +/** +* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* @param M number of rows in `A` +* @param N number of columns in `A` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA index offset for `A` +* @param X search vector +* @param strideX stride length for `X` +* @param offsetX starting index for `X` +* @param workspace workspace array for tracking row match candidates +* @param strideW stride length for `workspace` +* @param offsetW starting index for `workspace` +* @return row index +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_cindex_of_row_ndarray)( const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ) { + stdlib_complex64_t va; + stdlib_complex64_t vx; + CBLAS_INT da0; + CBLAS_INT da1; + CBLAS_INT S0; + CBLAS_INT S1; + CBLAS_INT ia; + CBLAS_INT iw; + CBLAS_INT ix; + CBLAS_INT i0; + CBLAS_INT i1; + + // Check whether the matrix is an empty matrix... + if ( M <= 0 || N <= 0 ) { + return -1; + } + // Search for the first row matching the search vector... + if ( strideA1 >= strideA2 ) { + // Row-major... + S0 = N; + S1 = M; + + // Scan a row-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA1 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + va = A[ ia ]; + vx = X[ ix ]; + if ( stdlib_complex64_real( va ) != stdlib_complex64_real( vx ) || stdlib_complex64_imag( va ) != stdlib_complex64_imag( vx ) ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA2; + ix += strideX; + } + // If we successfully iterated over all columns, then that means we've found a match... + if ( i0 == S0 ) { + return i1; + } + } + // If we've made it here, then no rows match the search vector: + return -1; + } + // Column-major... + S0 = M; + S1 = N; + + // Resolve loop offset (pointer) increments: + da0 = strideA1; + da1 = strideA2 - ( S0*strideA1 ); + + // Initialize the workspace array for tracking which rows contain matching elements: + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + workspace[ iw ] = 1; + iw += strideW; + } + + // Finding the first matching row when a matrix is stored in column-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan down each column (otherwise, if we went row-by-row, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan down the rows in a column looking for a matching element... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + va = A[ ia ]; + vx = X[ ix ]; + if ( stdlib_complex64_real( va ) != stdlib_complex64_real( vx ) || stdlib_complex64_imag( va ) != stdlib_complex64_imag( vx ) ) { + // We found a non-matching element, which means we can exclude this row from the list of row candidates... + workspace[ iw ] = 0; + } + ia += da0; + iw += strideW; + } + ia += da1; + ix += strideX; + } + // Search for the first matching row... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( workspace[ iw ] == 1 ) { + break; + } + iw += strideW; + } + return ( i0 == S0 ) ? -1 : i0; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major.json new file mode 100644 index 000000000000..2516430cd379 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 1, + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 3, + 0, + 4, + 0, + 4, + 0, + 0, + 0 + ], + "M": 4, + "N": 2, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "LDA": 4, + "x": [ + 2, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major_no_match.json new file mode 100644 index 000000000000..80f1d75f4eba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/column_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "column-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + "x": [ + 2, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major.json new file mode 100644 index 000000000000..17359fb1cf27 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major.json @@ -0,0 +1,48 @@ +{ + "order": "column-major", + "A": [ + 1, + 0, + 9999, + 0, + 2, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "x": [ + 2, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major_no_match.json new file mode 100644 index 000000000000..d9eb3c4ae322 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/column_major_no_match.json @@ -0,0 +1,48 @@ +{ + "order": "column-major", + "A": [ + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "x": [ + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major.json new file mode 100644 index 000000000000..2f55c8fc8c7e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major.json @@ -0,0 +1,48 @@ +{ + "order": "row-major", + "A": [ + 1, + 0, + 9999, + 0, + 2, + 0, + 9999, + 0, + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "x": [ + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major_no_match.json new file mode 100644 index 000000000000..57e1ee28ba53 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/large-strides/row_major_no_match.json @@ -0,0 +1,48 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0, + 0, + 0, + 9999, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "x": [ + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major.json new file mode 100644 index 000000000000..a5deebbfee34 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 3, + 0, + 4, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "x": [ + 4, + 0, + 9999, + 0, + 2, + 0, + 9999, + 0 + ], + "strideX": -2, + "offsetX": 2, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json new file mode 100644 index 000000000000..bf67233605ee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "x": [ + 4, + 0, + 9999, + 0, + 3, + 0, + 9999, + 0 + ], + "strideX": -2, + "offsetX": 2, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major.json new file mode 100644 index 000000000000..c532893b51bc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 0, + 0, + 3, + 0, + 4, + 0, + 1, + 0, + 2, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "x": [ + 9999, + 0, + 4, + 0, + 9999, + 0, + 3, + 0, + 9999, + 0 + ], + "strideX": -2, + "offsetX": 3, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json new file mode 100644 index 000000000000..2f27c2cedb05 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "x": [ + 9999, + 0, + 4, + 0, + 9999, + 0, + 3, + 0, + 9999, + 0 + ], + "strideX": -2, + "offsetX": 3, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major.json new file mode 100644 index 000000000000..148795457b90 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 0, + 0, + 4, + 0, + 3, + 0, + 0, + 0, + 2, + 0, + 1, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "x": [ + 2, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major_no_match.json new file mode 100644 index 000000000000..60d93fbd27a7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/column_major_no_match.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "x": [ + 2, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major.json new file mode 100644 index 000000000000..b48271bad0f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 0, + 0, + 4, + 0, + 3, + 0, + 2, + 0, + 1, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "x": [ + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major_no_match.json new file mode 100644 index 000000000000..182565cfa50d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/negative-strides/row_major_no_match.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "x": [ + 3, + 0, + 9999, + 0, + 4, + 0, + 9999, + 0 + ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major.json new file mode 100644 index 000000000000..0ce114369508 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 9999, + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 3, + 0, + 4, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "x": [ + 9999, + 0, + 2, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major_no_match.json new file mode 100644 index 000000000000..9c136f0e8ded --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/column_major_no_match.json @@ -0,0 +1,36 @@ +{ + "order": "column-major", + "A": [ + 9999, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "x": [ + 9999, + 0, + 3, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major.json new file mode 100644 index 000000000000..8ee26b57a59c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + "A": [ + 9999, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "x": [ + 9999, + 0, + 3, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major_no_match.json new file mode 100644 index 000000000000..9c162ff7f205 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/offsets/row_major_no_match.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + "A": [ + 9999, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "x": [ + 9999, + 0, + 3, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major.json new file mode 100644 index 000000000000..5b69093877d4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + "A": [ + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 3, + 0, + 4, + 0, + 0, + 0, + 0, + 0 + ], + "M": 4, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "x": [ + 3, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major_no_match.json new file mode 100644 index 000000000000..9396391db82b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/fixtures/row_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "A": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "x": [ + 3, + 0, + 4, + 0 + ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.js new file mode 100644 index 000000000000..51d9ef22880e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.js @@ -0,0 +1,199 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var cindexOfRow = require( './../lib/cindex_of_row.js' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( cindexOfRow.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( value, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), value, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', function test( t ) { + var values; + var data; + var i; + + data = COLUMN_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), value, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, 0, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, 0, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.native.js new file mode 100644 index 000000000000..66a3507d1a4d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.cindex_of_row.native.js @@ -0,0 +1,208 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var cindexOfRow = tryRequire( resolve( __dirname, './../lib/cindex_of_row.native.js' ) ); +var opts = { + 'skip': ( cindexOfRow instanceof Error ) +}; + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', opts, function test( t ) { + t.strictEqual( cindexOfRow.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', opts, function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( value, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', opts, function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), value, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', opts, function test( t ) { + var values; + var data; + var i; + + data = COLUMN_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), value, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, 0, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, 0, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.order, data.M, data.N, new Complex64Array( data.A ), data.LDA, new Complex64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.js new file mode 100644 index 000000000000..31c7a6770fcf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var cindexOfRow = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof cindexOfRow.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var cindexOfRow = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( cindexOfRow, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var cindexOfRow; + var main; + + main = require( './../lib/cindex_of_row.js' ); + + cindexOfRow = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( cindexOfRow, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.js new file mode 100644 index 000000000000..e939caf84490 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.js @@ -0,0 +1,330 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var cindexOfRow = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); +var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); +var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); +var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); +var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( cindexOfRow.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( 0, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.M, 0, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( 0, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, 0, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.native.js new file mode 100644 index 000000000000..9bfb92388f7b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/test/test.ndarray.native.js @@ -0,0 +1,334 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var cindexOfRow = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( cindexOfRow instanceof Error ) +}; + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); +var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); +var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); +var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); +var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( 0, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.M, 0, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( 0, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, 0, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = cindexOfRow( data.M, data.N, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/cone-to/README.md new file mode 100644 index 000000000000..8be6b8821b71 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/README.md @@ -0,0 +1,292 @@ + + +# coneTo + +> Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +
+ +## Usage + +```javascript +var coneTo = require( '@stdlib/blas/ext/base/cone-to' ); +``` + +#### coneTo( N, x, strideX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +coneTo( x.length, x, 1 ); +// x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +coneTo( 3, x, 2 ); +// x => [ 1.0, 0.0, 3.0, 4.0, 2.0, 0.0, 7.0, 8.0, 3.0, 0.0, 11.0, 12.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +// Initial array... +var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +// Create an offset view... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Fill every other element... +coneTo( 3, x1, 2 ); +// x0 => [ 1.0, 2.0, 1.0, 0.0, 5.0, 6.0, 2.0, 0.0, 9.0, 10.0, 3.0, 0.0 ] +``` + +#### coneTo.ndarray( N, x, strideX, offsetX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +coneTo.ndarray( x.length, x, 1, 0 ); +// x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +coneTo.ndarray( 3, x, 1, x.length-3 ); +// x => [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `x` unchanged. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var coneTo = require( '@stdlib/blas/ext/base/cone-to' ); + +var xbuf = discreteUniform( 20, -100, 100, { + 'dtype': 'float32' +}); +var x = new Complex64Array( xbuf.buffer ); +console.log( x ); + +coneTo( x.length, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/cone_to.h" +``` + +#### stdlib_strided_cone_to( N, \*X, strideX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +```c +#include "stdlib/complex/float32/ctor.h" + +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + +stdlib_strided_cone_to( 4, (stdlib_complex64_t *)x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] stdlib_complex64_t*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. + +```c +void API_SUFFIX(stdlib_strided_cone_to)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX ); +``` + +#### stdlib_strided_cone_to_ndarray( N, \*X, strideX, offsetX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + +```c +#include "stdlib/complex/float32/ctor.h" + +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + +stdlib_strided_cone_to_ndarray( 4, (stdlib_complex64_t *)x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] stdlib_complex64_t*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. + +```c +void API_SUFFIX(stdlib_strided_cone_to_ndarray)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/cone_to.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Create a strided array of interleaved real and imaginary components: + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + + // Specify the number of elements: + const int N = 4; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_cone_to( N, (stdlib_complex64_t *)x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %f\n", i, x[ i ] ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.js new file mode 100644 index 000000000000..0a5a6a22f411 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var coneTo = require( './../lib/cone_to.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + coneTo( x.length, x, 1 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.native.js new file mode 100644 index 000000000000..72277e3457a4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.native.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var coneTo = tryRequire( resolve( __dirname, './../lib/cone_to.native.js' ) ); +var opts = { + 'skip': ( coneTo instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + coneTo( x.length, x, 1 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..950a53d61d25 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var coneTo = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + coneTo( x.length, x, 1, 0 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..1d6cc2212d96 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var coneTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( coneTo instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + coneTo( x.length, x, 1, 0 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..a7d990af6122 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/benchmark/c/benchmark.length.c @@ -0,0 +1,196 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cone_to.h" +#include "stdlib/complex/float32/ctor.h" +#include +#include +#include +#include +#include + +#define NAME "cone_to" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int len ) { + double elapsed; + double t; + float *x; + int i; + + x = (float *) malloc( len * 2 * sizeof( float ) ); + for ( i = 0; i < len*2; i += 2 ) { + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + stdlib_strided_cone_to( len, (stdlib_complex64_t *)x, 1 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int len ) { + double elapsed; + double t; + float *x; + int i; + + x = (float *) malloc( len * 2 * sizeof( float ) ); + for ( i = 0; i < len*2; i += 2 ) { + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + stdlib_strided_cone_to_ndarray( len, (stdlib_complex64_t *)x, 1, 0 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:len=%d\n", NAME, len ); + elapsed = benchmark1( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:len=%d\n", NAME, len ); + elapsed = benchmark2( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/cone-to/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/repl.txt new file mode 100644 index 000000000000..2cf17513383e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/repl.txt @@ -0,0 +1,95 @@ + +{{alias}}( N, x, strideX ) + Fills a single-precision complex floating-point strided array with linearly + spaced numeric elements which increment by `1` starting from one. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex64Array + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: Complex64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( x.length, x, 1 ); + > x + [ 1.0, 0.0, 2.0, 0.0 ] + + // Using `N` and stride parameters: + > x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( 2, x, 2 ); + > x + [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 2, x1, 1 ); + > x0 + [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ] + + +{{alias}}.ndarray( N, x, strideX, offsetX ) + Fills a single-precision complex floating-point strided array with linearly + spaced numeric elements which increment by `1` starting from one using + alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex64Array + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: Complex64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( x.length, x, 1, 0 ); + > x + [ 1.0, 0.0, 2.0, 0.0 ] + + // Using an index offset: + > x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( 2, x, 2, 1 ); + > x + [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 2.0, 0.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/index.d.ts new file mode 100644 index 000000000000..291b7cd3eba3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/index.d.ts @@ -0,0 +1,96 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex64Array } from '@stdlib/types/array'; + +/** +* Interface describing `coneTo`. +*/ +interface Routine { + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * coneTo( x.length, x, 1 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + */ + ( N: number, x: Complex64Array, strideX: number ): Complex64Array; + + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * coneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + */ + ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number ): Complex64Array; +} + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param N - number of indexed elements +* @param x - input array +* @param strideX - stride length +* @returns input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo( x.length, x, 1 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ +declare var coneTo: Routine; + + +// EXPORTS // + +export = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/test.ts new file mode 100644 index 000000000000..9cbe50f022f5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/docs/types/test.ts @@ -0,0 +1,158 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 Complex64Array = require( '@stdlib/array/complex64' ); +import coneTo = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + coneTo( x.length, x, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + coneTo( '10', x, 1 ); // $ExpectError + coneTo( true, x, 1 ); // $ExpectError + coneTo( false, x, 1 ); // $ExpectError + coneTo( null, x, 1 ); // $ExpectError + coneTo( undefined, x, 1 ); // $ExpectError + coneTo( [], x, 1 ); // $ExpectError + coneTo( {}, x, 1 ); // $ExpectError + coneTo( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + coneTo( x.length, 10, 1 ); // $ExpectError + coneTo( x.length, '10', 1 ); // $ExpectError + coneTo( x.length, true, 1 ); // $ExpectError + coneTo( x.length, false, 1 ); // $ExpectError + coneTo( x.length, null, 1 ); // $ExpectError + coneTo( x.length, undefined, 1 ); // $ExpectError + coneTo( x.length, [ '1' ], 1 ); // $ExpectError + coneTo( x.length, {}, 1 ); // $ExpectError + coneTo( x.length, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + coneTo( x.length, x, '10' ); // $ExpectError + coneTo( x.length, x, true ); // $ExpectError + coneTo( x.length, x, false ); // $ExpectError + coneTo( x.length, x, null ); // $ExpectError + coneTo( x.length, x, undefined ); // $ExpectError + coneTo( x.length, x, [] ); // $ExpectError + coneTo( x.length, x, {} ); // $ExpectError + coneTo( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + + coneTo(); // $ExpectError + coneTo( x.length ); // $ExpectError + coneTo( x.length, x ); // $ExpectError + coneTo( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray( x.length, x, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray( '10', x, 1, 0 ); // $ExpectError + coneTo.ndarray( true, x, 1, 0 ); // $ExpectError + coneTo.ndarray( false, x, 1, 0 ); // $ExpectError + coneTo.ndarray( null, x, 1, 0 ); // $ExpectError + coneTo.ndarray( undefined, x, 1, 0 ); // $ExpectError + coneTo.ndarray( [], x, 1, 0 ); // $ExpectError + coneTo.ndarray( {}, x, 1, 0 ); // $ExpectError + coneTo.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray( x.length, 10, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, '10', 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, true, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, false, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, null, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, [ '1' ], 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, {}, 1, 0 ); // $ExpectError + coneTo.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray( x.length, x, '10', 0 ); // $ExpectError + coneTo.ndarray( x.length, x, true, 0 ); // $ExpectError + coneTo.ndarray( x.length, x, false, 0 ); // $ExpectError + coneTo.ndarray( x.length, x, null, 0 ); // $ExpectError + coneTo.ndarray( x.length, x, undefined, 0 ); // $ExpectError + coneTo.ndarray( x.length, x, [], 0 ); // $ExpectError + coneTo.ndarray( x.length, x, {}, 0 ); // $ExpectError + coneTo.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray( x.length, x, 1, '10' ); // $ExpectError + coneTo.ndarray( x.length, x, 1, true ); // $ExpectError + coneTo.ndarray( x.length, x, 1, false ); // $ExpectError + coneTo.ndarray( x.length, x, 1, null ); // $ExpectError + coneTo.ndarray( x.length, x, 1, undefined ); // $ExpectError + coneTo.ndarray( x.length, x, 1, [] ); // $ExpectError + coneTo.ndarray( x.length, x, 1, {} ); // $ExpectError + coneTo.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + + coneTo.ndarray(); // $ExpectError + coneTo.ndarray( x.length ); // $ExpectError + coneTo.ndarray( x.length, x ); // $ExpectError + coneTo.ndarray( x.length, x, 1 ); // $ExpectError + coneTo.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/example.c new file mode 100644 index 000000000000..d6f1fe30376c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/c/example.c @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cone_to.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Create a strided array of interleaved real and imaginary components: + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + + // Specify the number of elements: + const int N = 4; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_cone_to( N, (stdlib_complex64_t *)x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %f\n", i, x[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/index.js new file mode 100644 index 000000000000..45ec03abba44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/examples/index.js @@ -0,0 +1,32 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 Complex64Array = require( '@stdlib/array/complex64' ); +var coneTo = require( './../lib' ); + +var xbuf = discreteUniform( 20, -100, 100, { + 'dtype': 'float32' +}); +var x = new Complex64Array( xbuf.buffer ); +console.log( x ); + +coneTo( x.length, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/cone-to/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ +function coneTo( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/cone_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/cone_to.native.js new file mode 100644 index 000000000000..2caa720f8f61 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/cone_to.native.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo( x.length, x, 1 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ +function coneTo( N, x, strideX ) { + var view = reinterpret( x, 0 ); + addon( N, view, strideX ); + return x; +} + + +// EXPORTS // + +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/index.js new file mode 100644 index 000000000000..e2d2fca6fb5a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @module @stdlib/blas/ext/base/cone-to +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var coneTo = require( '@stdlib/blas/ext/base/cone-to' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo( x.length, x, 1 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var coneTo = require( '@stdlib/blas/ext/base/cone-to' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var coneTo; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + coneTo = main; +} else { + coneTo = tmp; +} + + +// EXPORTS // + +module.exports = coneTo; + +// exports: { "ndarray": "coneTo.ndarray" } diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/main.js similarity index 86% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/main.js rename to lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/main.js index 531f2ad91dc6..b9ed3ef09ab7 100644 --- a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/main.js @@ -21,15 +21,15 @@ // MODULES // var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var dchebychev = require( './dchebychev.js' ); +var coneTo = require( './cone_to.js' ); var ndarray = require( './ndarray.js' ); // MAIN // -setReadOnly( dchebychev, 'ndarray', ndarray ); +setReadOnly( coneTo, 'ndarray', ndarray ); // EXPORTS // -module.exports = dchebychev; +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/native.js similarity index 86% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/native.js rename to lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/native.js index 0d2aab399fa7..64d806086c57 100644 --- a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/lib/native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/native.js @@ -21,15 +21,15 @@ // MODULES // var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var dchebychev = require( './dchebychev.native.js' ); +var coneTo = require( './cone_to.native.js' ); var ndarray = require( './ndarray.native.js' ); // MAIN // -setReadOnly( dchebychev, 'ndarray', ndarray ); +setReadOnly( coneTo, 'ndarray', ndarray ); // EXPORTS // -module.exports = dchebychev; +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.js new file mode 100644 index 000000000000..02451f7ace34 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.js @@ -0,0 +1,71 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo( x.length, x, 1, 0 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ +function coneTo( N, x, strideX, offsetX ) { + var view; + var ix; + var i; + + if ( N <= 0 ) { + return x; + } + // Reinterpret the complex input array as a real-valued array: + view = reinterpret( x, 0 ); + + // Adjust the stride and offset according to real-valued array: + ix = offsetX * 2; + strideX *= 2; + + for ( i = 1; i <= N; i++ ) { + view[ ix ] = i; + view[ ix+1 ] = 0; + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.native.js new file mode 100644 index 000000000000..e3a149a556dd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/lib/ndarray.native.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* coneTo( x.length, x, 1, 0 ); +* // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] +*/ +function coneTo( N, x, strideX, offsetX ) { + var view = reinterpret( x, 0 ); + addon.ndarray( N, view, strideX, offsetX ); + return x; +} + + +// EXPORTS // + +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/cone-to/manifest.json new file mode 100644 index 000000000000..31c3e0a126ad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/manifest.json @@ -0,0 +1,81 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-complex64array" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/cone-to/package.json new file mode 100644 index 000000000000..2957b1c93482 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/blas/ext/base/cone-to", + "version": "0.0.0", + "description": "Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "assign", + "set", + "one-to", + "oneto", + "sequence", + "seq", + "strided", + "complex64", + "array", + "complex64array", + "ndarray" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/addon.c new file mode 100644 index 000000000000..c35cecc11f3c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/addon.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cone_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_complex64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_cone_to)( N, (stdlib_complex64_t *)X, strideX ); + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_cone_to_ndarray)( N, (stdlib_complex64_t *)X, strideX, offsetX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/main.c new file mode 100644 index 000000000000..0eef99331096 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/src/main.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/cone_to.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/blas/base/shared.h" + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +*/ +void API_SUFFIX(stdlib_strided_cone_to)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX ) { + CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); + API_SUFFIX(stdlib_strided_cone_to_ndarray)( N, X, strideX, ox ); +} + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +* @param offsetX starting index +*/ +void API_SUFFIX(stdlib_strided_cone_to_ndarray)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + CBLAS_INT ix; + CBLAS_INT i; + float v; + + if ( N <= 0 ) { + return; + } + ix = offsetX; + v = 1.0f; + for ( i = 0; i < N; i++ ) { + X[ ix ] = stdlib_complex64( v, 0.0f ); + v += 1.0f; + ix += strideX; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.js new file mode 100644 index 000000000000..7f2276ec7788 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var coneTo = require( './../lib/cone_to.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( coneTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = coneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + coneTo( 0, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + coneTo( -4, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0, + 4.0, + 0.0 + ]); + + coneTo( x.length, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 2.0, // 1 + 0.0 // 1 + ]); + + coneTo( 2, x, 2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -5.0, + 6.0, // 0 + -7.0 // 0 + ]); + expected = new Complex64Array([ + 2.0, // 1 + 0.0, // 1 + 4.0, + -5.0, + 1.0, // 0 + 0.0 // 0 + ]); + + coneTo( 2, x, -2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, + -8.0, + 10.0, // 1 + -12.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 1.0, // 0 + 0.0, // 0 + 6.0, + -8.0, + 2.0, // 1 + 0.0 // 1 + ]); + + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + coneTo( 2, x1, 2 ); + t.strictEqual( isSameComplex64Array( x0, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.native.js new file mode 100644 index 000000000000..3aaf54ae414c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.cone_to.native.js @@ -0,0 +1,192 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var coneTo = tryRequire( resolve( __dirname, './../lib/cone_to.native.js' ) ); +var opts = { + 'skip': ( coneTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', opts, function test( t ) { + t.strictEqual( coneTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = coneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + coneTo( 0, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + coneTo( -4, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0, + 4.0, + 0.0 + ]); + + coneTo( x.length, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 2.0, // 1 + 0.0 // 1 + ]); + + coneTo( 2, x, 2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -5.0, + 6.0, // 0 + -7.0 // 0 + ]); + expected = new Complex64Array([ + 2.0, // 1 + 0.0, // 1 + 4.0, + -5.0, + 1.0, // 0 + 0.0 // 0 + ]); + + coneTo( 2, x, -2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', opts, function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, + -8.0, + 10.0, // 1 + -12.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 1.0, // 0 + 0.0, // 0 + 6.0, + -8.0, + 2.0, // 1 + 0.0 // 1 + ]); + + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + coneTo( 2, x1, 2 ); + t.strictEqual( isSameComplex64Array( x0, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.js new file mode 100644 index 000000000000..ebdebf3b704d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var coneTo = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof coneTo.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var coneTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( coneTo, mock, 'returns native implementation' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var coneTo; + var main; + + main = require( './../lib/cone_to.js' ); + + coneTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( coneTo, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.js new file mode 100644 index 000000000000..88c0ad7627a3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var coneTo = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( coneTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = coneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + coneTo( 0, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + coneTo( -4, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0, + 4.0, + 0.0 + ]); + + coneTo( x.length, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 2.0, // 1 + 0.0 // 1 + ]); + + coneTo( 2, x, 2, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -6.0, + 8.0, // 0 + -9.0 // 0 + ]); + expected = new Complex64Array([ + 2.0, // 1 + 0.0, // 1 + 4.0, + -6.0, + 1.0, // 0 + 0.0 // 0 + ]); + + coneTo( 2, x, -2, x.length-1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, // 1 + -8.0, // 1 + 10.0, + -12.0 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 1.0, // 0 + 0.0, // 0 + 2.0, // 1 + 0.0, // 1 + 10.0, + -12.0 + ]); + + coneTo( 2, x, 1, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.native.js new file mode 100644 index 000000000000..3c285dcdcf44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/cone-to/test/test.ndarray.native.js @@ -0,0 +1,189 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var coneTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( coneTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', opts, function test( t ) { + t.strictEqual( coneTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = coneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + coneTo( 0, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + coneTo( -4, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0, + 4.0, + 0.0 + ]); + + coneTo( x.length, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 2.0, // 1 + 0.0 // 1 + ]); + + coneTo( 2, x, 2, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -6.0, + 8.0, // 0 + -9.0 // 0 + ]); + expected = new Complex64Array([ + 2.0, // 1 + 0.0, // 1 + 4.0, + -6.0, + 1.0, // 0 + 0.0 // 0 + ]); + + coneTo( 2, x, -2, x.length-1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, // 1 + -8.0, // 1 + 10.0, + -12.0 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 1.0, // 0 + 0.0, // 0 + 2.0, // 1 + 0.0, // 1 + 10.0, + -12.0 + ]); + + coneTo( 2, x, 1, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/czero-to/README.md new file mode 100644 index 000000000000..e733744cc467 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/README.md @@ -0,0 +1,292 @@ + + +# czeroTo + +> Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +
+ +## Usage + +```javascript +var czeroTo = require( '@stdlib/blas/ext/base/czero-to' ); +``` + +#### czeroTo( N, x, strideX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +czeroTo( x.length, x, 1 ); +// x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +czeroTo( 3, x, 2 ); +// x => [ 0.0, 0.0, 3.0, 4.0, 1.0, 0.0, 7.0, 8.0, 2.0, 0.0, 11.0, 12.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +// Initial array... +var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +// Create an offset view... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Fill every other element... +czeroTo( 3, x1, 2 ); +// x0 => [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 1.0, 0.0, 9.0, 10.0, 2.0, 0.0 ] +``` + +#### czeroTo.ndarray( N, x, strideX, offsetX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +czeroTo.ndarray( x.length, x, 1, 0 ); +// x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +czeroTo.ndarray( 3, x, 1, x.length-3 ); +// x => [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `x` unchanged. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var czeroTo = require( '@stdlib/blas/ext/base/czero-to' ); + +var xbuf = discreteUniform( 20, -100, 100, { + 'dtype': 'float32' +}); +var x = new Complex64Array( xbuf.buffer ); +console.log( x ); + +czeroTo( x.length, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/czero_to.h" +``` + +#### stdlib_strided_czero_to( N, \*X, strideX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +```c +#include "stdlib/complex/float32/ctor.h" + +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + +stdlib_strided_czero_to( 4, (stdlib_complex64_t *)x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] stdlib_complex64_t*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. + +```c +void API_SUFFIX(stdlib_strided_czero_to)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX ); +``` + +#### stdlib_strided_czero_to_ndarray( N, \*X, strideX, offsetX ) + +Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + +```c +#include "stdlib/complex/float32/ctor.h" + +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + +stdlib_strided_czero_to_ndarray( 4, (stdlib_complex64_t *)x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] stdlib_complex64_t*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. + +```c +void API_SUFFIX(stdlib_strided_czero_to_ndarray)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/czero_to.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Create a strided array of interleaved real and imaginary components: + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + + // Specify the number of elements: + const int N = 4; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_czero_to( N, (stdlib_complex64_t *)x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %f\n", i, x[ i ] ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.js new file mode 100644 index 000000000000..7485f0148669 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var czeroTo = require( './../lib/czero_to.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + czeroTo( x.length, x, 1 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.native.js new file mode 100644 index 000000000000..349e7049fa50 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.native.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var czeroTo = tryRequire( resolve( __dirname, './../lib/czero_to.native.js' ) ); +var opts = { + 'skip': ( czeroTo instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + czeroTo( x.length, x, 1 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..f9a9c1d8e968 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var czeroTo = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + czeroTo( x.length, x, 1, 0 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..8e2a657621a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var czeroTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( czeroTo instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + czeroTo( x.length, x, 1, 0 ); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( xbuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..82e1c3e332ce --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/benchmark/c/benchmark.length.c @@ -0,0 +1,196 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/czero_to.h" +#include "stdlib/complex/float32/ctor.h" +#include +#include +#include +#include +#include + +#define NAME "czero_to" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int len ) { + double elapsed; + double t; + float *x; + int i; + + x = (float *) malloc( len * 2 * sizeof( float ) ); + for ( i = 0; i < len*2; i += 2 ) { + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + stdlib_strided_czero_to( len, (stdlib_complex64_t *)x, 1 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int len ) { + double elapsed; + double t; + float *x; + int i; + + x = (float *) malloc( len * 2 * sizeof( float ) ); + for ( i = 0; i < len*2; i += 2 ) { + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + stdlib_strided_czero_to_ndarray( len, (stdlib_complex64_t *)x, 1, 0 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:len=%d\n", NAME, len ); + elapsed = benchmark1( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:len=%d\n", NAME, len ); + elapsed = benchmark2( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/czero-to/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/repl.txt new file mode 100644 index 000000000000..622a12ca515c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/repl.txt @@ -0,0 +1,95 @@ + +{{alias}}( N, x, strideX ) + Fills a single-precision complex floating-point strided array with linearly + spaced numeric elements which increment by `1` starting from zero. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex64Array + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: Complex64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( x.length, x, 1 ); + > x + [ 0.0, 0.0, 1.0, 0.0 ] + + // Using `N` and stride parameters: + > x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( 2, x, 2 ); + > x + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 2, x1, 1 ); + > x0 + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] + + +{{alias}}.ndarray( N, x, strideX, offsetX ) + Fills a single-precision complex floating-point strided array with linearly + spaced numeric elements which increment by `1` starting from zero using + alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex64Array + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: Complex64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( x.length, x, 1, 0 ); + > x + [ 0.0, 0.0, 1.0, 0.0 ] + + // Using an index offset: + > x = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( 2, x, 2, 1 ); + > x + [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/index.d.ts new file mode 100644 index 000000000000..030398de3053 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/index.d.ts @@ -0,0 +1,96 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex64Array } from '@stdlib/types/array'; + +/** +* Interface describing `czeroTo`. +*/ +interface Routine { + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * czeroTo( x.length, x, 1 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + */ + ( N: number, x: Complex64Array, strideX: number ): Complex64Array; + + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * czeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + */ + ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number ): Complex64Array; +} + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param N - number of indexed elements +* @param x - input array +* @param strideX - stride length +* @returns input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo( x.length, x, 1 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ +declare var czeroTo: Routine; + + +// EXPORTS // + +export = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/test.ts new file mode 100644 index 000000000000..22b900f96b57 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/docs/types/test.ts @@ -0,0 +1,158 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 Complex64Array = require( '@stdlib/array/complex64' ); +import czeroTo = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + czeroTo( x.length, x, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + czeroTo( '10', x, 1 ); // $ExpectError + czeroTo( true, x, 1 ); // $ExpectError + czeroTo( false, x, 1 ); // $ExpectError + czeroTo( null, x, 1 ); // $ExpectError + czeroTo( undefined, x, 1 ); // $ExpectError + czeroTo( [], x, 1 ); // $ExpectError + czeroTo( {}, x, 1 ); // $ExpectError + czeroTo( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + czeroTo( x.length, 10, 1 ); // $ExpectError + czeroTo( x.length, '10', 1 ); // $ExpectError + czeroTo( x.length, true, 1 ); // $ExpectError + czeroTo( x.length, false, 1 ); // $ExpectError + czeroTo( x.length, null, 1 ); // $ExpectError + czeroTo( x.length, undefined, 1 ); // $ExpectError + czeroTo( x.length, [ '1' ], 1 ); // $ExpectError + czeroTo( x.length, {}, 1 ); // $ExpectError + czeroTo( x.length, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + czeroTo( x.length, x, '10' ); // $ExpectError + czeroTo( x.length, x, true ); // $ExpectError + czeroTo( x.length, x, false ); // $ExpectError + czeroTo( x.length, x, null ); // $ExpectError + czeroTo( x.length, x, undefined ); // $ExpectError + czeroTo( x.length, x, [] ); // $ExpectError + czeroTo( x.length, x, {} ); // $ExpectError + czeroTo( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + + czeroTo(); // $ExpectError + czeroTo( x.length ); // $ExpectError + czeroTo( x.length, x ); // $ExpectError + czeroTo( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray( x.length, x, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray( '10', x, 1, 0 ); // $ExpectError + czeroTo.ndarray( true, x, 1, 0 ); // $ExpectError + czeroTo.ndarray( false, x, 1, 0 ); // $ExpectError + czeroTo.ndarray( null, x, 1, 0 ); // $ExpectError + czeroTo.ndarray( undefined, x, 1, 0 ); // $ExpectError + czeroTo.ndarray( [], x, 1, 0 ); // $ExpectError + czeroTo.ndarray( {}, x, 1, 0 ); // $ExpectError + czeroTo.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray( x.length, 10, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, '10', 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, true, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, false, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, null, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, [ '1' ], 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, {}, 1, 0 ); // $ExpectError + czeroTo.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray( x.length, x, '10', 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, true, 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, false, 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, null, 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, undefined, 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, [], 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, {}, 0 ); // $ExpectError + czeroTo.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray( x.length, x, 1, '10' ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, true ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, false ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, null ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, undefined ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, [] ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, {} ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + + czeroTo.ndarray(); // $ExpectError + czeroTo.ndarray( x.length ); // $ExpectError + czeroTo.ndarray( x.length, x ); // $ExpectError + czeroTo.ndarray( x.length, x, 1 ); // $ExpectError + czeroTo.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/example.c new file mode 100644 index 000000000000..6826c34e61e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/c/example.c @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/czero_to.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Create a strided array of interleaved real and imaginary components: + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + + // Specify the number of elements: + const int N = 4; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_czero_to( N, (stdlib_complex64_t *)x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %f\n", i, x[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/index.js new file mode 100644 index 000000000000..10f5388b4d82 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/examples/index.js @@ -0,0 +1,32 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 Complex64Array = require( '@stdlib/array/complex64' ); +var czeroTo = require( './../lib' ); + +var xbuf = discreteUniform( 20, -100, 100, { + 'dtype': 'float32' +}); +var x = new Complex64Array( xbuf.buffer ); +console.log( x ); + +czeroTo( x.length, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/czero-to/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ +function czeroTo( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/czero_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/czero_to.native.js new file mode 100644 index 000000000000..33512829677d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/czero_to.native.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo( x.length, x, 1 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ +function czeroTo( N, x, strideX ) { + var view = reinterpret( x, 0 ); + addon( N, view, strideX ); + return x; +} + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/index.js new file mode 100644 index 000000000000..81fff6863e10 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @module @stdlib/blas/ext/base/czero-to +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var czeroTo = require( '@stdlib/blas/ext/base/czero-to' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo( x.length, x, 1 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var czeroTo = require( '@stdlib/blas/ext/base/czero-to' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var czeroTo; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + czeroTo = main; +} else { + czeroTo = tmp; +} + + +// EXPORTS // + +module.exports = czeroTo; + +// exports: { "ndarray": "czeroTo.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/main.js new file mode 100644 index 000000000000..8dbf1e449b58 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var czeroTo = require( './czero_to.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( czeroTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/native.js new file mode 100644 index 000000000000..d8d364fd0c32 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var czeroTo = require( './czero_to.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( czeroTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.js new file mode 100644 index 000000000000..0f4a3e4347eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.js @@ -0,0 +1,71 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo( x.length, x, 1, 0 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ +function czeroTo( N, x, strideX, offsetX ) { + var view; + var ix; + var i; + + if ( N <= 0 ) { + return x; + } + // Reinterpret the complex input array as a real-valued array: + view = reinterpret( x, 0 ); + + // Adjust the stride and offset according to real-valued array: + ix = offsetX * 2; + strideX *= 2; + + for ( i = 0; i < N; i++ ) { + view[ ix ] = i; + view[ ix+1 ] = 0; + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.native.js new file mode 100644 index 000000000000..1597088bedb5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/lib/ndarray.native.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Complex64Array} input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* +* czeroTo( x.length, x, 1, 0 ); +* // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +*/ +function czeroTo( N, x, strideX, offsetX ) { + var view = reinterpret( x, 0 ); + addon.ndarray( N, view, strideX, offsetX ); + return x; +} + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/czero-to/manifest.json new file mode 100644 index 000000000000..31c3e0a126ad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/manifest.json @@ -0,0 +1,81 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-complex64array" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/complex/float32/ctor" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/czero-to/package.json new file mode 100644 index 000000000000..d03bc3f96a6f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/blas/ext/base/czero-to", + "version": "0.0.0", + "description": "Fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "assign", + "set", + "zero-to", + "zeroto", + "sequence", + "seq", + "strided", + "complex64", + "array", + "complex64array", + "ndarray" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/addon.c new file mode 100644 index 000000000000..b3debf29def1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/addon.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/czero_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_complex64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_czero_to)( N, (stdlib_complex64_t *)X, strideX ); + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_czero_to_ndarray)( N, (stdlib_complex64_t *)X, strideX, offsetX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/main.c new file mode 100644 index 000000000000..b1e7159aa597 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/src/main.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/czero_to.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/blas/base/shared.h" + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +*/ +void API_SUFFIX(stdlib_strided_czero_to)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX ) { + CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); + API_SUFFIX(stdlib_strided_czero_to_ndarray)( N, X, strideX, ox ); +} + +/** +* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +* @param offsetX starting index +*/ +void API_SUFFIX(stdlib_strided_czero_to_ndarray)( const CBLAS_INT N, stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + CBLAS_INT ix; + CBLAS_INT i; + float v; + + if ( N <= 0 ) { + return; + } + ix = offsetX; + v = 0.0f; + for ( i = 0; i < N; i++ ) { + X[ ix ] = stdlib_complex64( v, 0.0f ); + v += 1.0f; + ix += strideX; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.js new file mode 100644 index 000000000000..7a892bbad914 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var czeroTo = require( './../lib/czero_to.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( czeroTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = czeroTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + czeroTo( 0, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + czeroTo( -4, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 0.0, + 0.0, + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0 + ]); + + czeroTo( x.length, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 1.0, // 1 + 0.0 // 1 + ]); + + czeroTo( 2, x, 2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -5.0, + 6.0, // 0 + -7.0 // 0 + ]); + expected = new Complex64Array([ + 1.0, // 1 + 0.0, // 1 + 4.0, + -5.0, + 0.0, // 0 + 0.0 // 0 + ]); + + czeroTo( 2, x, -2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, + -8.0, + 10.0, // 1 + -12.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 0.0, // 0 + 0.0, // 0 + 6.0, + -8.0, + 1.0, // 1 + 0.0 // 1 + ]); + + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + czeroTo( 2, x1, 2 ); + t.strictEqual( isSameComplex64Array( x0, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.native.js new file mode 100644 index 000000000000..f4a5ff6fad06 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.czero_to.native.js @@ -0,0 +1,192 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var czeroTo = tryRequire( resolve( __dirname, './../lib/czero_to.native.js' ) ); +var opts = { + 'skip': ( czeroTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', opts, function test( t ) { + t.strictEqual( czeroTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = czeroTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + czeroTo( 0, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + czeroTo( -4, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 0.0, + 0.0, + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0 + ]); + + czeroTo( x.length, x, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 1.0, // 1 + 0.0 // 1 + ]); + + czeroTo( 2, x, 2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -5.0, + 6.0, // 0 + -7.0 // 0 + ]); + expected = new Complex64Array([ + 1.0, // 1 + 0.0, // 1 + 4.0, + -5.0, + 0.0, // 0 + 0.0 // 0 + ]); + + czeroTo( 2, x, -2 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', opts, function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, + -8.0, + 10.0, // 1 + -12.0 // 1 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 0.0, // 0 + 0.0, // 0 + 6.0, + -8.0, + 1.0, // 1 + 0.0 // 1 + ]); + + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + czeroTo( 2, x1, 2 ); + t.strictEqual( isSameComplex64Array( x0, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.js new file mode 100644 index 000000000000..69ea17d2b58f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var czeroTo = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof czeroTo.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var czeroTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( czeroTo, mock, 'returns native implementation' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var czeroTo; + var main; + + main = require( './../lib/czero_to.js' ); + + czeroTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( czeroTo, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.js new file mode 100644 index 000000000000..9930574244b7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var czeroTo = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( czeroTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = czeroTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + czeroTo( 0, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + czeroTo( -4, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 0.0, + 0.0, + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0 + ]); + + czeroTo( x.length, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 1.0, // 1 + 0.0 // 1 + ]); + + czeroTo( 2, x, 2, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -6.0, + 8.0, // 0 + -9.0 // 0 + ]); + expected = new Complex64Array([ + 1.0, // 1 + 0.0, // 1 + 4.0, + -6.0, + 0.0, // 0 + 0.0 // 0 + ]); + + czeroTo( 2, x, -2, x.length-1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, // 1 + -8.0, // 1 + 10.0, + -12.0 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 0.0, // 0 + 0.0, // 0 + 1.0, // 1 + 0.0, // 1 + 10.0, + -12.0 + ]); + + czeroTo( 2, x, 1, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.native.js new file mode 100644 index 000000000000..3476de423fad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/czero-to/test/test.ndarray.native.js @@ -0,0 +1,189 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var czeroTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( czeroTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', opts, function test( t ) { + t.strictEqual( czeroTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + out = czeroTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + expected = new Complex64Array( [ 3.0, -4.0, 1.0, -2.0 ] ); + + czeroTo( 0, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + czeroTo( -4, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Complex64Array([ + 0.0, + 0.0, + 1.0, + 0.0, + 2.0, + 0.0, + 3.0, + 0.0 + ]); + + czeroTo( x.length, x, 1, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 0 + -3.0, // 0 + 4.0, + -6.0, + 8.0, // 1 + -9.0 // 1 + ]); + expected = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 4.0, + -6.0, + 1.0, // 1 + 0.0 // 1 + ]); + + czeroTo( 2, x, 2, 0 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 2.0, // 1 + -3.0, // 1 + 4.0, + -6.0, + 8.0, // 0 + -9.0 // 0 + ]); + expected = new Complex64Array([ + 1.0, // 1 + 0.0, // 1 + 4.0, + -6.0, + 0.0, // 0 + 0.0 // 0 + ]); + + czeroTo( 2, x, -2, x.length-1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', opts, function test( t ) { + var expected; + var x; + + x = new Complex64Array([ + 1.0, + -2.0, + 3.0, // 0 + -4.0, // 0 + 6.0, // 1 + -8.0, // 1 + 10.0, + -12.0 + ]); + expected = new Complex64Array([ + 1.0, + -2.0, + 0.0, // 0 + 0.0, // 0 + 1.0, // 1 + 0.0, // 1 + 10.0, + -12.0 + ]); + + czeroTo( 2, x, 1, 1 ); + t.strictEqual( isSameComplex64Array( x, expected ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js index ba66548b94af..a74f54df3f7d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapx = require( './../lib/dapx.js' ); @@ -79,6 +80,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -92,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js index 14b5a651b6bd..8900a4776a89 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -84,6 +85,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -97,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js index e7d849e6c668..6222d1f3c601 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapx = require( './../lib/ndarray.js' ); @@ -79,6 +80,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -92,7 +98,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js index e1040395c759..f8ec4213c54f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -84,6 +85,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -97,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.js index c40ff95a0963..93c75d9b04ad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsum = require( './../lib/dapxsum.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.native.js index ee30c95ac28b..94e573caa7c7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.js index d1a6baa4b1a4..0f2b4c42e456 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsum = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.native.js index 3841db2adbee..95d4a4013b25 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsum/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.js index 957b2df3ef07..82b6b788fdc3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumkbn = require( './../lib/dapxsumkbn.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.native.js index 64cb0e53a7fa..29014deea534 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.native.js @@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.js index a7447c074caa..66efced30274 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumkbn = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.native.js index 9c4f4d320421..61a0675c5694 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/benchmark/benchmark.ndarray.native.js @@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.js index fedecd391a98..37613cbbccf0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumkbn2 = require( './../lib/dapxsumkbn2.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.native.js index f6724d3e381a..0958fb4dda3a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.js index 88a7dc9e517e..91fd17633cc7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumkbn2 = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.native.js index ea6d8e8a5aa1..46deda49288f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/c/benchmark.length.c index 667e7e48838b..e6b62c3795b1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn2/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.js index 5b088d0909fc..9bf0c032c59c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumors = require( './../lib/dapxsumors.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.native.js index 8ef69ee57312..68ada54dd772 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.js index 9eae5acb1fa6..f9390552c917 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumors = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.native.js index 38e3d9361a31..72ae6c3d902c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumors/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.js index 60ad8fd66f14..86f261715743 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumpw = require( './../lib/dapxsumpw.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.native.js index a8673cd4af74..20de1e34dbf5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.js index 5249de78a36f..7e6be3276088 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dapxsumpw = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.native.js index 026bf0dd053f..6f0ba0637392 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/c/benchmark.length.c index 4158d15fc586..3e55f77beb80 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumpw/benchmark/c/benchmark.length.c @@ -132,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -154,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js index 275808ebbd5e..43b653ba87ab 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasumpw = require( './../lib/dasumpw.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js index e4c972b0e0b2..a647ba0c15fb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js index 137a8201e9da..89a89e49cc50 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dasumpw = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js index 471632731d39..43ad7961c94e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/c/benchmark.length.c index 9b96bcecb0a3..7f72a470b851 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/README.md b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/README.md new file mode 100644 index 000000000000..5daafc5df22f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/README.md @@ -0,0 +1,292 @@ + + +# dcircshift + +> Circularly shift the elements of a double-precision floating-point strided array by a specified number of positions. + +
+ +## Usage + +```javascript +var dcircshift = require( '@stdlib/blas/ext/base/dcircshift' ); +``` + +#### dcircshift( N, k, x, strideX ) + +Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +dcircshift( x.length, 2, x, 1 ); +// x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **k**: number of positions to shift. +- **x**: input [`Float64Array`][@stdlib/array/float64]. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to circularly shift every other element: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + +dcircshift( 4, 1, x, 2 ); +// x => [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array... +var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +// Create an offset view... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Circularly shift elements in the view: +dcircshift( 5, 2, x1, 1 ); +// x0 => [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +#### dcircshift.ndarray( N, k, x, strideX, offsetX ) + +Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +dcircshift.ndarray( x.length, 2, x, 1, 0 ); +// x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + +dcircshift.ndarray( 3, 1, x, 1, x.length-3 ); +// x => [ 1.0, 2.0, 3.0, 6.0, 4.0, 5.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return the strided array unchanged. +- If `k` is a multiple of `N`, both functions return the strided array unchanged. +- If `k > 0`, elements are shifted to the right. +- If `k < 0`, elements are shifted to the left. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dcircshift = require( '@stdlib/blas/ext/base/dcircshift' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +dcircshift( x.length, 3, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/dcircshift.h" +``` + +#### stdlib_strided_dcircshift( N, k, \*X, strideX ) + +Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. + +```c +double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0 }; + +stdlib_strided_dcircshift( 5, 2, x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **k**: `[in] CBLAS_INT` number of positions to shift. +- **X**: `[inout] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. + +```c +void stdlib_strided_dcircshift( const CBLAS_INT N, const CBLAS_INT k, double *X, const CBLAS_INT strideX ); +``` + +#### stdlib_strided_dcircshift_ndarray( N, k, \*X, strideX, offsetX ) + +Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions using alternative indexing semantics. + +```c +double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0 }; + +stdlib_strided_dcircshift_ndarray( 5, 2, x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **k**: `[in] CBLAS_INT` number of positions to shift. +- **X**: `[inout] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. + +```c +void stdlib_strided_dcircshift_ndarray( const CBLAS_INT N, const CBLAS_INT k, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/dcircshift.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + + // Specify the number of elements: + const int N = 8; + + // Specify the shift amount: + const int k = 3; + + // Specify a stride: + const int strideX = 1; + + // Perform the circular shift: + stdlib_strided_dcircshift( N, k, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.js new file mode 100644 index 000000000000..54751bee2239 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dcircshift = require( './../lib/dcircshift.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dcircshift( x.length, k, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.native.js new file mode 100644 index 000000000000..a88597d4ee67 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.native.js @@ -0,0 +1,110 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dcircshift = tryRequire( resolve( __dirname, './../lib/dcircshift.native.js' ) ); +var opts = { + 'skip': ( dcircshift instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dcircshift( x.length, k, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..b35cad6d7a9b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dcircshift = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dcircshift( x.length, k, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..25c4f1d2c85b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,110 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dcircshift = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dcircshift instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dcircshift( x.length, k, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..e4db852ccc74 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/benchmark/c/benchmark.length.c @@ -0,0 +1,195 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dcircshift.h" +#include +#include +#include +#include +#include + +#define NAME "dcircshift" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static double rand_double( void ) { + int r = rand(); + return (double)r / ( (double)RAND_MAX + 1.0 ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int len ) { + double elapsed; + double *x; + double t; + int k; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + k = len / 2; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_dcircshift( len, k, x, 1 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int len ) { + double elapsed; + double *x; + double t; + int k; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + k = len / 2; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_dcircshift_ndarray( len, k, x, 1, 0 ); + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ 0 ] != x[ 0 ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:len=%d\n", NAME, len ); + elapsed = benchmark1( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:len=%d\n", NAME, len ); + elapsed = benchmark2( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/repl.txt new file mode 100644 index 000000000000..62d7b4b615f6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/repl.txt @@ -0,0 +1,102 @@ + +{{alias}}( N, k, x, strideX ) + Circularly shifts the elements of a double-precision floating-point + strided array by a specified number of positions. + + If `k > 0`, elements are shifted to the right. If `k < 0`, elements are + shifted to the left. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + k: integer + Number of positions to shift. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > {{alias}}( x.length, 2, x, 1 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + + // Using `N` and stride parameters: + > x = new {{alias:@stdlib/array/float64}}( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + > {{alias}}( 4, 1, x, 2 ) + [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 5, 2, x1, 1 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + > x0 + [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ] + + +{{alias}}.ndarray( N, k, x, strideX, offsetX ) + Circularly shifts the elements of a double-precision floating-point + strided array by a specified number of positions using alternative + indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a + starting index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + k: integer + Number of positions to shift. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > {{alias}}.ndarray( x.length, 2, x, 1, 0 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + + // Using an index offset: + > x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + > {{alias}}.ndarray( 3, 1, x, 2, 1 ) + [ 1.0, 6.0, 3.0, 2.0, 5.0, 4.0 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/index.d.ts new file mode 100644 index 000000000000..80eae5f3b57b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/index.d.ts @@ -0,0 +1,95 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Interface describing `dcircshift`. +*/ +interface Routine { + /** + * Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * dcircshift( x.length, 2, x, 1 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + ( N: number, k: number, x: Float64Array, strideX: number ): Float64Array; + + /** + * Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns `x` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * dcircshift.ndarray( x.length, 2, x, 1, 0 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + ndarray( N: number, k: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; +} + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. +* +* @param N - number of indexed elements +* @param k - number of positions to shift +* @param x - input array +* @param strideX - stride length +* @returns `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* +* dcircshift( x.length, 2, x, 1 ); +* // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* +* dcircshift.ndarray( x.length, 2, x, 1, 0 ); +* // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +*/ +declare var dcircshift: Routine; + + +// EXPORTS // + +export = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/test.ts new file mode 100644 index 000000000000..8312c1b33d5b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/docs/types/test.ts @@ -0,0 +1,187 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 dcircshift = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + dcircshift( x.length, 2, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift( '10', 2, x, 1 ); // $ExpectError + dcircshift( true, 2, x, 1 ); // $ExpectError + dcircshift( false, 2, x, 1 ); // $ExpectError + dcircshift( null, 2, x, 1 ); // $ExpectError + dcircshift( undefined, 2, x, 1 ); // $ExpectError + dcircshift( [], 2, x, 1 ); // $ExpectError + dcircshift( {}, 2, x, 1 ); // $ExpectError + dcircshift( ( x: number ): number => x, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift( x.length, '2', x, 1 ); // $ExpectError + dcircshift( x.length, true, x, 1 ); // $ExpectError + dcircshift( x.length, false, x, 1 ); // $ExpectError + dcircshift( x.length, null, x, 1 ); // $ExpectError + dcircshift( x.length, undefined, x, 1 ); // $ExpectError + dcircshift( x.length, [], x, 1 ); // $ExpectError + dcircshift( x.length, {}, x, 1 ); // $ExpectError + dcircshift( x.length, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + dcircshift( x.length, 2, 10, 1 ); // $ExpectError + dcircshift( x.length, 2, '10', 1 ); // $ExpectError + dcircshift( x.length, 2, true, 1 ); // $ExpectError + dcircshift( x.length, 2, false, 1 ); // $ExpectError + dcircshift( x.length, 2, null, 1 ); // $ExpectError + dcircshift( x.length, 2, undefined, 1 ); // $ExpectError + dcircshift( x.length, 2, [], 1 ); // $ExpectError + dcircshift( x.length, 2, {}, 1 ); // $ExpectError + dcircshift( x.length, 2, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift( x.length, 2, x, '10' ); // $ExpectError + dcircshift( x.length, 2, x, true ); // $ExpectError + dcircshift( x.length, 2, x, false ); // $ExpectError + dcircshift( x.length, 2, x, null ); // $ExpectError + dcircshift( x.length, 2, x, undefined ); // $ExpectError + dcircshift( x.length, 2, x, [] ); // $ExpectError + dcircshift( x.length, 2, x, {} ); // $ExpectError + dcircshift( x.length, 2, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + dcircshift(); // $ExpectError + dcircshift( x.length ); // $ExpectError + dcircshift( x.length, 2 ); // $ExpectError + dcircshift( x.length, 2, x ); // $ExpectError + dcircshift( x.length, 2, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( x.length, 2, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( '10', 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( true, 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( false, 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( null, 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( undefined, 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( [], 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( {}, 2, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( ( x: number ): number => x, 2, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( x.length, '2', x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, true, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, false, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, null, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, undefined, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, [], x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, {}, x, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( x.length, 2, 10, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, '10', 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, true, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, false, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, null, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, undefined, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, [], 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, {}, 1, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( x.length, 2, x, '10', 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, true, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, false, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, null, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, undefined, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, [], 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, {}, 0 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray( x.length, 2, x, 1, '10' ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, true ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, false ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, null ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, undefined ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, [] ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, {} ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + dcircshift.ndarray(); // $ExpectError + dcircshift.ndarray( x.length ); // $ExpectError + dcircshift.ndarray( x.length, 2 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1 ); // $ExpectError + dcircshift.ndarray( x.length, 2, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/example.c new file mode 100644 index 000000000000..643abd9546de --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/c/example.c @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dcircshift.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + + // Specify the number of elements: + const int N = 8; + + // Specify the shift amount: + const int k = 3; + + // Specify a stride: + const int strideX = 1; + + // Perform the circular shift: + stdlib_strided_dcircshift( N, k, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/index.js new file mode 100644 index 000000000000..793a7355e0d0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 dcircshift = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +dcircshift( x.length, 3, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function dcircshift( N, k, x, strideX ) { + return ndarray( N, k, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/dcircshift.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/dcircshift.native.js new file mode 100644 index 000000000000..f1833ea24f84 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/dcircshift.native.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* dcircshift( x.length, 2, x, 1 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function dcircshift( N, k, x, strideX ) { + addon( N, k, x, strideX ); + return x; +} + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/index.js new file mode 100644 index 000000000000..63148eb56214 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Circularly shift the elements of a double-precision floating-point strided array by a specified number of positions. +* +* @module @stdlib/blas/ext/base/dcircshift +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dcircshift = require( '@stdlib/blas/ext/base/dcircshift' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* dcircshift( x.length, 2, x, 1 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dcircshift = require( '@stdlib/blas/ext/base/dcircshift' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* dcircshift.ndarray( x.length, 2, x, 1, 0 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dcircshift; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dcircshift = main; +} else { + dcircshift = tmp; +} + + +// EXPORTS // + +module.exports = dcircshift; + +// exports: { "ndarray": "dcircshift.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/main.js new file mode 100644 index 000000000000..843a8acdfb19 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dcircshift = require( './dcircshift.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dcircshift, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/native.js new file mode 100644 index 000000000000..7997a89b48ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dcircshift = require( './dcircshift.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dcircshift, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.js new file mode 100644 index 000000000000..4840bc284ceb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.js @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var floor = require( '@stdlib/math/base/special/floor' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. +* +* ## Notes +* +* - This implementation is based on the "trinity rotation" (a.k.a., conjoined triple reversal) algorithm introduced in , by Igor van den Hoven. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* dcircshift( x.length, 2, x, 1, 0 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function dcircshift( N, k, x, strideX, offsetX ) { + var right; + var left; + var tmp; + var pa; + var pb; + var pc; + var pd; + var n; + var s; + var i; + + if ( N <= 0 ) { + return x; + } + // Normalize `k`: + k %= N; + if ( k < 0 ) { + k += N; + } + if ( k === 0 ) { + return x; + } + s = strideX; + + // For a right circular shift by `k`, the left partition has `N-k` elements... + left = N - k; + right = k; + if ( left < right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( left / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pd - pc ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = x[ pa ]; + x[ pa ] = tmp; + pa += s; + pc += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + } else if ( left > right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( right / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pb - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + } else { + // Simple pairwise swap... + pa = offsetX; + pb = pa + ( left * s ); + for ( i = 0; i < left; i++ ) { + tmp = x[ pa ]; + x[ pa ] = x[ pb ]; + x[ pb ] = tmp; + pa += s; + pb += s; + } + } + return x; +} + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.native.js new file mode 100644 index 000000000000..db6a8e132082 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/lib/ndarray.native.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions using alternative indexing semantics. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* dcircshift( x.length, 2, x, 1, 0 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function dcircshift( N, k, x, strideX, offsetX ) { + addon.ndarray( N, k, x, strideX, offsetX ); + return x; +} + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/manifest.json new file mode 100644 index 000000000000..ae77c3ade69f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/manifest.json @@ -0,0 +1,78 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/package.json b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/package.json new file mode 100644 index 000000000000..927418b3c617 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/package.json @@ -0,0 +1,77 @@ +{ + "name": "@stdlib/blas/ext/base/dcircshift", + "version": "0.0.0", + "description": "Circularly shift the elements of a double-precision floating-point strided array by a specified number of positions.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "circular", + "shift", + "circshift", + "rotate", + "roll", + "strided", + "array", + "ndarray", + "float64", + "double", + "float64array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/addon.c new file mode 100644 index 000000000000..8132f41f10a6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/addon.c @@ -0,0 +1,62 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dcircshift.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, k, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 ); + API_SUFFIX(stdlib_strided_dcircshift)( N, k, X, strideX ); + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 5 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, k, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 ); + API_SUFFIX(stdlib_strided_dcircshift_ndarray)( N, k, X, strideX, offsetX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/main.c new file mode 100644 index 000000000000..b4596b545e9c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/src/main.c @@ -0,0 +1,168 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dcircshift.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/strided/base/stride2offset.h" + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. +* +* @param N number of indexed elements +* @param k number of positions to shift +* @param X input array +* @param strideX stride length +*/ +void API_SUFFIX(stdlib_strided_dcircshift)( const CBLAS_INT N, const CBLAS_INT k, double *X, const CBLAS_INT strideX ) { + const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); + API_SUFFIX(stdlib_strided_dcircshift_ndarray)( N, k, X, strideX, ox ); +} + +/** +* Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions using alternative indexing semantics. +* +* ## Notes +* +* - This implementation is based on the "trinity rotation" (a.k.a., conjoined triple reversal) algorithm introduced in , by Igor van den Hoven. +* +* @param N number of indexed elements +* @param k number of positions to shift +* @param X input array +* @param strideX stride length +* @param offsetX starting index +*/ +void API_SUFFIX(stdlib_strided_dcircshift_ndarray)( const CBLAS_INT N, const CBLAS_INT k, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + CBLAS_INT right; + CBLAS_INT left; + CBLAS_INT pa; + CBLAS_INT pb; + CBLAS_INT pc; + CBLAS_INT pd; + CBLAS_INT s; + CBLAS_INT n; + CBLAS_INT i; + CBLAS_INT j; + double tmp; + + if ( N <= 0 ) { + return; + } + // Normalize `k`: + j = k % N; + if ( j < 0 ) { + j += N; + } + if ( j == 0 ) { + return; + } + s = strideX; + + // For a right circular shift by `j`, the left partition has `N-j` elements... + left = N - j; + right = j; + if ( left < right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = left / 2; + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = X[ pb ]; + X[ pb ] = X[ pa ]; + X[ pa ] = X[ pc ]; + X[ pc ] = X[ pd ]; + X[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = ( ( pd - pc ) / s ) / 2; + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = X[ pc ]; + X[ pc ] = X[ pd ]; + X[ pd ] = X[ pa ]; + X[ pa ] = tmp; + pa += s; + pc += s; + } + // Standard reversal of any remaining elements... + n = ( ( pd - pa ) / s ) / 2; + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = X[ pa ]; + X[ pa ] = X[ pd ]; + X[ pd ] = tmp; + pa += s; + } + } else if ( left > right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = right / 2; + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = X[ pb ]; + X[ pb ] = X[ pa ]; + X[ pa ] = X[ pc ]; + X[ pc ] = X[ pd ]; + X[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = ( ( pb - pa ) / s ) / 2; + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = X[ pb ]; + X[ pb ] = X[ pa ]; + X[ pa ] = X[ pd ]; + X[ pd ] = tmp; + pa += s; + } + // Standard reversal of any remaining elements... + n = ( ( pd - pa ) / s ) / 2; + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = X[ pa ]; + X[ pa ] = X[ pd ]; + X[ pd ] = tmp; + pa += s; + } + } else { + // Simple pairwise swap... + pa = offsetX; + pb = pa + ( left * s ); + for ( i = 0; i < left; i++ ) { + tmp = X[ pa ]; + X[ pa ] = X[ pb ]; + X[ pb ] = tmp; + pa += s; + pb += s; + } + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.js new file mode 100644 index 000000000000..92dad11f9570 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.js @@ -0,0 +1,225 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 dcircshift = require( './../lib/dcircshift.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( dcircshift.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dcircshift( x.length, 2, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dcircshift( 0, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( -4, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 5.0, 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 2.0, 3.0, 4.0, 5.0, 1.0 ] ); + + dcircshift( x.length, -1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 8, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]); + + dcircshift( 4, 1, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + dcircshift( 5, 2, x1, 1 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.native.js new file mode 100644 index 000000000000..c0dee2647a5a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.dcircshift.native.js @@ -0,0 +1,234 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dcircshift = tryRequire( resolve( __dirname, './../lib/dcircshift.native.js' ) ); +var opts = { + 'skip': ( dcircshift instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', opts, function test( t ) { + t.strictEqual( dcircshift.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dcircshift( x.length, 2, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dcircshift( 0, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( -4, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 5.0, 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 2.0, 3.0, 4.0, 5.0, 1.0 ] ); + + dcircshift( x.length, -1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 8, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]); + + dcircshift( 4, 1, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports view offsets', opts, function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + dcircshift( 5, 2, x1, 1 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.js similarity index 78% rename from lib/node_modules/@stdlib/stats/strided/distances/dchebychev/test/test.js rename to lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.js index 9ba499afa079..dc2dc323a71f 100644 --- a/lib/node_modules/@stdlib/stats/strided/distances/dchebychev/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.js @@ -23,7 +23,7 @@ var tape = require( 'tape' ); var proxyquire = require( 'proxyquire' ); var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var dchebychev = require( './../lib' ); +var dcircshift = require( './../lib' ); // VARIABLES // @@ -37,21 +37,21 @@ var opts = { tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof dchebychev, 'function', 'main export is a function' ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); t.end(); }); tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { - t.strictEqual( typeof dchebychev.ndarray, 'function', 'method is a function' ); + t.strictEqual( typeof dcircshift.ndarray, 'function', 'method is a function' ); t.end(); }); tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { - var dchebychev = proxyquire( './../lib', { + var dcircshift = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); - t.strictEqual( dchebychev, mock, 'returns expected value' ); + t.strictEqual( dcircshift, mock, 'returns expected value' ); t.end(); function tryRequire() { @@ -64,16 +64,16 @@ tape( 'if a native implementation is available, the main export is the native im }); tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { - var dchebychev; + var dcircshift; var main; - main = require( './../lib/dchebychev.js' ); + main = require( './../lib/dcircshift.js' ); - dchebychev = proxyquire( './../lib', { + dcircshift = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); - t.strictEqual( dchebychev, main, 'returns expected value' ); + t.strictEqual( dcircshift, main, 'returns expected value' ); t.end(); function tryRequire() { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.js new file mode 100644 index 000000000000..5015edc2e619 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.js @@ -0,0 +1,253 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 dcircshift = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 5', function test( t ) { + t.strictEqual( dcircshift.length, 5, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dcircshift( x.length, 2, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dcircshift( 0, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( -4, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 5.0, 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 2.0, 3.0, 4.0, 5.0, 1.0 ] ); + + dcircshift( x.length, -1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 8, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]); + + dcircshift( 4, 1, x, -2, x.length - 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]); + + dcircshift( 5, 2, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset with a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 0.0, + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.native.js new file mode 100644 index 000000000000..5f458784eab4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dcircshift/test/test.ndarray.native.js @@ -0,0 +1,262 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dcircshift = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dcircshift instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 5', opts, function test( t ) { + t.strictEqual( dcircshift.length, 5, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dcircshift( x.length, 2, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dcircshift( 0, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( -4, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 5.0, 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 2.0, 3.0, 4.0, 5.0, 1.0 ] ); + + dcircshift( x.length, -1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dcircshift( x.length, 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dcircshift( x.length, 8, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ); + + dcircshift( x.length, 7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + expected = new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ); + + dcircshift( x.length, -7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]); + + dcircshift( 4, 1, x, -2, x.length - 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]); + + dcircshift( 5, 2, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset with a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 0.0, + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]); + + dcircshift( 4, 1, x, 2, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.js index d372d7c70375..aaafc3397501 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusum = require( './../lib/dcusum.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.native.js index edf9395689ff..2519689874b4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.js index b658e2a9f802..7fc8b5916f62 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusum = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.native.js index e67fe16bc5ce..b3c2e346b3e8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusum/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.js index 4a3ad2465979..769baed90f63 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumkbn = require( './../lib/dcusumkbn.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.native.js index e06d3dda0842..3259afd418f1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.js index 4c8d3044961f..67e0ff0173db 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumkbn = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.native.js index 45d4b629c9a0..561bf599906a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.js index a452d5bfd790..165a2ef2a0ee 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumkbn2 = require( './../lib/dcusumkbn2.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.native.js index 8f0174ea4147..ec2471641169 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.js index 69e07424eb3e..82ad091822b2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumkbn2 = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.native.js index 72aa3b5c22db..8ff5587ab2fa 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/c/benchmark.length.c index 899261a426ef..75a83d153228 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/benchmark/c/benchmark.length.c @@ -96,11 +96,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -118,6 +120,8 @@ static double benchmark1( int iterations, int len ) { if ( y[ len-1 ] != y[ len-1 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } @@ -130,11 +134,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -152,6 +158,8 @@ static double benchmark2( int iterations, int len ) { if ( y[ len-1 ] != y[ len-1 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.js index bc0944963d5a..2a6404ae7a53 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumors = require( './../lib/dcusumors.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.native.js index 6e7ccec13446..9f8352cee66d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.js index a27a89095c2d..bbc50efaa34a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumors = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.native.js index 8469873fb5d3..abe10ee81afe 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumors/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.js index 36454e7dd25d..b02e5a556586 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumpw = require( './../lib/dcusumpw.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.native.js index ae2cd1bff805..9aedcf8ab32e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.js index 15b6b0a97ef7..78d237f136a5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.js @@ -25,6 +25,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumpw = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.native.js index 05d93461e628..5f636035abcd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dcusumpw/benchmark/benchmark.ndarray.native.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -106,7 +107,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js index 365fbd0297c6..2bce2efea71c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js @@ -78,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js index dc737791fda5..76822d7a24a0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js @@ -83,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js index 3d4ff0ffecdf..ba30bd5bcb64 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js @@ -78,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js index 7d7770458ac1..d37f72802820 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js @@ -83,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/README.md b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/README.md new file mode 100644 index 000000000000..f9ea6756947e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/README.md @@ -0,0 +1,450 @@ + + +# dindexOfRow + +> Return the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var dindexOfRow = require( '@stdlib/blas/ext/base/dindex-of-row' ); +``` + +#### dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) + +Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + +var x = new Float64Array( [ 2.0, 4.0 ] ); +var workspace = new Uint8Array( 3 ); +var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +// returns 1 +``` + +The function has the following parameters: + +- **order**: storage layout. +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix stored as a [`Float64Array`][mdn-float64array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: search vector stored as a [`Float64Array`][mdn-float64array]. +- **strideX**: stride length of `x`. +- **workspace**: workspace array stored as a [`Uint8Array`][mdn-uint8array] for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: stride length of `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may provide an empty workspace array. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ] ); + +var x = new Float64Array( [ 3.0, 4.0 ] ); +var workspace = new Uint8Array( 0 ); +var out = dindexOfRow( 'row-major', 3, 2, A, 2, x, 1, workspace, 1 ); +// returns 1 +``` + +If the function is unable to find a matching row, the function returns `-1`. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + +var x = new Float64Array( [ -3.0, -4.0 ] ); +var workspace = new Uint8Array( 3 ); +var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +// returns -1 +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +// Initial arrays: +var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ] ); +var x0 = new Float64Array( [ 0.0, 3.0, 4.0 ] ); + +// Create offset views: +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +var workspace = new Uint8Array( 0 ); +var out = dindexOfRow( 'row-major', 3, 2, A1, 2, x1, 1, workspace, 1 ); +// returns 1 +``` + + + +#### dindexOfRow.ndarray( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) + + + +Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +/* + A = [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + +var x = new Float64Array( [ 2.0, 4.0 ] ); +var workspace = new Uint8Array( 3 ); +var out = dindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +The function has the following parameters: + +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix stored as a [`Float64Array`][mdn-float64array]. +- **strideA1**: stride of the first dimension of `A`. +- **strideA2**: stride of the second dimension of `A`. +- **offsetA**: starting index for `A`. +- **x**: search vector stored as a [`Float64Array`][mdn-float64array]. +- **strideX**: stride length of `x`. +- **offsetX**: starting index for `x`. +- **workspace**: workspace array stored as a [`Uint8Array`][mdn-uint8array] for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: stride length of `workspace`. +- **offsetW**: starting index for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may provide an empty workspace array. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ] ); + +var x = new Float64Array( [ 3.0, 4.0 ] ); +var workspace = new Uint8Array( 0 ); +var out = dindexOfRow.ndarray( 3, 2, A, 2, 1, 0, x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +
+ + + + + +
+ +## Notes + +- When searching for a matching row, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same. + +
+ + + + + +
+ +## Examples + + + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dindexOfRow = require( '@stdlib/blas/ext/base/dindex-of-row' ); + +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = new Float64Array( [ 4.0, 5.0, 6.0 ] ); +console.log( x ); + +var workspace = new Uint8Array( shape[ 0 ] ); + +var out = dindexOfRow( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, workspace, 1 ); +console.log( out ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/dindex_of_row.h" +``` + + + +#### stdlib_strided_dindex_of_row( order, M, N, \*A, LDA, \*X, strideX, \*workspace, strideW ) + + + +Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. + +```c +#include "stdlib/blas/base/shared.h" +#include + +const double A[] = { 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 }; +const double x[] = { 2.0, 4.0 }; +uint8_t workspace[ 3 ]; + +int idx = stdlib_strided_dindex_of_row( CblasColMajor, 3, 2, A, 3, x, 1, workspace, 1 ); +// returns 1 +``` + +The function accepts the following arguments: + +- **order**: `[in] CBLAS_LAYOUT` storage layout. +- **M**: `[in] CBLAS_INT` number of rows in `A`. +- **N**: `[in] CBLAS_INT` number of columns in `A`. +- **A**: `[in] double*` input matrix. +- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **X**: `[in] double*` search vector. +- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **workspace**: `[inout] uint8_t*` workspace array for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: `[in] CBLAS_INT` stride length for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may either provide an empty workspace array or a `NULL` pointer. + +```c +#include "stdlib/blas/base/shared.h" + +const double A[] = { 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 }; +const double x[] = { 3.0, 4.0 }; + +int idx = stdlib_strided_dindex_of_row( CblasRowMajor, 3, 2, A, 2, x, 1, NULL, 1 ); +// returns 1 +``` + +```c +CBLAS_INT stdlib_strided_dindex_of_row( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT LDA, const double *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ); +``` + + + +#### stdlib_strided_dindex_of_row_ndarray( M, N, \*A, strideA1, strideA2, offsetA, \*X, strideX, offsetX, \*workspace, strideW, offsetW ) + + + +Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + +```c +#include + +const double A[] = { 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 }; +const double x[] = { 2.0, 4.0 }; +uint8_t workspace[ 3 ]; + +int idx = stdlib_strided_dindex_of_row_ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +// returns 1 +``` + +The function accepts the following arguments: + +- **M**: `[in] CBLAS_INT` number of rows in `A`. +- **N**: `[in] CBLAS_INT` number of columns in `A`. +- **A**: `[in] double*` input matrix. +- **strideA1**: `[in] CBLAS_INT` stride of the first dimension of `A`. +- **strideA2**: `[in] CBLAS_INT` stride of the second dimension of `A`. +- **offsetA**: `[in] CBLAS_INT` index offset for `A`. +- **X**: `[in] double*` search vector. +- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **workspace**: `[inout] uint8_t*` workspace array for tracking row match candidates. This parameter is ignored if the function is provided an input matrix stored in row-major order. +- **strideW**: `[in] CBLAS_INT` stride length for `workspace`. +- **offsetW**: `[in] CBLAS_INT` starting index for `workspace`. + +When an input matrix is stored in row-major order, the workspace parameter is ignored, and, thus, one may either provide an empty workspace array or a `NULL` pointer. + +```c +const double A[] = { 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 }; +const double x[] = { 3.0, 4.0 }; + +int idx = stdlib_strided_dindex_of_row_ndarray( 3, 2, A, 2, 1, 0, x, 1, 0, NULL, 1, 0 ); +// returns 1 +``` + +```c +CBLAS_INT stdlib_strided_dindex_of_row_ndarray( const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/dindex_of_row.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create a matrix (row-major): + const double A[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0 }; + + // Create a search vector: + const double x[] = { 4.0, 5.0, 6.0 }; + + // Specify the number of matrix rows and columns: + const int M = 3; + const int N = 3; + + // Perform a search: + int idx = stdlib_strided_dindex_of_row( CblasRowMajor, M, N, A, N, x, 1, NULL, 1 ); + + // Print the result: + printf( "index value: %d\n", idx ); +} +``` + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.js new file mode 100644 index 000000000000..93ed20d5375d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.js @@ -0,0 +1,114 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dindexOfRow = require( './../lib/dindex_of_row.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace = zeros( N, 'uint8' ); + var A = zeros( N*N, 'float64' ); + var x = zeros( N, 'float64' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = dindexOfRow( order, N, N, A, N, x, 1, workspace, 1 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.native.js new file mode 100644 index 000000000000..d47fbee5133e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.native.js @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dindexOfRow = tryRequire( resolve( __dirname, './../lib/dindex_of_row.native.js' ) ); +var opts = { + 'skip': ( dindexOfRow instanceof Error ) +}; +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace = zeros( N, 'uint8' ); + var A = zeros( N*N, 'float64' ); + var x = zeros( N, 'float64' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = dindexOfRow( order, N, N, A, N, x, 1, workspace, 1 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::native,square_matrix:order=%s,size=%d', pkg, ord, N*N ), opts, f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..68a8295272ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zeros = require( '@stdlib/array/zeros' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dindexOfRow = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace = zeros( N, 'uint8' ); + var A = zeros( N*N, 'float64' ); + var x = zeros( N, 'float64' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var sa1; + var sa2; + var z; + var i; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = dindexOfRow( N, N, A, sa1, sa2, 0, x, 1, 0, workspace, 1, 0 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:ndarray:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..bb9325f27aa1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,130 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zeros = require( '@stdlib/array/zeros' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dindexOfRow = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dindexOfRow instanceof Error ) +}; +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var workspace = zeros( N, 'uint8' ); + var A = zeros( N*N, 'float64' ); + var x = zeros( N, 'float64' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var sa1; + var sa2; + var z; + var i; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = dindexOfRow( N, N, A, sa1, sa2, 0, x, 1, 0, workspace, 1, 0 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::native,square_matrix:ndarray:order=%s,size=%d', pkg, ord, N*N ), opts, f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..c8a5d0a46118 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/benchmark/c/benchmark.length.c @@ -0,0 +1,221 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dindex_of_row.h" +#include "stdlib/blas/base/shared.h" +#include +#include +#include +#include +#include +#include + +#define NAME "dindex_of_row" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static double rand_double( void ) { + int r = rand(); + return (double)r / ( (double)RAND_MAX + 1.0 ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + uint8_t *workspace; + double elapsed; + double *A; + double *x; + double t; + int idx; + int i; + int j; + + A = (double *)malloc( (size_t)( N*N ) * sizeof( double ) ); + x = (double *)malloc( (size_t)N * sizeof( double ) ); + workspace = (uint8_t *)malloc( (size_t)N * sizeof( uint8_t ) ); + for ( i = 0; i < N*N; i++ ) { + A[ i ] = ( rand_double() * 20000.0 ) - 10000.0; + } + for ( j = 0; j < N; j++ ) { + x[ j ] = 20000.0; + } + idx = -1; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + idx = stdlib_strided_dindex_of_row( CblasRowMajor, N, N, A, N, x, 1, workspace, 1 ); + if ( idx < -2 ) { + printf( "unexpected result\n" ); + break; + } + } + elapsed = tic() - t; + if ( idx < -2 ) { + printf( "unexpected result\n" ); + } + free( A ); + free( x ); + free( workspace ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + uint8_t *workspace; + double elapsed; + double *A; + double *x; + double t; + int idx; + int i; + int j; + + A = (double *)malloc( (size_t)( N*N ) * sizeof( double ) ); + x = (double *)malloc( (size_t)N * sizeof( double ) ); + workspace = (uint8_t *)malloc( (size_t)N * sizeof( uint8_t ) ); + for ( i = 0; i < N*N; i++ ) { + A[ i ] = ( rand_double() * 20000.0 ) - 10000.0; + } + for ( j = 0; j < N; j++ ) { + x[ j ] = 20000.0; + } + idx = -1; + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + idx = stdlib_strided_dindex_of_row_ndarray( N, N, A, N, 1, 0, x, 1, 0, workspace, 1, 0 ); + if ( idx < -2 ) { + printf( "unexpected result\n" ); + break; + } + } + elapsed = tic() - t; + if ( idx < -2 ) { + printf( "unexpected result\n" ); + } + free( A ); + free( x ); + free( workspace ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int N; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + N = (int)sqrt( (double)len ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::native::%s:square_matrix:order=row-major,size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::native::%s:ndarray:square_matrix:order=row-major,size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/repl.txt new file mode 100644 index 000000000000..5afc1bfb78f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/repl.txt @@ -0,0 +1,123 @@ + +{{alias}}( order, M, N, A, LDA, x, strideX, workspace, strideW ) + Returns the index of the first row in a double-precision floating-point + input matrix which has the same elements as a provided search vector. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If the function is provided an empty matrix or if the function is unable to + find a matching row, the function returns `-1` (i.e., an invalid index). + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Float64Array + Input matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Float64Array + Search vector. + + strideX: integer + Stride length for `x`. + + workspace: Uint8Array + Workspace array for tracking row match candidates. This parameter + is ignored if the input matrix is stored in row-major order. + + strideW: integer + Stride length for `workspace`. + + Returns + ------- + out: integer + Row index. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var x = new {{alias:@stdlib/array/float64}}( [ 2.0, 4.0 ] ); + > var w = new {{alias:@stdlib/array/uint8}}( 2 ); + > {{alias}}( 'column-major', 2, 2, A, 2, x, 1, w, 1 ) + 1 + + +{{alias}}.ndarray( M, N, A, sa1, sa2, oa, x, sx, ox, w, sw, ow ) + Returns the index of the first row in a double-precision floating-point + input matrix which has the same elements as a provided search vector using + alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, offset parameters support indexing semantics based on starting + indices. + + If the method is provided an empty matrix or if the method is unable to find + a matching row, the method returns `-1` (i.e., an invalid index). + + Parameters + ---------- + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Float64Array + Input matrix `A`. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + x: Float64Array + Search vector. + + sx: integer + Stride length for `x`. + + ox: integer + Starting index for `x`. + + w: Uint8Array + Workspace array for tracking row match candidates. This parameter + is ignored if the input matrix is stored in row-major order. + + sw: integer + Stride length for `w`. + + ow: integer + Starting index for `w`. + + Returns + ------- + out: integer + Row index. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var x = new {{alias:@stdlib/array/float64}}( [ 2.0, 4.0 ] ); + > var w = new {{alias:@stdlib/array/uint8}}( 2 ); + > {{alias}}.ndarray( 2, 2, A, 1, 2, 0, x, 1, 0, w, 1, 0 ) + 1 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/index.d.ts new file mode 100644 index 000000000000..71e924d21e5f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/index.d.ts @@ -0,0 +1,143 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout } from '@stdlib/types/blas'; + +/** +* Interface describing `dindexOfRow`. +*/ +interface Routine { + /** + * Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Float64Array = require( `@stdlib/array/float64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float64Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + */ + ( order: Layout, M: number, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number, workspace: Uint8Array, strideW: number ): number; + + /** + * Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param x - search vector + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @param offsetW - starting index for `workspace` + * @returns row index + * + * @example + * var Float64Array = require( `@stdlib/array/float64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float64Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = dindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + ndarray( M: number, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, x: Float64Array, strideX: number, offsetX: number, workspace: Uint8Array, strideW: number, offsetW: number ): number; +} + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param order - storage layout +* @param M - number of rows in `A` +* @param N - number of columns in `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - search vector +* @param strideX - stride length for `x` +* @param workspace - workspace array for tracking row match candidates +* @param strideW - stride length for `workspace` +* @returns row index +* +* @example +* var Float64Array = require( `@stdlib/array/float64` ); +* var Uint8Array = require( `@stdlib/array/uint8` ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +* +* @example +* var Float64Array = require( `@stdlib/array/float64` ); +* var Uint8Array = require( `@stdlib/array/uint8` ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +declare var dindexOfRow: Routine; + + +// EXPORTS // + +export = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/test.ts new file mode 100644 index 000000000000..d72ea08bb95f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/docs/types/test.ts @@ -0,0 +1,403 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 dindexOfRow = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, 1 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 5, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( true, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( false, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( null, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( void 0, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( [], 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( {}, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( ( x: number ): number => x, 2, 2, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', '5', 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', true, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', false, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', null, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', void 0, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', [], 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', {}, 2, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', ( x: number ): number => x, 2, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, '5', A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, true, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, false, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, null, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, void 0, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, [], A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, {}, A, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, ( x: number ): number => x, A, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, 5, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, true, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, false, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, null, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, void 0, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, {}, 2, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, ( x: number ): number => x, 2, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, A, '5', x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, true, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, false, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, null, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, void 0, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, [], x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, {}, x, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, ( x: number ): number => x, x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float64Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, A, 2, 5, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, true, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, false, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, null, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, void 0, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, {}, 1, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, ( x: number ): number => x, 1, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, A, 2, x, '5', w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, true, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, false, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, null, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, void 0, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, [], w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, {}, w, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, ( x: number ): number => x, w, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Uint8Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, 5, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, true, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, false, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, null, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, void 0, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, {}, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, '5' ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, true ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, false ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, null ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, void 0 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, [] ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, {} ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow(); // $ExpectError + dindexOfRow( 'row-major' ); // $ExpectError + dindexOfRow( 'row-major', 2 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1 ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w ); // $ExpectError + dindexOfRow( 'row-major', 2, 2, A, 2, x, 1, w, 1, 0 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectType number +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( '5', 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( true, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( false, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( null, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( void 0, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( [], 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( {}, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( ( x: number ): number => x, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, '5', A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, true, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, false, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, null, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, void 0, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, [], A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, {}, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, ( x: number ): number => x, A, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Float64Array... +{ + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, 5, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, true, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, false, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, null, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, void 0, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, {}, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, ( x: number ): number => x, 2, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, '5', 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, true, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, false, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, null, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, void 0, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, [], 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, {}, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, ( x: number ): number => x, 1, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, '5', 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, true, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, false, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, null, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, void 0, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, [], 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, {}, 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, ( x: number ): number => x, 0, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, '5', x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, true, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, false, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, null, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, void 0, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, [], x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, {}, x, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, ( x: number ): number => x, x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a Float64Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, 5, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, true, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, false, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, null, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, void 0, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, {}, 1, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, ( x: number ): number => x, 1, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, '5', 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, true, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, false, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, null, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, void 0, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, [], 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, {}, 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, ( x: number ): number => x, 0, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, '5', w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, true, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, false, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, null, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, void 0, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, [], w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, {}, w, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, ( x: number ): number => x, w, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a Uint8Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, 5, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, true, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, false, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, null, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, void 0, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, {}, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, '5', 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, true, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, false, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, null, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, void 0, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, [], 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, {}, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, '5' ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, true ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, false ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, null ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, void 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, [] ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, {} ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + const x = new Float64Array( [ 3.0, 4.0 ] ); + const w = new Uint8Array( 2 ); + + dindexOfRow.ndarray(); // $ExpectError + dindexOfRow.ndarray( 2 ); // $ExpectError + dindexOfRow.ndarray( 2, 2 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1 ); // $ExpectError + dindexOfRow.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, w, 1, 0, 0 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/example.c new file mode 100644 index 000000000000..5cda5f8361f1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/c/example.c @@ -0,0 +1,39 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dindex_of_row.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create a matrix (row-major): + const double A[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0 }; + + // Create a search vector: + const double x[] = { 4.0, 5.0, 6.0 }; + + // Specify the number of matrix rows and columns: + const int M = 3; + const int N = 3; + + // Perform a search: + int idx = stdlib_strided_dindex_of_row( CblasRowMajor, M, N, A, N, x, 1, NULL, 1 ); + + // Print the result: + printf( "index value: %d\n", idx ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/index.js new file mode 100644 index 000000000000..b03e5220370f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/examples/index.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dindexOfRow = require( './../lib' ); + +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = new Float64Array( [ 4.0, 5.0, 6.0 ] ); +console.log( x ); + +var workspace = new Uint8Array( shape[ 0 ] ); + +var out = dindexOfRow( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, workspace, 1 ); // eslint-disable-line max-len +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_dindex_of_row)( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT LDA, const double *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ); + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_dindex_of_row_ndarray)( const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_BLAS_EXT_BASE_DINDEX_OF_ROW_H diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js new file mode 100644 index 000000000000..13543d2c2258 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js @@ -0,0 +1,94 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param {string} order - storage layout +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Float64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {integer} row index +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +*/ +function dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { + var sa1; + var sa2; + var s; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) ) { + s = N; + } else { + s = M; + } + if ( LDA < max( 1, s ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js new file mode 100644 index 000000000000..0756ffd1f1ad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); +var format = require( '@stdlib/string/format' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +* +* @param {string} order - storage layout +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Float64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {integer} row index +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +*/ +function dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { + var s; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) ) { + s = N; + } else { + s = M; + } + if ( LDA < max( 1, s ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); + } + return addon( resolveOrder( order ), M, N, A, LDA, x, strideX, workspace, strideW ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/index.js new file mode 100644 index 000000000000..586d775603ce --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/index.js @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +* +* @module @stdlib/blas/ext/base/dindex-of-row +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* var dindexOfRow = require( '@stdlib/blas/ext/base/dindex-of-row' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); +* // returns 1 +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* var dindexOfRow = require( '@stdlib/blas/ext/base/dindex-of-row' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dindexOfRow; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dindexOfRow = main; +} else { + dindexOfRow = tmp; +} + + +// EXPORTS // + +module.exports = dindexOfRow; + +// exports: { "ndarray": "dindexOfRow.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/main.js new file mode 100644 index 000000000000..f775840a4e28 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dindexOfRow = require( './dindex_of_row.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dindexOfRow, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/native.js new file mode 100644 index 000000000000..d25f23e09fdb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dindexOfRow = require( './dindex_of_row.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dindexOfRow, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.js new file mode 100644 index 000000000000..247437d75e0b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.js @@ -0,0 +1,149 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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-params, max-len */ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); + + +// MAIN // + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. +* +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Float64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @param {NonNegativeInteger} offsetW - index offset for `workspace` +* @returns {integer} row index +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +function dindexOfRow( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) { + var da0; + var da1; + var S0; + var S1; + var ia; + var iw; + var ix; + var i0; + var i1; + + // Check whether the matrix is an empty matrix... + if ( M <= 0 || N <= 0 ) { + return -1; + } + // Search for the first row matching the search vector... + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + S0 = N; + S1 = M; + + // Scan a row-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA1 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] !== x[ ix ] ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA2; + ix += strideX; + } + // If we successfully iterated over all columns, then that means we've found a match... + if ( i0 === S0 ) { + return i1; + } + } + // If we've made it here, then no rows match the search vector: + return -1; + } + // Column-major... + S0 = M; + S1 = N; + + // Resolve loop offset (pointer) increments: + da0 = strideA1; + da1 = strideA2 - ( S0*strideA1 ); + + // Initialize the workspace array for tracking which rows contain matching elements: + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + workspace[ iw ] = 1; + iw += strideW; + } + + // Finding the first matching row when a matrix is stored in column-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan down each column (otherwise, if we went row-by-row, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan down the rows in a column looking for a matching element... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] !== x[ ix ] ) { + // We found a non-matching element, which means we can exclude this row from the list of row candidates... + workspace[ iw ] = 0; + } + ia += da0; + iw += strideW; + } + ia += da1; + ix += strideX; + } + // Search for the first matching row... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( workspace[ iw ] === 1 ) { + break; + } + iw += strideW; + } + return ( i0 === S0 ) ? -1 : i0; +} + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.native.js new file mode 100644 index 000000000000..9008d06424b3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/ndarray.native.js @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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-params, max-len */ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Float64Array} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {Uint8Array} workspace - workspace array for tracking row match candidates +* @param {integer} strideW - stride length for `workspace` +* @param {NonNegativeInteger} offsetW - index offset for `workspace` +* @returns {integer} row index +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Uint8Array = require( '@stdlib/array/uint8' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 3.0 ], [ 2.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = new Float64Array( [ 2.0, 4.0 ] ); +* var workspace = new Uint8Array( 3 ); +* +* var out = dindexOfRow( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); +* // returns 1 +*/ +function dindexOfRow( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ) { + return addon.ndarray( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX, workspace, strideW, offsetW ); +} + + +// EXPORTS // + +module.exports = dindexOfRow; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/manifest.json new file mode 100644 index 000000000000..13e1d484fa61 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/manifest.json @@ -0,0 +1,82 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-strided-uint8array", + "@stdlib/napi/create-int32" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/package.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/package.json new file mode 100644 index 000000000000..1dc709e1a0da --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/ext/base/dindex-of-row", + "version": "0.0.0", + "description": "Return the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "blas", + "matrix", + "strided", + "array", + "ndarray", + "vector", + "row", + "index", + "search", + "find", + "index-of", + "indexof", + "double", + "float", + "float64", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/addon.c new file mode 100644 index 000000000000..f073dad276b3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/addon.c @@ -0,0 +1,102 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dindex_of_row.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int32.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include "stdlib/napi/argv_strided_float64array2d.h" +#include "stdlib/napi/argv_strided_uint8array.h" +#include "stdlib/napi/create_int32.h" +#include +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT MW; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 9 ); + STDLIB_NAPI_ARGV_INT32( env, order, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, M, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, LDA, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 6 ); + STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 8 ); + + if ( order == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + MW = M; + } else { // order == CblasRowMajor + sa1 = LDA; + sa2 = 1; + MW = 0; + } + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, M, N, sa1, sa2, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 5 ); + STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, W, MW, strideW, argv, 7 ); + STDLIB_NAPI_CREATE_INT32( env, API_SUFFIX(stdlib_strided_dindex_of_row)( order, M, N, A, LDA, X, strideX, W, strideW ), idx ); + return idx; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + CBLAS_INT MW; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 12 ); + STDLIB_NAPI_ARGV_INT64( env, M, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideA1, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideA2, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, offsetA, argv, 5 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 7 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 10 ); + STDLIB_NAPI_ARGV_INT64( env, offsetW, argv, 11 ); + + // Only validate workspace elements for column-major matrices: + if ( strideA1 < strideA2 ) { + MW = M; + } else { + MW = 0; + } + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, M, N, strideA1, strideA2, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 6 ); + STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, W, MW, strideW, argv, 9 ); + STDLIB_NAPI_CREATE_INT32( env, API_SUFFIX(stdlib_strided_dindex_of_row_ndarray)( M, N, A, strideA1, strideA2, offsetA, X, strideX, offsetX, W, strideW, offsetW ), idx ); + return idx; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/main.c new file mode 100644 index 000000000000..06b691d266bc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/src/main.c @@ -0,0 +1,155 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dindex_of_row.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/blas/base/shared.h" +#include + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. +* +* @param order storage layout +* @param M number of rows in `A` +* @param N number of columns in `A` +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param X search vector +* @param strideX stride length for `X` +* @param workspace workspace array for tracking row match candidates +* @param strideW stride length for `workspace` +* @return row index +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_dindex_of_row)( const CBLAS_LAYOUT order, const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT LDA, const double *X, const CBLAS_INT strideX, uint8_t *workspace, const CBLAS_INT strideW ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT ox; + CBLAS_INT ow; + + if ( order == CblasRowMajor ) { + sa1 = LDA; + sa2 = 1; + } else { // order == CblasColMajor + sa1 = 1; + sa2 = LDA; + } + ox = stdlib_strided_stride2offset( N, strideX ); + ow = stdlib_strided_stride2offset( M, strideW ); + return API_SUFFIX(stdlib_strided_dindex_of_row_ndarray)( M, N, A, sa1, sa2, 0, X, strideX, ox, workspace, strideW, ow ); +} + +/** +* Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* @param M number of rows in `A` +* @param N number of columns in `A` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA index offset for `A` +* @param X search vector +* @param strideX stride length for `X` +* @param offsetX starting index for `X` +* @param workspace workspace array for tracking row match candidates +* @param strideW stride length for `workspace` +* @param offsetW starting index for `workspace` +* @return row index +*/ +CBLAS_INT API_SUFFIX(stdlib_strided_dindex_of_row_ndarray)( const CBLAS_INT M, const CBLAS_INT N, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, uint8_t *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW ) { + CBLAS_INT da0; + CBLAS_INT da1; + CBLAS_INT S0; + CBLAS_INT S1; + CBLAS_INT ia; + CBLAS_INT iw; + CBLAS_INT ix; + CBLAS_INT i0; + CBLAS_INT i1; + + // Check whether the matrix is an empty matrix... + if ( M <= 0 || N <= 0 ) { + return -1; + } + // Search for the first row matching the search vector... + if ( strideA1 >= strideA2 ) { + // Row-major... + S0 = N; + S1 = M; + + // Scan a row-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA1 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] != X[ ix ] ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA2; + ix += strideX; + } + // If we successfully iterated over all columns, then that means we've found a match... + if ( i0 == S0 ) { + return i1; + } + } + // If we've made it here, then no rows match the search vector: + return -1; + } + // Column-major... + S0 = M; + S1 = N; + + // Resolve loop offset (pointer) increments: + da0 = strideA1; + da1 = strideA2 - ( S0*strideA1 ); + + // Initialize the workspace array for tracking which rows contain matching elements: + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + workspace[ iw ] = 1; + iw += strideW; + } + + // Finding the first matching row when a matrix is stored in column-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan down each column (otherwise, if we went row-by-row, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan down the rows in a column looking for a matching element... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] != X[ ix ] ) { + // We found a non-matching element, which means we can exclude this row from the list of row candidates... + workspace[ iw ] = 0; + } + ia += da0; + iw += strideW; + } + ia += da1; + ix += strideX; + } + // Search for the first matching row... + iw = offsetW; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( workspace[ iw ] == 1 ) { + break; + } + iw += strideW; + } + return ( i0 == S0 ) ? -1 : i0; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major.json new file mode 100644 index 000000000000..bb8461418c46 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "A": [ 1.0, 2.0, 2.0, 0.0, 3.0, 4.0, 4.0, 0.0 ], + "M": 4, + "N": 2, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "LDA": 4, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major_no_match.json new file mode 100644 index 000000000000..8c3262a27da1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/column_major_no_match.json @@ -0,0 +1,19 @@ +{ + "order": "column-major", + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/column_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/column_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/column_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/column_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/column_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/column_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/row_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/row_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/row_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/row_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large_strides/row_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/large-strides/row_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/column_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/column_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/column_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/column_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/row_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/row_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/row_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed_strides/row_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/column_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/column_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/column_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/column_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/column_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/column_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/row_major.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/row_major.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/row_major.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/row_major_no_match.json similarity index 100% rename from lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative_strides/row_major_no_match.json rename to lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/negative-strides/row_major_no_match.json diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major.json new file mode 100644 index 000000000000..b2d0a6cf1acc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major.json @@ -0,0 +1,27 @@ +{ + "order": "column-major", + "A": [ + 9999.0, + 1.0, + 2.0, + 0.0, + 3.0, + 4.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 2.0, 4.0 ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major_no_match.json new file mode 100644 index 000000000000..391801cfb10e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/column_major_no_match.json @@ -0,0 +1,27 @@ +{ + "order": "column-major", + "A": [ + 9999.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0 ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major.json new file mode 100644 index 000000000000..ab70c2763ce6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "A": [ + 9999.0, + 1.0, + 2.0, + 3.0, + 4.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0 ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major_no_match.json new file mode 100644 index 000000000000..c7ef9df5d92a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/offsets/row_major_no_match.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "A": [ + 9999.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0 ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major.json new file mode 100644 index 000000000000..687eebb8e8d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "A": [ 1.0, 2.0, 3.0, 4.0, 3.0, 4.0, 0.0, 0.0 ], + "M": 4, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major_no_match.json new file mode 100644 index 000000000000..d556a7f35cd4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/fixtures/row_major_no_match.json @@ -0,0 +1,19 @@ +{ + "order": "row-major", + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.js new file mode 100644 index 000000000000..b66e03df9ecd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.js @@ -0,0 +1,199 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var dindexOfRow = require( './../lib/dindex_of_row.js' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( dindexOfRow.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( value, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), value, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', function test( t ) { + var values; + var data; + var i; + + data = COLUMN_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), value, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, 0, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, 0, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.native.js new file mode 100644 index 000000000000..ab98435c3db5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.dindex_of_row.native.js @@ -0,0 +1,208 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dindexOfRow = tryRequire( resolve( __dirname, './../lib/dindex_of_row.native.js' ) ); +var opts = { + 'skip': ( dindexOfRow instanceof Error ) +}; + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', opts, function test( t ) { + t.strictEqual( dindexOfRow.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', opts, function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( value, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', opts, function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), value, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', opts, function test( t ) { + var values; + var data; + var i; + + data = COLUMN_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), value, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + }; + } +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, 0, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, 0, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.order, data.M, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX, new Uint8Array( data.M ), 1 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.js new file mode 100644 index 000000000000..7c7106213bef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dindexOfRow = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof dindexOfRow.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var dindexOfRow = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dindexOfRow, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var dindexOfRow; + var main; + + main = require( './../lib/dindex_of_row.js' ); + + dindexOfRow = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dindexOfRow, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.js new file mode 100644 index 000000000000..38ea60d6c390 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.js @@ -0,0 +1,330 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var dindexOfRow = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); +var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); +var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); +var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); +var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dindexOfRow.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( 0, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.M, 0, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( 0, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, 0, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.native.js new file mode 100644 index 000000000000..d81c0bb9ddee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/test/test.ndarray.native.js @@ -0,0 +1,334 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Uint8Array = require( '@stdlib/array/uint8' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dindexOfRow = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dindexOfRow instanceof Error ) +}; + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); +var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); +var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); +var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); +var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfRow, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( 0, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.M, 0, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( 0, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, 0, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', opts, function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', opts, function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets)', opts, function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides)', opts, function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides)', opts, function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (row-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first row matching a search vector (column-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides)', opts, function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = dindexOfRow( data.M, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, new Uint8Array( data.M ), 1, 0 ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.js index 9d88f5b3463a..07607015153b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dindexOf = require( './../lib/dindex_of.js' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.native.js index c4c6d922f1ce..5b26776ab4f6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -98,7 +99,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.js index 3c6067b02002..21190714b1d0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dindexOf = require( './../lib/ndarray.js' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.native.js index edf66311371c..3a45348802dd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -98,7 +99,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/c/benchmark.length.c index 8210dfba07df..a2c9b25bc86b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of/benchmark/c/benchmark.length.c @@ -23,7 +23,7 @@ #include #include -#define NAME "dindexof" +#define NAME "dindex_of" #define ITERATIONS 10000000 #define REPEATS 3 #define MIN 1 @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int idx; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int idx; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.js index 8481d3963a99..6b7db4339edb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dlastIndexOf = require( './../lib/dlast_index_of.js' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.native.js index 66d4a483a621..1433e7e60e8f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -98,7 +99,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.js index b96b82148e96..2a7cb40788e1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dlastIndexOf = require( './../lib/ndarray.js' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.native.js index 41faaf5d27e0..ee8867f8d195 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -98,7 +99,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/c/benchmark.length.c index 3061071306cb..5c1bdea5d66a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/benchmark/c/benchmark.length.c @@ -23,7 +23,7 @@ #include #include -#define NAME "dlastindexof" +#define NAME "dlast_index_of" #define ITERATIONS 10000000 #define REPEATS 3 #define MIN 1 @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int idx; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int idx; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.js index b3cd464c0f8f..cec1693c1a8e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dlinspace = require( './../lib/dlinspace.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.native.js index d58a005bae59..42db3dfa6d32 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.js index e930d220388b..830005ddb8c4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dlinspace = require( './../lib/ndarray.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.native.js index a21ce2ea62d2..1cc14db4b549 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/c/benchmark.length.c index e4cee654d2e7..66f058d73c76 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dlinspace/benchmark/c/benchmark.length.c @@ -97,10 +97,11 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; } @@ -116,6 +117,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -128,10 +130,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; } @@ -147,6 +150,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.js index 3c721e328a10..9a1ee291b18e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.js @@ -26,6 +26,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnanasumors = require( './../lib/dnanasumors.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.native.js index 74fcc04e2d9f..d4334d3b61de 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.js index 254ba619c2af..7ef33d89fd86 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnanasumors = require( './../lib/ndarray.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.native.js index b0db4117c1ab..06b039d9d278 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/c/benchmark.length.c index 1f6cd9337e24..db331dbab267 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasumors/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -121,6 +122,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -133,11 +135,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -158,6 +161,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.js index 51f974a28860..e33b333877bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsum = require( './../lib/dnannsum.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.native.js index 7aa125519eae..90603fd4db5e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.js index 02765b380193..f918bec51534 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsum = require( './../lib/ndarray.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.native.js index 3115781fabba..1097cdd05dd8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/c/benchmark.length.c index 69fb6480448b..17b63731b06e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsum/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -125,6 +126,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -137,12 +139,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -165,6 +168,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.js index 017e8f653530..2fd6ea9a0f69 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumkbn = require( './../lib/dnannsumkbn.js' ); @@ -105,7 +106,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.native.js index 8377b89e6018..f4e747f0c05e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -114,7 +115,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.js index a858e37dcbe6..458728694b85 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumkbn = require( './../lib/ndarray.js' ); @@ -105,7 +106,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.native.js index 85c71f4b5990..7cb95fcf1d40 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -114,7 +115,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/c/benchmark.length.c index 736173f36dbf..420061b630fc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -125,6 +126,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -137,12 +139,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -165,6 +168,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.js index a525fc43b1a6..1d5738529073 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumkbn2 = require( './../lib/dnannsumkbn2.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.native.js index 29ed5cfbfa5c..2beff7341384 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.js index cba5711081b7..f4c52fcfe3a8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumkbn2 = require( './../lib/ndarray.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.native.js index ceb8642adf7b..2e6d6b2a9ecd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/c/benchmark.length.c index a9667f4288a4..e2b49d846709 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -125,6 +126,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -137,12 +139,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -165,6 +168,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js index 7415a03a2899..772b06984eeb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js @@ -27,6 +27,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumors = require( './../lib/dnannsumors.js' ); @@ -105,7 +106,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js index d0e54003d8bc..10a8dc9a541a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -114,7 +115,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js index 28ad2ca5f7d7..691cd7a23855 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumors = require( './../lib/ndarray.js' ); @@ -105,7 +106,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js index 6a1ad48681f4..cecfc277bbcf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -114,7 +115,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/c/benchmark.length.c index 7e6597e4c687..02cbeebf9676 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -125,6 +126,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -137,12 +139,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -165,6 +168,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.js index 20e44ba6a7b0..cb0cf2a04100 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumpw = require( './../lib/dnannsumpw.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.native.js index e783e0d5c12e..84152b8c78dd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.js index 87a3494f4131..689c4613ef4e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnannsumpw = require( './../lib/ndarray.js' ); @@ -107,7 +108,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.native.js index 7f4f4a8404a3..6bd596108b22 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/benchmark.ndarray.native.js @@ -29,6 +29,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -116,7 +117,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/c/benchmark.length.c index 291e6bf21988..3c1160635b64 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -125,6 +126,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -137,12 +139,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; CBLAS_INT n; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -165,6 +168,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.js index c5446d7b58e0..c37ce3913cef 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.js @@ -26,6 +26,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnansum = require( './../lib/dnansum.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.native.js index 3b715984f847..94165ce858c0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.js index bcec342a738a..7496df0e679f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnansum = require( './../lib/ndarray.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.native.js index 9d50073767a6..23322782245e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.js index 8ff51bb1e622..365aa0f64445 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.js @@ -26,6 +26,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnansumkbn = require( './../lib/dnansumkbn.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.native.js index 880561c32c63..56404a0d51a8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.js index e4fc6e253aee..86387a25db9c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dnansumkbn = require( './../lib/ndarray.js' ); @@ -103,7 +104,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.native.js index 2ebc2d87da82..cc51dcb461bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/benchmark/benchmark.ndarray.native.js @@ -28,6 +28,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -112,7 +113,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts index 625a7357d9ec..713574213006 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts @@ -21,8 +21,11 @@ /* eslint-disable max-lines */ import cfill = require( '@stdlib/blas/ext/base/cfill' ); +import cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' ); +import coneTo = require( '@stdlib/blas/ext/base/cone-to' ); import csum = require( '@stdlib/blas/ext/base/csum' ); import csumkbn = require( '@stdlib/blas/ext/base/csumkbn' ); +import czeroTo = require( '@stdlib/blas/ext/base/czero-to' ); import dapx = require( '@stdlib/blas/ext/base/dapx' ); import dapxsum = require( '@stdlib/blas/ext/base/dapxsum' ); import dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' ); @@ -30,6 +33,7 @@ import dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' ); import dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' ); import dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ); import dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); +import dcircshift = require( '@stdlib/blas/ext/base/dcircshift' ); import dcusum = require( '@stdlib/blas/ext/base/dcusum' ); import dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' ); import dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' ); @@ -37,6 +41,7 @@ import dcusumors = require( '@stdlib/blas/ext/base/dcusumors' ); import dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' ); import dfill = require( '@stdlib/blas/ext/base/dfill' ); import dindexOf = require( '@stdlib/blas/ext/base/dindex-of' ); +import dindexOfRow = require( '@stdlib/blas/ext/base/dindex-of-row' ); import dlastIndexOf = require( '@stdlib/blas/ext/base/dlast-index-of' ); import dlinspace = require( '@stdlib/blas/ext/base/dlinspace' ); import dnanasum = require( '@stdlib/blas/ext/base/dnanasum' ); @@ -52,13 +57,19 @@ import dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); import dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' ); import dnansumors = require( '@stdlib/blas/ext/base/dnansumors' ); import dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' ); +import doneTo = require( '@stdlib/blas/ext/base/done-to' ); import drev = require( '@stdlib/blas/ext/base/drev' ); +import drrss = require( '@stdlib/blas/ext/base/drrss' ); +import drss = require( '@stdlib/blas/ext/base/drss' ); +import drssbl = require( '@stdlib/blas/ext/base/drssbl' ); +import drsskbn = require( '@stdlib/blas/ext/base/drsskbn' ); import dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' ); import dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' ); import dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' ); import dsnansum = require( '@stdlib/blas/ext/base/dsnansum' ); import dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' ); import dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' ); +import dsort = require( '@stdlib/blas/ext/base/dsort' ); import dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' ); import dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' ); import dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' ); @@ -73,6 +84,7 @@ import dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' ); import dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' ); import dsumors = require( '@stdlib/blas/ext/base/dsumors' ); import dsumpw = require( '@stdlib/blas/ext/base/dsumpw' ); +import dzeroTo = require( '@stdlib/blas/ext/base/dzero-to' ); import gapx = require( '@stdlib/blas/ext/base/gapx' ); import gapxsum = require( '@stdlib/blas/ext/base/gapxsum' ); import gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' ); @@ -80,6 +92,8 @@ import gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' ); import gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' ); import gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ); import gasumpw = require( '@stdlib/blas/ext/base/gasumpw' ); +import gcircshift = require( '@stdlib/blas/ext/base/gcircshift' ); +import gconjoin = require( '@stdlib/blas/ext/base/gconjoin' ); import gcusum = require( '@stdlib/blas/ext/base/gcusum' ); import gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); import gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' ); @@ -90,7 +104,10 @@ import gfillBy = require( '@stdlib/blas/ext/base/gfill-by' ); import gfindIndex = require( '@stdlib/blas/ext/base/gfind-index' ); import gfindLastIndex = require( '@stdlib/blas/ext/base/gfind-last-index' ); import gindexOf = require( '@stdlib/blas/ext/base/gindex-of' ); +import gindexOfColumn = require( '@stdlib/blas/ext/base/gindex-of-column' ); import gindexOfRow = require( '@stdlib/blas/ext/base/gindex-of-row' ); +import gjoin = require( '@stdlib/blas/ext/base/gjoin' ); +import gjoinBetween = require( '@stdlib/blas/ext/base/gjoin-between' ); import glastIndexOf = require( '@stdlib/blas/ext/base/glast-index-of' ); import glinspace = require( '@stdlib/blas/ext/base/glinspace' ); import gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' ); @@ -100,7 +117,9 @@ import gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); import gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); import gnansumors = require( '@stdlib/blas/ext/base/gnansumors' ); import gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' ); +import goneTo = require( '@stdlib/blas/ext/base/gone-to' ); import grev = require( '@stdlib/blas/ext/base/grev' ); +import gsort = require( '@stdlib/blas/ext/base/gsort' ); import gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' ); import gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' ); import gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' ); @@ -112,6 +131,7 @@ import gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' ); import gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' ); import gsumors = require( '@stdlib/blas/ext/base/gsumors' ); import gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ); +import gzeroTo = require( '@stdlib/blas/ext/base/gzero-to' ); import ndarray = require( '@stdlib/blas/ext/base/ndarray' ); import sapx = require( '@stdlib/blas/ext/base/sapx' ); import sapxsum = require( '@stdlib/blas/ext/base/sapxsum' ); @@ -120,6 +140,7 @@ import sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' ); import sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' ); import sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' ); import sasumpw = require( '@stdlib/blas/ext/base/sasumpw' ); +import scircshift = require( '@stdlib/blas/ext/base/scircshift' ); import scusum = require( '@stdlib/blas/ext/base/scusum' ); import scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' ); import scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' ); @@ -133,6 +154,7 @@ import sdssum = require( '@stdlib/blas/ext/base/sdssum' ); import sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' ); import sfill = require( '@stdlib/blas/ext/base/sfill' ); import sindexOf = require( '@stdlib/blas/ext/base/sindex-of' ); +import sindexOfRow = require( '@stdlib/blas/ext/base/sindex-of-row' ); import slastIndexOf = require( '@stdlib/blas/ext/base/slast-index-of' ); import slinspace = require( '@stdlib/blas/ext/base/slinspace' ); import snansum = require( '@stdlib/blas/ext/base/snansum' ); @@ -140,6 +162,7 @@ import snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ); import snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' ); import snansumors = require( '@stdlib/blas/ext/base/snansumors' ); import snansumpw = require( '@stdlib/blas/ext/base/snansumpw' ); +import soneTo = require( '@stdlib/blas/ext/base/sone-to' ); import srev = require( '@stdlib/blas/ext/base/srev' ); import ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' ); import ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' ); @@ -152,10 +175,14 @@ import ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' ); import ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' ); import ssumors = require( '@stdlib/blas/ext/base/ssumors' ); import ssumpw = require( '@stdlib/blas/ext/base/ssumpw' ); +import szeroTo = require( '@stdlib/blas/ext/base/szero-to' ); import wasm = require( '@stdlib/blas/ext/base/wasm' ); import zfill = require( '@stdlib/blas/ext/base/zfill' ); +import zindexOfRow = require( '@stdlib/blas/ext/base/zindex-of-row' ); +import zoneTo = require( '@stdlib/blas/ext/base/zone-to' ); import zsum = require( '@stdlib/blas/ext/base/zsum' ); import zsumkbn = require( '@stdlib/blas/ext/base/zsumkbn' ); +import zzeroTo = require( '@stdlib/blas/ext/base/zzero-to' ); /** * Interface describing the `base` namespace. @@ -194,6 +221,75 @@ interface Namespace { */ cfill: typeof cfill; + /** + * Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Complex64Array = require( `@stdlib/array/complex64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + * + * @example + * var Complex64Array = require( `@stdlib/array/complex64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.cindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + cindexOfRow: typeof cindexOfRow; + + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.coneTo( x.length, x, 1 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.coneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + */ + coneTo: typeof coneTo; + /** * Computes the sum of single-precision complex floating-point strided array elements. * @@ -246,6 +342,32 @@ interface Namespace { */ csumkbn: typeof csumkbn; + /** + * Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.czeroTo( x.length, x, 1 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.czeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + */ + czeroTo: typeof czeroTo; + /** * Adds a scalar constant to each element in a double-precision floating-point strided array. * @@ -434,6 +556,33 @@ interface Namespace { */ dasumpw: typeof dasumpw; + /** + * Circularly shifts the elements of a double-precision floating-point strided array by a specified number of positions. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * ns.dcircshift( x.length, 2, x, 1 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * ns.dcircshift.ndarray( x.length, 2, x, 1, 0 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + dcircshift: typeof dcircshift; + /** * Computes the cumulative sum of double-precision floating-point strided array elements. * @@ -647,6 +796,49 @@ interface Namespace { */ dindexOf: typeof dindexOf; + /** + * Returns the index of the first row in a double-precision floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Float64Array = require( `@stdlib/array/float64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float64Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.dindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + * + * @example + * var Float64Array = require( `@stdlib/array/float64` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float64Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float64Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.dindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + dindexOfRow: typeof dindexOfRow; + /** * Returns the last index of a specified search element in a double-precision floating-point strided array. * @@ -1086,6 +1278,32 @@ interface Namespace { */ dnansumpw: typeof dnansumpw; + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.doneTo( x.length, x, 1 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.doneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + doneTo: typeof doneTo; + /** * Reverses a double-precision floating-point strided array in-place. * @@ -1112,6 +1330,126 @@ interface Namespace { */ drev: typeof drev; + /** + * Computes the square root of the residual sum of squares of two double-precision floating-point strided arrays. + * + * @param N - number of indexed elements + * @param x - first input array + * @param strideX - stride length of `x` + * @param y - second input array + * @param strideY - stride length of `y` + * @returns square root of the residual sum of squares + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); + * + * var out = ns.drrss( x.length, x, 1, y, 1 ); + * // returns ~6.7 + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); + * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); + * + * var z = ns.drrss.ndarray( x.length, x, 1, 0, y, 1, 0 ); + * // returns ~8.485 + */ + drrss: typeof drrss; + + /** + * Computes the residual sum of squares of two double-precision floating-point strided arrays. + * + * @param N - number of indexed elements + * @param x - first input array + * @param strideX - stride length of `x` + * @param y - second input array + * @param strideY - stride length of `y` + * @returns residual sum of squares + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); + * + * var out = ns.drss( x.length, x, 1, y, 1 ); + * // returns 45.0 + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); + * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); + * + * var z = ns.drss.ndarray( x.length, x, 1, 0, y, 1, 0 ); + * // returns 72.0 + */ + drss: typeof drss; + + /** + * Computes the residual sum of squares of two double-precision floating-point strided arrays using Blue's algorithm. + * + * @param N - number of indexed elements + * @param x - first input array + * @param strideX - stride length of `x` + * @param y - second input array + * @param strideY - stride length of `y` + * @returns residual sum of squares + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); + * + * var out = ns.drssbl( x.length, x, 1, y, 1 ); + * // returns 45.0 + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); + * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); + * + * var z = ns.drssbl.ndarray( x.length, x, 1, 0, y, 1, 0 ); + * // returns 72.0 + */ + drssbl: typeof drssbl; + + /** + * Computes the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm. + * + * @param N - number of indexed elements + * @param x - first input array + * @param strideX - stride length of `x` + * @param y - second input array + * @param strideY - stride length of `y` + * @returns residual sum of squares + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); + * + * var out = ns.drsskbn( x.length, x, 1, y, 1 ); + * // returns 45.0 + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); + * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); + * + * var z = ns.drsskbn.ndarray( x.length, x, 1, 0, y, 1, 0 ); + * // returns 72.0 + */ + drsskbn: typeof drsskbn; + /** * Adds a scalar constant to each single-precision floating-point strided array element, and computes the sum using extended accumulation and returning an extended precision result. * @@ -1276,6 +1614,33 @@ interface Namespace { */ dsnansumpw: typeof dsnansumpw; + /** + * Sorts a double-precision floating-point strided array. + * + * @param N - number of indexed elements + * @param order - sort order + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * + * ns.dsort( x.length, 1.0, x, 1 ); + * // x => [ -4.0, -2.0, 1.0, 3.0 ] + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * + * ns.dsort.ndarray( x.length, 1.0, x, 1, 0 ); + * // x => [ -4.0, -2.0, 1.0, 3.0 ] + */ + dsort: typeof dsort; + /** * Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort. * @@ -1688,6 +2053,32 @@ interface Namespace { */ dsumpw: typeof dsumpw; + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.dzeroTo( x.length, x, 1 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.dzeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + */ + dzeroTo: typeof dzeroTo; + /** * Adds a scalar constant to each element in a strided array. * @@ -1848,6 +2239,55 @@ interface Namespace { */ gasumpw: typeof gasumpw; + /** + * Circularly shifts the elements of a strided array by a specified number of positions. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * + * ns.gcircshift( x.length, 2, x, 1 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * + * ns.gcircshift.ndarray( x.length, 2, x, 1, 0 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + gcircshift: typeof gcircshift; + + /** + * Returns a string created by joining strided array elements into a human-readable list using a conjunction. + * + * @param N - number of indexed elements + * @param prefix - string to prepend + * @param suffix - string to append + * @param conjunction - conjunction before the last element + * @param oxfordComma - boolean specifying whether to include an Oxford comma + * @param x - input array + * @param strideX - stride length + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var str = ns.gconjoin( x.length, '', '', 'and', true, x, 1 ); + * // returns '1, 2, 3, and 4' + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var str = ns.gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); + * // returns '1, 2, 3, and 4' + */ + gconjoin: typeof gconjoin; + /** * Computes the cumulative sum of strided array elements. * @@ -2162,6 +2602,38 @@ interface Namespace { */ gindexOf: typeof gindexOf; + /** + * Returns the index of the first column in an input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @returns column index + * + * @example + * var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] + * var x = [ 2.0, 4.0, 0.0 ]; + * + * var out = ns.gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); + * // returns 1 + * + * @example + * var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] + * var x = [ 2.0, 4.0, 0.0 ]; + * + * var out = ns.gindexOfColumn.ndarray( 3, 2, A, 2, 1, 0, x, 1, 0 ); + * // returns 1 + */ + gindexOfColumn: typeof gindexOfColumn; + /** * Returns the index of the first row in an input matrix which has the same elements as a provided search vector. * @@ -2194,6 +2666,57 @@ interface Namespace { */ gindexOfRow: typeof gindexOfRow; + /** + * Returns a string created by joining strided array elements using a specified separator. + * + * @param N - number of indexed elements + * @param sep - separator + * @param x - input array + * @param strideX - stride length + * @returns joined string + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0 ]; + * + * var str = ns.gjoin( x.length, ',', x, 1 ); + * // returns '1,2,3,4' + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0 ]; + * + * var str = ns.gjoin.ndarray( x.length, ',', x, 1, 0 ); + * // returns '1,2,3,4' + */ + gjoin: typeof gjoin; + + /** + * Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. + * + * @param N - number of indexed elements + * @param prefix - string to prepend to the output string + * @param suffix - string to append to the output string + * @param x - input array + * @param strideX - stride length for `x` + * @param separators - separators array + * @param strideS - stride length for `separators` + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * var sep = [ ' + ', ' - ', ' != ' ]; + * + * var str = ns.gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); + * // returns 'op: 1 + 2 - 3 != 4' + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * var sep = [ ' + ', ' - ', ' != ' ]; + * + * var str = ns.gjoinBetween.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); + * // returns 'op: 1 + 2 - 3 != 4' + */ + gjoinBetween: typeof gjoinBetween; + /** * Returns the last index of a specified search element in a strided array. * @@ -2420,6 +2943,28 @@ interface Namespace { */ gnansumpw: typeof gnansumpw; + /** + * Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * ns.goneTo( x.length, x, 1 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * ns.goneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + goneTo: typeof goneTo; + /** * Reverses a strided array in-place. * @@ -2442,6 +2987,29 @@ interface Namespace { */ grev: typeof grev; + /** + * Sorts a strided array. + * + * @param N - number of indexed elements + * @param order - sort order + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var x = [ 1.0, -2.0, 3.0, -4.0 ]; + * + * ns.gsort( x.length, 1, x, 1 ); + * // x => [ -4.0, -2.0, 1.0, 3.0 ] + * + * @example + * var x = [ 1.0, -2.0, 3.0, -4.0 ]; + * + * ns.gsort.ndarray( x.length, 1, x, 1, 0 ); + * // x => [ -4.0, -2.0, 1.0, 3.0 ] + */ + gsort: typeof gsort; + /** * Simultaneously sorts two strided arrays based on the sort order of the first array using heapsort. * @@ -2732,6 +3300,28 @@ interface Namespace { */ gsumpw: typeof gsumpw; + /** + * Fills a strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * ns.gzeroTo( x.length, x, 1 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * ns.gzeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + */ + gzeroTo: typeof gzeroTo; + /** * Base ndarray extended BLAS functions. */ @@ -2925,6 +3515,33 @@ interface Namespace { */ sasumpw: typeof sasumpw; + /** + * Circularly shifts the elements of a single-precision floating-point strided array by a specified number of positions. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * ns.scircshift( x.length, 2, x, 1 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * + * ns.scircshift.ndarray( x.length, 2, x, 1, 0 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + scircshift: typeof scircshift; + /** * Computes the cumulative sum of single-precision floating-point strided array elements. * @@ -3296,6 +3913,49 @@ interface Namespace { */ sindexOf: typeof sindexOf; + /** + * Returns the index of the first row in a single-precision floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Float32Array = require( `@stdlib/array/float32` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float32Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float32Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.sindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + * + * @example + * var Float32Array = require( `@stdlib/array/float32` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Float32Array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); + * var x = new Float32Array( [ 2.0, 4.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.sindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + sindexOfRow: typeof sindexOfRow; + /** * Returns the last index of a specified search element in a single-precision floating-point strided array. * @@ -3502,6 +4162,32 @@ interface Namespace { */ snansumpw: typeof snansumpw; + /** + * Fills a single-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.soneTo( x.length, x, 1 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.soneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + soneTo: typeof soneTo; + /** * Reverses a single-precision floating-point strided array in-place. * @@ -3862,6 +4548,32 @@ interface Namespace { */ ssumpw: typeof ssumpw; + /** + * Fills a single-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.szeroTo( x.length, x, 1 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var x = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.szeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + */ + szeroTo: typeof szeroTo; + /** * Extensions to basic linear algebra subprograms (BLAS) compiled to WebAssembly. */ @@ -3893,6 +4605,75 @@ interface Namespace { */ zfill: typeof zfill; + /** + * Returns the index of the first row in a double-precision complex floating-point input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @param workspace - workspace array for tracking row match candidates + * @param strideW - stride length for `workspace` + * @returns row index + * + * @example + * var Complex128Array = require( `@stdlib/array/complex128` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex128Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex128Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.zindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 ); + * // returns 1 + * + * @example + * var Complex128Array = require( `@stdlib/array/complex128` ); + * var Uint8Array = require( `@stdlib/array/uint8` ); + * + * var A = new Complex128Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] ); + * var x = new Complex128Array( [ 2.0, 0.0, 4.0, 0.0 ] ); + * var workspace = new Uint8Array( 3 ); + * + * var out = ns.zindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 ); + * // returns 1 + */ + zindexOfRow: typeof zindexOfRow; + + /** + * Fills a double-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.zoneTo( x.length, x, 1 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.zoneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] + */ + zoneTo: typeof zoneTo; + /** * Computes the sum of double-precision complex floating-point strided array elements. * @@ -3944,6 +4725,32 @@ interface Namespace { * // returns [ 3.0, 1.0 ] */ zsumkbn: typeof zsumkbn; + + /** + * Fills a double-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.zzeroTo( x.length, x, 1 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * + * ns.zzeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + */ + zzeroTo: typeof zzeroTo; } /** diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/done-to/README.md new file mode 100644 index 000000000000..8add9728b8a6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/README.md @@ -0,0 +1,279 @@ + + +# doneTo + +> Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +
+ +## Usage + +```javascript +var doneTo = require( '@stdlib/blas/ext/base/done-to' ); +``` + +#### doneTo( N, x, strideX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +doneTo( x.length, x, 1 ); +// x => [ 1.0, 2.0, 3.0, 4.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input [`Float64Array`][@stdlib/array/float64]. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +doneTo( 3, x, 2 ); +// x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array... +var x0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +// Create an offset view... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Fill every other element... +doneTo( 3, x1, 2 ); +// x0 => [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] +``` + +#### doneTo.ndarray( N, x, strideX, offsetX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +doneTo.ndarray( x.length, x, 1, 0 ); +// x => [ 1.0, 2.0, 3.0, 4.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +doneTo.ndarray( 3, x, 1, x.length-3 ); +// x => [ 0.0, 0.0, 0.0, 1.0, 2.0, 3.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `x` unchanged. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var doneTo = require( '@stdlib/blas/ext/base/done-to' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +doneTo( x.length, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/done_to.h" +``` + +#### stdlib_strided_done_to( N, \*X, strideX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + +```c +double x[] = { 0.0, 0.0, 0.0, 0.0 }; + +stdlib_strided_done_to( 4, x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. + +```c +void API_SUFFIX(stdlib_strided_done_to)( const CBLAS_INT N, double *X, const CBLAS_INT strideX ); +``` + +#### stdlib_strided_done_to_ndarray( N, \*X, strideX, offsetX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + +```c +double x[] = { 0.0, 0.0, 0.0, 0.0 }; + +stdlib_strided_done_to_ndarray( 4, x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. + +```c +void API_SUFFIX(stdlib_strided_done_to_ndarray)( const CBLAS_INT N, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/done_to.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // Specify the number of indexed elements: + const int N = 8; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_done_to( N, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.js new file mode 100644 index 000000000000..eb94fc60961a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var doneTo = require( './../lib/done_to.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = doneTo( x.length, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.native.js new file mode 100644 index 000000000000..4c6d1b67708b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.native.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var doneTo = tryRequire( resolve( __dirname, './../lib/done_to.native.js' ) ); +var opts = { + 'skip': ( doneTo instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = doneTo( x.length, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..5cdb7b2bc96e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var doneTo = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = doneTo( x.length, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..739166477851 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var doneTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( doneTo instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = doneTo( x.length, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..ccc790584100 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/benchmark/c/benchmark.length.c @@ -0,0 +1,191 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/done_to.h" +#include +#include +#include +#include +#include + +#define NAME "done_to" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static double rand_double( void ) { + int r = rand(); + return (double)r / ( (double)RAND_MAX + 1.0 ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int len ) { + double elapsed; + double *x; + double t; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_done_to( len, x, 1 ); + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int len ) { + double elapsed; + double *x; + double t; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_done_to_ndarray( len, x, 1, 0 ); + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:len=%d\n", NAME, len ); + elapsed = benchmark1( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:len=%d\n", NAME, len ); + elapsed = benchmark2( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/done-to/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/repl.txt new file mode 100644 index 000000000000..3c8c40c6e911 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/repl.txt @@ -0,0 +1,92 @@ + +{{alias}}( N, x, strideX ) + Fills a double-precision floating-point strided array with linearly spaced + numeric elements which increment by `1` starting from one. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( x.length, x, 1 ) + [ 1.0, 2.0, 3.0, 4.0 ] + + // Using `N` and stride parameters: + > x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( 3, x, 2 ) + [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 3, x1, 2 ) + [ 1.0, 0.0, 2.0, 0.0, 3.0 ] + > x0 + [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] + + +{{alias}}.ndarray( N, x, strideX, offsetX ) + Fills a double-precision floating-point strided array with linearly spaced + numeric elements which increment by `1` starting from one using alternative + indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( x.length, x, 1, 0 ) + [ 1.0, 2.0, 3.0, 4.0 ] + + // Using an index offset: + > x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( 3, x, 2, 1 ) + [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/index.d.ts new file mode 100644 index 000000000000..bedd1516bb98 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/index.d.ts @@ -0,0 +1,92 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Interface describing `doneTo`. +*/ +interface Routine { + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * doneTo( x.length, x, 1 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + ( N: number, x: Float64Array, strideX: number ): Float64Array; + + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * doneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + ndarray( N: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; +} + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param N - number of indexed elements +* @param x - input array +* @param strideX - stride length +* @returns input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +declare var doneTo: Routine; + + +// EXPORTS // + +export = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/test.ts new file mode 100644 index 000000000000..681cd2bcce2c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/docs/types/test.ts @@ -0,0 +1,157 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 doneTo = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + doneTo( x.length, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + doneTo( '10', x, 1 ); // $ExpectError + doneTo( true, x, 1 ); // $ExpectError + doneTo( false, x, 1 ); // $ExpectError + doneTo( null, x, 1 ); // $ExpectError + doneTo( undefined, x, 1 ); // $ExpectError + doneTo( [], x, 1 ); // $ExpectError + doneTo( {}, x, 1 ); // $ExpectError + doneTo( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + doneTo( x.length, 10, 1 ); // $ExpectError + doneTo( x.length, '10', 1 ); // $ExpectError + doneTo( x.length, true, 1 ); // $ExpectError + doneTo( x.length, false, 1 ); // $ExpectError + doneTo( x.length, null, 1 ); // $ExpectError + doneTo( x.length, undefined, 1 ); // $ExpectError + doneTo( x.length, [], 1 ); // $ExpectError + doneTo( x.length, {}, 1 ); // $ExpectError + doneTo( x.length, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + doneTo( x.length, x, '10' ); // $ExpectError + doneTo( x.length, x, true ); // $ExpectError + doneTo( x.length, x, false ); // $ExpectError + doneTo( x.length, x, null ); // $ExpectError + doneTo( x.length, x, undefined ); // $ExpectError + doneTo( x.length, x, [] ); // $ExpectError + doneTo( x.length, x, {} ); // $ExpectError + doneTo( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + doneTo(); // $ExpectError + doneTo( x.length ); // $ExpectError + doneTo( x.length, x ); // $ExpectError + doneTo( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray( x.length, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray( '10', x, 1, 0 ); // $ExpectError + doneTo.ndarray( true, x, 1, 0 ); // $ExpectError + doneTo.ndarray( false, x, 1, 0 ); // $ExpectError + doneTo.ndarray( null, x, 1, 0 ); // $ExpectError + doneTo.ndarray( undefined, x, 1, 0 ); // $ExpectError + doneTo.ndarray( [], x, 1, 0 ); // $ExpectError + doneTo.ndarray( {}, x, 1, 0 ); // $ExpectError + doneTo.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray( x.length, 10, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, '10', 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, true, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, false, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, null, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, [], 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, {}, 1, 0 ); // $ExpectError + doneTo.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray( x.length, x, '10', 0 ); // $ExpectError + doneTo.ndarray( x.length, x, true, 0 ); // $ExpectError + doneTo.ndarray( x.length, x, false, 0 ); // $ExpectError + doneTo.ndarray( x.length, x, null, 0 ); // $ExpectError + doneTo.ndarray( x.length, x, undefined, 0 ); // $ExpectError + doneTo.ndarray( x.length, x, [], 0 ); // $ExpectError + doneTo.ndarray( x.length, x, {}, 0 ); // $ExpectError + doneTo.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray( x.length, x, 1, '10' ); // $ExpectError + doneTo.ndarray( x.length, x, 1, true ); // $ExpectError + doneTo.ndarray( x.length, x, 1, false ); // $ExpectError + doneTo.ndarray( x.length, x, 1, null ); // $ExpectError + doneTo.ndarray( x.length, x, 1, undefined ); // $ExpectError + doneTo.ndarray( x.length, x, 1, [] ); // $ExpectError + doneTo.ndarray( x.length, x, 1, {} ); // $ExpectError + doneTo.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + doneTo.ndarray(); // $ExpectError + doneTo.ndarray( x.length ); // $ExpectError + doneTo.ndarray( x.length, x ); // $ExpectError + doneTo.ndarray( x.length, x, 1 ); // $ExpectError + doneTo.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/example.c new file mode 100644 index 000000000000..729eef8c4327 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/c/example.c @@ -0,0 +1,39 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/done_to.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // Specify the number of indexed elements: + const int N = 8; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_done_to( N, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/index.js new file mode 100644 index 000000000000..96f7f3dbf59d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 doneTo = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +doneTo( x.length, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/done-to/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function doneTo( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/done_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/done_to.native.js new file mode 100644 index 000000000000..22b2ad7bc9bd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/done_to.native.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function doneTo( N, x, strideX ) { + addon( N, x, strideX ); + return x; +} + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/index.js new file mode 100644 index 000000000000..eef1fe9d3df7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @module @stdlib/blas/ext/base/done-to +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var doneTo = require( '@stdlib/blas/ext/base/done-to' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var doneTo = require( '@stdlib/blas/ext/base/done-to' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var doneTo; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + doneTo = main; +} else { + doneTo = tmp; +} + + +// EXPORTS // + +module.exports = doneTo; + +// exports: { "ndarray": "doneTo.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/main.js new file mode 100644 index 000000000000..8b6c1b839032 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var doneTo = require( './done_to.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( doneTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/native.js new file mode 100644 index 000000000000..858d66e12fb7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var doneTo = require( './done_to.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( doneTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.js new file mode 100644 index 000000000000..e1110320489f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.js @@ -0,0 +1,58 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function doneTo( N, x, strideX, offsetX ) { + var ix; + var i; + + if ( N <= 0 ) { + return x; + } + ix = offsetX; + for ( i = 1; i <= N; i++ ) { + x[ ix ] = i; + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.native.js new file mode 100644 index 000000000000..e11277d95692 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/lib/ndarray.native.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* doneTo( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function doneTo( N, x, strideX, offsetX ) { + addon.ndarray( N, x, strideX, offsetX ); + return x; +} + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/done-to/manifest.json new file mode 100644 index 000000000000..fb41f9fb7ad5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/manifest.json @@ -0,0 +1,78 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/done-to/package.json new file mode 100644 index 000000000000..3bc2ecd4712c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/package.json @@ -0,0 +1,79 @@ +{ + "name": "@stdlib/blas/ext/base/done-to", + "version": "0.0.0", + "description": "Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "assign", + "set", + "one-to", + "oneto", + "sequence", + "seq", + "strided", + "array", + "ndarray", + "float64", + "double", + "float64array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/addon.c new file mode 100644 index 000000000000..209c4cc06585 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/addon.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/done_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_done_to)( N, X, strideX ); + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_done_to_ndarray)( N, X, strideX, offsetX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/main.c new file mode 100644 index 000000000000..55f4b84dee21 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/src/main.c @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/done_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/strided/base/stride2offset.h" + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +*/ +void API_SUFFIX(stdlib_strided_done_to)( const CBLAS_INT N, double *X, const CBLAS_INT strideX ) { + CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); + API_SUFFIX(stdlib_strided_done_to_ndarray)( N, X, strideX, ox ); +} + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +* @param offsetX starting index +*/ +void API_SUFFIX(stdlib_strided_done_to_ndarray)( const CBLAS_INT N, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + CBLAS_INT ix; + CBLAS_INT i; + double v; + + if ( N <= 0 ) { + return; + } + ix = offsetX; + v = 1.0; + for ( i = 0; i < N; i++ ) { + X[ ix ] = v; + v += 1.0; + ix += strideX; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.js new file mode 100644 index 000000000000..10a577d1fdac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.js @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 doneTo = require( './../lib/done_to.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( doneTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = doneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + doneTo( 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + doneTo( -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]); + + doneTo( x.length, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]); + + doneTo( 3, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]); + + doneTo( 3, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, + 1.0, // 0 + 3.0, + 2.0, // 1 + 5.0, + 3.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + doneTo( 3, x1, 2 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.native.js new file mode 100644 index 000000000000..3d672ca29a1d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.done_to.native.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var doneTo = tryRequire( resolve( __dirname, './../lib/done_to.native.js' ) ); +var opts = { + 'skip': ( doneTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', opts, function test( t ) { + t.strictEqual( doneTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = doneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + doneTo( 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + doneTo( -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]); + + doneTo( x.length, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]); + + doneTo( 3, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]); + + doneTo( 3, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', opts, function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, + 1.0, // 0 + 3.0, + 2.0, // 1 + 5.0, + 3.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + doneTo( 3, x1, 2 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.js new file mode 100644 index 000000000000..8cd8e7864241 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var doneTo = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof doneTo.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var doneTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( doneTo, mock, 'returns native implementation' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var doneTo; + var main; + + main = require( './../lib/done_to.js' ); + + doneTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( doneTo, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.js new file mode 100644 index 000000000000..5fe9e6c289d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.js @@ -0,0 +1,171 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 doneTo = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( doneTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = doneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + doneTo( 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + doneTo( -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]); + + doneTo( x.length, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]); + + doneTo( 3, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]); + + doneTo( 3, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]); + expected = new Float64Array([ + 1.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 6.0, + 7.0 + ]); + + doneTo( 3, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.native.js new file mode 100644 index 000000000000..10824ac50d54 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/done-to/test/test.ndarray.native.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var doneTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( doneTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', opts, function test( t ) { + t.strictEqual( doneTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = doneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + doneTo( 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + doneTo( -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]); + + doneTo( x.length, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]); + + doneTo( 3, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]); + + doneTo( 3, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]); + expected = new Float64Array([ + 1.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 6.0, + 7.0 + ]); + + doneTo( 3, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.js index 96bebf87b1cc..f826e90be25a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drev = require( './../lib/drev.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.native.js index 96f45a9427b2..98f637fc527e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.js index 1cac1d1b03f0..a28e61052c46 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drev = require( './../lib/ndarray.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.native.js index bef7e3ffceaf..363a2ec3b092 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -82,6 +83,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -95,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/c/benchmark.length.c index 4c34b9f7e9b5..4c02eb304f45 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/drev/benchmark/c/benchmark.length.c @@ -96,10 +96,11 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; } @@ -115,6 +116,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -127,10 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; } @@ -146,6 +149,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.js index bae26a0976dc..73e5db639cbe 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drrss = require( './../lib/drrss.js' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.native.js index 6bdd6cb4c785..56476f7594e8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.js index 1c5a8b6ffac3..3dde43aa6458 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var drrss = require( './../lib/ndarray.js' ); @@ -96,7 +97,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.native.js index a01f8992ad6b..602ce7d7a257 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/drrss/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/drrss/docs/types/index.d.ts index fbef70b0053f..7352136d626b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drrss/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/drrss/docs/types/index.d.ts @@ -68,7 +68,7 @@ interface Routine { } /** -* Compute the square root of the residual sum of squares of two double-precision floating-point strided arrays. +* Computes the square root of the residual sum of squares of two double-precision floating-point strided arrays. * * @param N - number of indexed elements * @param x - first input array @@ -79,7 +79,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drrss = require( '@stdlib/blas/ext/base/drrss' ); * * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); @@ -89,7 +88,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drrss = require( '@stdlib/blas/ext/base/drrss' ); * * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/drss/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/drss/docs/types/index.d.ts index 7f0de634bb2c..4439bc5ec5ee 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drss/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/drss/docs/types/index.d.ts @@ -79,7 +79,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drss = require( '@stdlib/blas/ext/base/drss' ); * * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); @@ -89,7 +88,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drss = require( '@stdlib/blas/ext/base/drss' ); * * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/drssbl/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/drssbl/docs/types/index.d.ts index 9a86f70f90d0..4a358e1e6efc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drssbl/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/drssbl/docs/types/index.d.ts @@ -79,7 +79,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drssbl = require( '@stdlib/blas/ext/base/drssbl' ); * * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); @@ -89,7 +88,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drssbl = require( '@stdlib/blas/ext/base/drssbl' ); * * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/drsskbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/drsskbn/docs/types/index.d.ts index 1a0a6a28172a..e3196601cf30 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/drsskbn/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/drsskbn/docs/types/index.d.ts @@ -68,7 +68,7 @@ interface Routine { } /** -* Compute the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm. +* Computes the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm. * * @param N - number of indexed elements * @param x - first input array @@ -79,7 +79,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drsskbn = require( '@stdlib/blas/ext/base/drsskbn' ); * * var x = new Float64Array( [ 1.0, -2.0, 2.0 ] ); * var y = new Float64Array( [ 1.0, 1.0, -4.0 ] ); @@ -89,7 +88,6 @@ interface Routine { * * @example * var Float64Array = require( '@stdlib/array/float64' ); -* var drsskbn = require( '@stdlib/blas/ext/base/drsskbn' ); * * var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/benchmark/c/benchmark.length.c index be9263862053..ab8d1d9db2de 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsapxsum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/benchmark/c/benchmark.length.c index 765a825f0ad0..52b669a45d89 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsapxsumpw/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/benchmark/c/benchmark.length.c index 0dae157264c7..be24ff027c36 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnannsumors/benchmark/c/benchmark.length.c @@ -96,12 +96,13 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; CBLAS_INT n; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -124,6 +125,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -136,12 +138,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; CBLAS_INT n; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -164,6 +167,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v || n < 0 ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsnansum/benchmark/c/benchmark.length.c index a30b467c3b33..00fb46aee2c4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -122,6 +123,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -134,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -160,6 +163,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/benchmark/c/benchmark.length.c index c4079713f676..81ba6171f059 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansumors/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2 ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -122,6 +123,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -134,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2 ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -160,6 +163,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/benchmark/c/benchmark.length.c index 8f1e0b0bd91d..449bf104fc5a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -122,6 +123,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -134,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { if ( rand_float() < 0.2f ) { x[ i ] = 0.0f / 0.0f; // NaN @@ -160,6 +163,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/src/main.c index a95f2df9e147..03326f1ece28 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/src/main.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsnansumpw/src/main.c @@ -39,7 +39,7 @@ */ double API_SUFFIX(stdlib_strided_dsnansumpw)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - return API_SUFFIX( stdlib_strided_dsnansumpw_ndarray )( N, X, strideX, ox ); + return API_SUFFIX(stdlib_strided_dsnansumpw_ndarray)( N, X, strideX, ox ); } /** diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.js index 11632108f28e..316b2d72a237 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.native.js index 3bc8a70ba0e4..a70021a35bf1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index 2b5ee44cf660..c8b2dcfb84e7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index 0df9abe8e988..27e0d0d2fb02 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.js index d880bd8b6979..804bdb73d929 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.native.js index 01c094e24178..c255c6649b45 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.js index 271e482f3640..5a078225dea3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index d3a69b416252..197892274980 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index 4169bdb6ba72..5183db65bdeb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index c377a6968837..7d93fc9f5940 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index e333eefacce5..b7ef597af536 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index 4ac882c5fdeb..b810ce21031c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.js index 60f3763064bc..5521b309e59d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.native.js index c5509c8102db..7f8cbeb139e8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index d947c011e71f..7219d8693f52 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index 8a3d6c48ceb4..b8be75683c40 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.js index a8679d7c6160..4ebeccdd0c66 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.native.js index 273349024f43..157fbd787df0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index 5e15031d3ed3..5405c8b7799d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index 28f63c7f9384..54285c283b0b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.js index a69270cf9f1b..156ea5cb93ad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.native.js index 4b7035b70c62..5e853d42c31f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.js index 823e5790f878..81f417fb781a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.native.js index 42b5ab70058b..2b8c96d7368c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.js index 0c098f1e8ad8..124f2bafe1a0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.native.js index 0aebde335c0d..2192298bab93 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.js index a7163556bd83..78fedefb1196 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index 380b71dd1975..f7ae227d327a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.js index 23fc7dd832cf..233234a8b7e7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.native.js index 8442a3a70304..6345cd62b9be 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.js index ed4ebc8604fb..d21e5a86a057 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.native.js index efe85f915fe9..d65ec80031bd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.sorted_random.ndarray.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.js index 4f4e62c28466..9c0d965c51ed 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.js @@ -97,6 +97,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.native.js index 4c117f9c82ae..9dc141b55aaf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.native.js @@ -106,6 +106,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.js index 3906aa75604f..ed2d80d3a7d9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -97,6 +97,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index 7cd76f47e5df..0380b2c31ddf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -106,6 +106,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.js index bd58c94293bc..d0b40ed2fd62 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.native.js index c6796b877887..ffd705eab921 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.js index bd426ddc06d5..ee65d6c5be67 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.native.js index 7c025baf8992..aeab8df17668 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2hp/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.js index 9c56443901c5..9c2c09962550 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.native.js index 41208c9e3f06..3fcf53281a76 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index c8d6ce3aec76..9d2004d6b329 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index 5d6fefbd2b5e..3148164271d5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.js index 2e3ad0b380bd..a669ddec46dc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.native.js index d3121c543d3e..6c5f75617e75 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.js index f1de3fd430a9..c7c9180a3a03 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index 1466656f9e48..e21b617aed00 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index 37d214c09b7d..e3ccc420ba19 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index c2ac8bdba00e..0493b665d43b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index c920e7919872..a5df8dbba485 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index b0e891a01c06..45c4ff0fbf05 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.js index 1dd03f6c9137..4cf52826f84a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.native.js index a1ff34fa89f8..1397286155bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index e244de07dcba..13a2a2082349 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index 13ae119ee425..39edf11e094c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.js index 4ea66f556b9d..332676a5495d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.js @@ -105,6 +105,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.native.js index 892c672d7645..89efe513cc87 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -114,6 +114,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index cfc7369eea5b..74a32829d612 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -105,6 +105,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index 5d5ad72ad3ac..dd766c6aa33e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -114,6 +114,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.js index a8b0e5ebdb71..dc8b777770e3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.native.js index 0310c2295530..ac4f5facd3a4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.js index 1f7e4aa48ac3..faf57498f3bd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.native.js index d8bbe42dd34c..51a097ebd950 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.js index 6627cc0d7f78..0c4fb14d3e9e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.native.js index aaba7d782f7f..1194480f3dc6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.js index 2463dff753b1..ca5ccb3ff30f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index c586107efa56..55f373953574 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.js index 585837a1d23e..b6ba54021136 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.native.js index fa8c7be22c8c..9ac32ac5b51f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.js index ec81af4d5676..1892bcdeec70 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.native.js index 8c1b56f78275..2624ea079c7c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.sorted_random.ndarray.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.js index 5cc09b073d04..5fe8f5c68995 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.js @@ -98,6 +98,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.native.js index 930756cc0bb1..30af8bd3c453 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.native.js @@ -107,6 +107,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.js index 302e120dacf3..76118e44d215 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -98,6 +98,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index caf0c1221db9..1bdc55fba87f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -107,6 +107,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.js index 7d3d4a54ebc8..6f3af8c7ef4b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.native.js index 7e1681e7494f..b89dd01c7683 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.js index 1716435d4d3b..5c8d703fe20d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.native.js index a0dc14f43c65..48fdc755b014 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2ins/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.js index d554384c644f..4df2e8dc228a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.native.js index e9cfcde4f04b..63b4f37f6ce6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index b8f8026eb69b..ee21506656af 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index 8f6c545560f4..b9041295c7bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.js index e50c63818ecf..cf4b58547cca 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.native.js index e8ce9f8be156..0f2177f31fea 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.js index bf1a1e048fe2..5b9266e7331b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index d9880c16052c..3be7032b136f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index bf30d18fa4b4..5c001491cb8e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index 80fc62376f83..927a5d5dd4ef 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index 59b309ed64d6..2b642b250abc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index 9adc37a49bad..82f5c68e9fcb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -112,6 +112,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.js index 6821a6cd6d3b..a1b01b8db7a8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.native.js index 24434fea7094..b79d2e3fc020 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index db21c631ff08..5fa627bc7e06 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index feb70bfebb0c..8e928a72ef66 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.js index 6343429557b6..187fce1e911f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.native.js index fbdb1576a44b..a44c6982d913 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index dcddaa3a527e..37071e165010 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index f650c39106f1..4ad3ce5b45f2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.js index 22f04fb012e8..6e9c43794c10 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.native.js index 7b318f538653..c9c2c21f7ef5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.js index c0c79d4ab9d2..8f8ac35d5930 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.native.js index 4980ed1a2959..a4cbec90c6a9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.js index 19b562c2dfed..47f6663087c5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.native.js index a220871c6eab..81f9f2026c16 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.js index 5aad43f53c7f..c9b88a97080e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index e716c242c9cc..6172415a860b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -113,6 +113,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.js index c9f41e4c82b3..7278f683dc6a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.native.js index c85c4762b73e..fd767ff69d4c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.js index 81322c0d3d18..16138b29ec2c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.js @@ -93,6 +93,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.native.js index 8dc3b68e2edc..e5ab23b7b577 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.sorted_random.ndarray.native.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.js index 198115d6ca0a..43dd967c601b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.js @@ -97,6 +97,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.native.js index a3d3996240cc..efe3d61e65f7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.native.js @@ -106,6 +106,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.js index 311a86c74fd3..19ab154e257e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -97,6 +97,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index eace5b1c06b7..d47937b93d76 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -106,6 +106,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.js index 370002d7ee8b..3cefa1f81115 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.native.js index 563896b4420f..6962010e5790 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.js index d2ab708e16f0..9d9c2eb9c49a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.native.js index 71443db6c312..7f18ada2acda 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsort2sh/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.js index 3bca98703908..92a981b1290f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.native.js index 2b66ba8e5365..a28975260a2c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index fcca1c4f7e13..759e361b0813 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index bb9e46869d97..32b583fef1a8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.js index 169da6a52217..565a7a35f5eb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.native.js index 7ed51df64f5e..b4afb6673531 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.js index 083aeb1d277e..8b4b8278fff8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index 0c965e72c0bd..1b46214f3755 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index 5a148be78d47..cdac83429632 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index 7ca547868d39..1d6a79e4d9d5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index 15df766e77f3..3d85df25dad7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index 50eaca2741dd..459effd63c74 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.js index ac0cf5a72065..2305fa4cbb2f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.native.js index ee84ea3be748..c158cbd2a3a9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index e39f39f4ee37..eac3de517b32 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index b2f8230b4085..8c6ccc8ddd0e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.js index c85bdfca0f0b..4490c45bfba0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.native.js index 95c8daea2819..9cd4fae01864 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index 5499a1a0d91e..b732319cb662 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index 5021fcb52634..4554f5308825 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.js index 5f4077223ff0..bd7486b97fb2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.native.js index 4ca832b81983..8606f1e81276 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.js index 09fa9a180c76..b97edb800168 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.native.js index 569c60dd2ed9..7766d1e6c800 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.js index d170ecc87f0e..84c225320bc5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.native.js index b8d78c00b159..740fc73b0e18 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.js index f67c40366510..d86a0c1e91df 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index cabb25d5fbec..60c5ef73e58d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.js index fca61c6dca89..d00a5c605bcc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.native.js index 19a40e8723ad..301eca9a535d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.js index 4e547225782e..b05b1addbed5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.native.js index 00c3614d635a..eb0b5fd3146a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.sorted_random.ndarray.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.js index 57ba6b76989b..d67441d10270 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.native.js index aedb22203db4..4dccf4d6b6a2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.js index 2e6eabd3885d..b532c4895afd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index d82570a1d82c..b31c09a70354 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.js index a9b76e121537..7de79ceae505 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.native.js index 465d6650dc24..a606a5f9b573 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.js index 0c748de0c18b..086bc120162b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.native.js index 0f59246efe80..319922f5cdf2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/c/unsorted-random/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/c/unsorted-random/benchmark.length.c index a92dfd1db8a1..8c63e53c99a1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/c/unsorted-random/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsorthp/benchmark/c/unsorted-random/benchmark.length.c @@ -96,10 +96,11 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; } @@ -115,6 +116,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -127,10 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; } @@ -146,6 +149,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.js index 3fdd1cf0524c..9dbfe26d9ee3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.native.js index ca0e4e97cdb3..828dfc4e9919 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index 427c0ed6e626..3e26e6792aad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index 234c1ce7fe59..37496bcfd089 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.js index 8be609124a58..7a52c5e58151 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.native.js index c75a7f6f23df..690fd277ec7c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.js index d158b9e09b63..2241d3504228 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index 1f583341b1ce..1f9987ca8528 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index dbd1b9313659..1847b0616451 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index 0747aa37d975..f5d71578ffee 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index e102296dd7fc..4907349b36c2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index ece31f52a417..725743751177 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.js index 754df7832b26..95b8d3857b40 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.native.js index bdd020092b09..99bd49f5c82e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index 28a68166d23f..d2fba19c4a7e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index df9737ccf54a..fd13506167bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.js index 7ec6d7e01127..9dfff6f05267 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.native.js index 604d2cfa98a4..b33f1abd21de 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -111,6 +111,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index 922f74ef0f94..1cfa1d8c2ce1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -102,6 +102,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index f8cabe0deebc..ccb8e2c9e0d8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -111,6 +111,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.js index fa0223b224dc..ee83a4b8cedc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.native.js index 5454118bb049..f87d49ea1731 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.js index 51e5a4d4335d..9611b97089d3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.native.js index 7227daf3b807..1d4800e5fe07 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.js index 16f10eb0c585..0528baa48fa8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.native.js index d1c2a044e1e2..e8f1257e3a00 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.js index 7da05fa45672..c8011f2f26ca 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index 3c3a5a9370d8..e29fdb61d86d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.js index d0d63571a918..cfd5819b860c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.native.js index 0d913de53319..1011fc2836ee 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.js index 42a8549a580c..f48bc588f146 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.native.js index 442034138101..7ad451085d96 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.sorted_random.ndarray.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.js index 56c35765bc68..4a15d39f6575 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.native.js index 02ec152d348f..a1c4c81a91e4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.js index 50842a576de0..c0b44b70b042 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -95,6 +95,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index ae86ef0164b0..068d988b6434 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -104,6 +104,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.js index 83112b0e7fde..8f1663d41f58 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.native.js index 59acc8b7ac9e..9b478e16db08 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.js index d971955af957..4f12d9db278d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.js @@ -92,6 +92,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.native.js index 3f430631b106..abd29ea91d09 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/c/unsorted-random/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/c/unsorted-random/benchmark.length.c index 1ddcdd2c652b..e745bc0db139 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/c/unsorted-random/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortins/benchmark/c/unsorted-random/benchmark.length.c @@ -96,10 +96,11 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; } @@ -115,6 +116,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -127,10 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; } @@ -146,6 +149,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.js index 778ae58e10ec..45ee1ba98421 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.native.js index b5fc20a13a5c..c37246d15b8c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js index 3ff0182b2c4d..d5bd71bef7d3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js index 0f9bb7420a4c..8d1a98059a85 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_few_uniques.ndarray.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.js index a5cd9195b68e..c6e7b3c8fd61 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.native.js index 1530555bd2ed..c013a9c28ee7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.js index 61574ee8d36f..80bdd1af64df 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js index 5bee1850471b..ba9cca96c986 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.mostly_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js index ca380988a54a..3158d068f315 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js index 991d43fcde27..e9c318f6d909 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js index 8d67a78fd327..52ffe2c0e595 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js index 8150e0b269be..c473c1be422c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_few_uniques.ndarray.native.js @@ -109,6 +109,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.js index 7b63426fa9ce..1871a64bbd6b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.native.js index 0d7efb45b061..3f975c060789 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js index 37fc019336e2..98186f6475b1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js index 4ff6a52a624c..e3785d5f25f6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_mostly_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.js index 0b22882c27bf..48ed04129b2b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.native.js index 4aae9f05b2a1..26a83cfacbdf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js index d73e12ddf06f..58e1517b414c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js index 8121a7e62baf..62435b05cc34 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.js index c529eebef85c..944ac6485c2d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.native.js index c13bc66e275e..349caa490e84 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.js index 9b437e9a9911..6f2888812df1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.native.js index e62ed841710a..3d7c7836f4c7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.rev_sorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.js index 81ecafa70bba..1728ea561858 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.native.js index 7ace8e7f8518..2d130bfe69ed 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.js index f1fa19ff60d3..69403d592ccd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.js @@ -101,6 +101,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js index cfd0b209f3ad..56becff57fea 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_few_uniques.ndarray.native.js @@ -110,6 +110,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.js index 6f9953dddd06..0acd7fa5f651 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.native.js index c526a65fc8b8..35d8b117fcab 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.js index 7599598b1ec0..b1035fc69a50 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.js @@ -90,6 +90,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.native.js index 20a2d787f856..b2b4837cc823 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.sorted_random.ndarray.native.js @@ -99,6 +99,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var len; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.js index 87ba196933a5..77d667e3ce2a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.native.js index fa26f3c3615a..e54ab9093436 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.js index ce2135f29959..84dc0bb143e4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.js @@ -94,6 +94,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js index 74f7f6426208..bdc1138730bd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_few_uniques.ndarray.native.js @@ -103,6 +103,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.js index 372f4285a571..d316c8e86953 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.native.js index 029a0b7e7c68..7820416f87db 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.js index a44c0ebdacb1..91b1467983a5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.js @@ -91,6 +91,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.native.js index cdef5000e970..698b45582a4c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsortsh/benchmark/benchmark.unsorted_random.ndarray.native.js @@ -100,6 +100,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var bopts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.js index 7d19d5666b93..76cb7d7efff9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dssum = require( './../lib/dssum.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.native.js index 30213a159747..3513b446ca8b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.js index e490a35caab0..7af2dcd0f1a7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dssum = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.native.js index 66e94f83764f..d3c85a873a03 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/c/benchmark.length.c index ea4f89ade0b1..10f193db59e3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumors/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dssumors/benchmark/c/benchmark.length.c index de1444f3c1dd..92b71a4e4039 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumors/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumors/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c index dfbbe1e3abed..7e6d5ec455c7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +132,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double v; double t; int i; + x = (float *) malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.js index f47021bad637..dd848c574c15 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumkbn = require( './../lib/dsumkbn.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.native.js index 03315e6b800d..5606e13fe46b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.js index a576bc0e3941..8a92900e6fc2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumkbn = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.native.js index 0fc8adee5406..d7767945dcb5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.js index 9a9989288890..26c527d39cba 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumkbn2 = require( './../lib/dsumkbn2.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.native.js index 9bcbc98bcf8c..94b374b432e4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.js index 7fcb475a2710..0b9d664d9066 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumkbn2 = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.native.js index 29589abd4aa4..8cd827fb9fa9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/src/main.c index e8ecfad0b802..e0ca25184900 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/src/main.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/src/main.c @@ -39,7 +39,7 @@ */ double API_SUFFIX(stdlib_strided_dsumkbn2)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - return API_SUFFIX( stdlib_strided_dsumkbn2_ndarray )( N, X, strideX, ox ); + return API_SUFFIX(stdlib_strided_dsumkbn2_ndarray)( N, X, strideX, ox ); } /** diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.js index 844ac7698297..b98f46a9feea 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumors = require( './../lib/dsumors.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.native.js index 5b59457080c1..9ca8de623520 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:len='+len, opts, f ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.js index b567144b1fe7..d3ea2ef41c3e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dsumors = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.native.js index f221363a44c6..434fda969465 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dsumors/benchmark/benchmark.ndarray.native.js @@ -26,6 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -100,7 +101,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::native:ndarray:len='+len, opts, f ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/README.md new file mode 100644 index 000000000000..44cd8b14bd9f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/README.md @@ -0,0 +1,279 @@ + + +# dzeroTo + +> Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +
+ +## Usage + +```javascript +var dzeroTo = require( '@stdlib/blas/ext/base/dzero-to' ); +``` + +#### dzeroTo( N, x, strideX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +dzeroTo( x.length, x, 1 ); +// x => [ 0.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input [`Float64Array`][@stdlib/array/float64]. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +dzeroTo( 3, x, 2 ); +// x => [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array... +var x0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +// Create an offset view... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Fill every other element... +dzeroTo( 3, x1, 2 ); +// x0 => [ 0.0, 0.0, 0.0, 1.0, 0.0, 2.0 ] +``` + +#### dzeroTo.ndarray( N, x, strideX, offsetX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +dzeroTo.ndarray( x.length, x, 1, 0 ); +// x => [ 0.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +dzeroTo.ndarray( 3, x, 1, x.length-3 ); +// x => [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `x` unchanged. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dzeroTo = require( '@stdlib/blas/ext/base/dzero-to' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +dzeroTo( x.length, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/dzero_to.h" +``` + +#### stdlib_strided_dzero_to( N, \*X, strideX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + +```c +double x[] = { 0.0, 0.0, 0.0, 0.0 }; + +stdlib_strided_dzero_to( 4, x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. + +```c +void API_SUFFIX(stdlib_strided_dzero_to)( const CBLAS_INT N, double *X, const CBLAS_INT strideX ); +``` + +#### stdlib_strided_dzero_to_ndarray( N, \*X, strideX, offsetX ) + +Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + +```c +double x[] = { 0.0, 0.0, 0.0, 0.0 }; + +stdlib_strided_dzero_to_ndarray( 4, x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[out] double*` input array. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. + +```c +void API_SUFFIX(stdlib_strided_dzero_to_ndarray)( const CBLAS_INT N, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/dzero_to.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // Specify the number of indexed elements: + const int N = 8; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_dzero_to( N, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.js new file mode 100644 index 000000000000..3c572787b164 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dzeroTo = require( './../lib/dzero_to.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzeroTo( x.length, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.native.js new file mode 100644 index 000000000000..353d1329d3cb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.native.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dzeroTo = tryRequire( resolve( __dirname, './../lib/dzero_to.native.js' ) ); +var opts = { + 'skip': ( dzeroTo instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzeroTo( x.length, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..a17290bd2da0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dzeroTo = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzeroTo( x.length, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..8b70fb25c21a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dzeroTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dzeroTo instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzeroTo( x.length, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..d596ea90a86d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/benchmark/c/benchmark.length.c @@ -0,0 +1,191 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dzero_to.h" +#include +#include +#include +#include +#include + +#define NAME "dzero_to" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static double rand_double( void ) { + int r = rand(); + return (double)r / ( (double)RAND_MAX + 1.0 ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int len ) { + double elapsed; + double *x; + double t; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_dzero_to( len, x, 1 ); + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param len array length +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int len ) { + double elapsed; + double *x; + double t; + int i; + + x = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { + x[ i ] = ( rand_double()*200.0 ) - 100.0; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + stdlib_strided_dzero_to_ndarray( len, x, 1, 0 ); + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( x[ i%len ] != x[ i%len ] ) { + printf( "should not return NaN\n" ); + } + free( x ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int len; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + len = pow( 10, i ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:len=%d\n", NAME, len ); + elapsed = benchmark1( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:len=%d\n", NAME, len ); + elapsed = benchmark2( iter, len ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/repl.txt new file mode 100644 index 000000000000..4a95fcae6f1a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/repl.txt @@ -0,0 +1,92 @@ + +{{alias}}( N, x, strideX ) + Fills a double-precision floating-point strided array with linearly spaced + numeric elements which increment by `1` starting from zero. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( x.length, x, 1 ) + [ 0.0, 1.0, 2.0, 3.0 ] + + // Using `N` and stride parameters: + > x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}( 3, x, 2 ) + [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 3, x1, 2 ) + [ 0.0, 0.0, 1.0, 0.0, 2.0 ] + > x0 + [ 0.0, 0.0, 0.0, 1.0, 0.0, 2.0 ] + + +{{alias}}.ndarray( N, x, strideX, offsetX ) + Fills a double-precision floating-point strided array with linearly spaced + numeric elements which increment by `1` starting from zero using alternative + indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Float64Array + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: Float64Array + Input array. + + Examples + -------- + // Standard Usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( x.length, x, 1, 0 ) + [ 0.0, 1.0, 2.0, 3.0 ] + + // Using an index offset: + > x = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > {{alias}}.ndarray( 3, x, 2, 1 ) + [ 0.0, 0.0, 0.0, 1.0, 0.0, 2.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/index.d.ts new file mode 100644 index 000000000000..87621ff3556b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/index.d.ts @@ -0,0 +1,92 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Interface describing `dzeroTo`. +*/ +interface Routine { + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * dzeroTo( x.length, x, 1 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + */ + ( N: number, x: Float64Array, strideX: number ): Float64Array; + + /** + * Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns input array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * + * dzeroTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 0.0, 1.0, 2.0, 3.0 ] + */ + ndarray( N: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; +} + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param N - number of indexed elements +* @param x - input array +* @param strideX - stride length +* @returns input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo( x.length, x, 1 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +*/ +declare var dzeroTo: Routine; + + +// EXPORTS // + +export = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/test.ts new file mode 100644 index 000000000000..452113f41636 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/docs/types/test.ts @@ -0,0 +1,157 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 dzeroTo = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + dzeroTo( x.length, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dzeroTo( '10', x, 1 ); // $ExpectError + dzeroTo( true, x, 1 ); // $ExpectError + dzeroTo( false, x, 1 ); // $ExpectError + dzeroTo( null, x, 1 ); // $ExpectError + dzeroTo( undefined, x, 1 ); // $ExpectError + dzeroTo( [], x, 1 ); // $ExpectError + dzeroTo( {}, x, 1 ); // $ExpectError + dzeroTo( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + dzeroTo( x.length, 10, 1 ); // $ExpectError + dzeroTo( x.length, '10', 1 ); // $ExpectError + dzeroTo( x.length, true, 1 ); // $ExpectError + dzeroTo( x.length, false, 1 ); // $ExpectError + dzeroTo( x.length, null, 1 ); // $ExpectError + dzeroTo( x.length, undefined, 1 ); // $ExpectError + dzeroTo( x.length, [], 1 ); // $ExpectError + dzeroTo( x.length, {}, 1 ); // $ExpectError + dzeroTo( x.length, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dzeroTo( x.length, x, '10' ); // $ExpectError + dzeroTo( x.length, x, true ); // $ExpectError + dzeroTo( x.length, x, false ); // $ExpectError + dzeroTo( x.length, x, null ); // $ExpectError + dzeroTo( x.length, x, undefined ); // $ExpectError + dzeroTo( x.length, x, [] ); // $ExpectError + dzeroTo( x.length, x, {} ); // $ExpectError + dzeroTo( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + dzeroTo(); // $ExpectError + dzeroTo( x.length ); // $ExpectError + dzeroTo( x.length, x ); // $ExpectError + dzeroTo( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray( x.length, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray( '10', x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( true, x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( false, x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( null, x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( undefined, x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( [], x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( {}, x, 1, 0 ); // $ExpectError + dzeroTo.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Float64Array... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray( x.length, 10, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, '10', 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, true, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, false, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, null, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, [], 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, {}, 1, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray( x.length, x, '10', 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, true, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, false, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, null, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, undefined, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, [], 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, {}, 0 ); // $ExpectError + dzeroTo.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray( x.length, x, 1, '10' ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, true ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, false ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, null ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, undefined ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, [] ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, {} ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + dzeroTo.ndarray(); // $ExpectError + dzeroTo.ndarray( x.length ); // $ExpectError + dzeroTo.ndarray( x.length, x ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1 ); // $ExpectError + dzeroTo.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/example.c new file mode 100644 index 000000000000..e0f758db89ec --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/c/example.c @@ -0,0 +1,39 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dzero_to.h" +#include + +int main( void ) { + // Create a strided array: + double x[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // Specify the number of indexed elements: + const int N = 8; + + // Specify a stride: + const int strideX = 1; + + // Fill the array: + stdlib_strided_dzero_to( N, x, strideX ); + + // Print the result: + for ( int i = 0; i < 8; i++ ) { + printf( "x[ %i ] = %lf\n", i, x[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/index.js new file mode 100644 index 000000000000..d39b92555297 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 dzeroTo = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +dzeroTo( x.length, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' [ 0.0, 1.0, 2.0, 3.0 ] +*/ +function dzeroTo( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/dzero_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/dzero_to.native.js new file mode 100644 index 000000000000..f7fbc9229092 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/dzero_to.native.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo( x.length, x, 1 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +*/ +function dzeroTo( N, x, strideX ) { + addon( N, x, strideX ); + return x; +} + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/index.js new file mode 100644 index 000000000000..c2ee7168a075 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @module @stdlib/blas/ext/base/dzero-to +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dzeroTo = require( '@stdlib/blas/ext/base/dzero-to' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo( x.length, x, 1 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dzeroTo = require( '@stdlib/blas/ext/base/dzero-to' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dzeroTo; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dzeroTo = main; +} else { + dzeroTo = tmp; +} + + +// EXPORTS // + +module.exports = dzeroTo; + +// exports: { "ndarray": "dzeroTo.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/main.js new file mode 100644 index 000000000000..a537216057d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dzeroTo = require( './dzero_to.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dzeroTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/native.js new file mode 100644 index 000000000000..e3481dd4e33b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dzeroTo = require( './dzero_to.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dzeroTo, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.js new file mode 100644 index 000000000000..d0a0d4a2cf78 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.js @@ -0,0 +1,58 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo( x.length, x, 1, 0 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +*/ +function dzeroTo( N, x, strideX, offsetX ) { + var ix; + var i; + + if ( N <= 0 ) { + return x; + } + ix = offsetX; + for ( i = 0; i < N; i++ ) { + x[ ix ] = i; + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.native.js new file mode 100644 index 000000000000..8b206c0c90f0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/lib/ndarray.native.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Float64Array} input array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* dzeroTo( x.length, x, 1, 0 ); +* // x => [ 0.0, 1.0, 2.0, 3.0 ] +*/ +function dzeroTo( N, x, strideX, offsetX ) { + addon.ndarray( N, x, strideX, offsetX ); + return x; +} + + +// EXPORTS // + +module.exports = dzeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/manifest.json new file mode 100644 index 000000000000..fb41f9fb7ad5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/manifest.json @@ -0,0 +1,78 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/package.json new file mode 100644 index 000000000000..4adcb24778f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/package.json @@ -0,0 +1,79 @@ +{ + "name": "@stdlib/blas/ext/base/dzero-to", + "version": "0.0.0", + "description": "Fill a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "assign", + "set", + "zero-to", + "zeroto", + "sequence", + "seq", + "strided", + "array", + "ndarray", + "float64", + "double", + "float64array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/addon.c new file mode 100644 index 000000000000..454de548c54a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/addon.c @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dzero_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_dzero_to)( N, X, strideX ); + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); + API_SUFFIX(stdlib_strided_dzero_to_ndarray)( N, X, strideX, offsetX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/main.c new file mode 100644 index 000000000000..e9247b4f7384 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/src/main.c @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/ext/base/dzero_to.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/strided/base/stride2offset.h" + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +*/ +void API_SUFFIX(stdlib_strided_dzero_to)( const CBLAS_INT N, double *X, const CBLAS_INT strideX ) { + CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); + API_SUFFIX(stdlib_strided_dzero_to_ndarray)( N, X, strideX, ox ); +} + +/** +* Fills a double-precision floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero using alternative indexing semantics. +* +* @param N number of indexed elements +* @param X input array +* @param strideX stride length +* @param offsetX starting index +*/ +void API_SUFFIX(stdlib_strided_dzero_to_ndarray)( const CBLAS_INT N, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + CBLAS_INT ix; + CBLAS_INT i; + double v; + + if ( N <= 0 ) { + return; + } + ix = offsetX; + v = 0.0; + for ( i = 0; i < N; i++ ) { + X[ ix ] = v; + v += 1.0; + ix += strideX; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.js new file mode 100644 index 000000000000..428552fc4259 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.js @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 dzeroTo = require( './../lib/dzero_to.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( dzeroTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dzeroTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dzeroTo( 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dzeroTo( -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 0.0, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0 + ]); + + dzeroTo( x.length, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 0.0, // 0 + -3.0, + 1.0, // 1 + 7.0, + 2.0 // 2 + ]); + + dzeroTo( 3, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 2 + -3.0, + 1.0, // 1 + 7.0, + 0.0 // 0 + ]); + + dzeroTo( 3, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, + 0.0, // 0 + 3.0, + 1.0, // 1 + 5.0, + 2.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + dzeroTo( 3, x1, 2 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.native.js new file mode 100644 index 000000000000..fe46cc65425e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.dzero_to.native.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dzeroTo = tryRequire( resolve( __dirname, './../lib/dzero_to.native.js' ) ); +var opts = { + 'skip': ( dzeroTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', opts, function test( t ) { + t.strictEqual( dzeroTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dzeroTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dzeroTo( 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dzeroTo( -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 0.0, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0 + ]); + + dzeroTo( x.length, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 0.0, // 0 + -3.0, + 1.0, // 1 + 7.0, + 2.0 // 2 + ]); + + dzeroTo( 3, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 2 + -3.0, + 1.0, // 1 + 7.0, + 0.0 // 0 + ]); + + dzeroTo( 3, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', opts, function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, + 0.0, // 0 + 3.0, + 1.0, // 1 + 5.0, + 2.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + dzeroTo( 3, x1, 2 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.js new file mode 100644 index 000000000000..ceb7d22a141a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dzeroTo = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof dzeroTo.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var dzeroTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dzeroTo, mock, 'returns native implementation' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var dzeroTo; + var main; + + main = require( './../lib/dzero_to.js' ); + + dzeroTo = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dzeroTo, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.js new file mode 100644 index 000000000000..3a73f32dd703 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.js @@ -0,0 +1,171 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 dzeroTo = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( dzeroTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dzeroTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dzeroTo( 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dzeroTo( -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 0.0, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0 + ]); + + dzeroTo( x.length, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 0.0, // 0 + -3.0, + 1.0, // 1 + 7.0, + 2.0 // 2 + ]); + + dzeroTo( 3, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 2 + -3.0, + 1.0, // 1 + 7.0, + 0.0 // 0 + ]); + + dzeroTo( 3, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]); + expected = new Float64Array([ + 1.0, + 0.0, // 0 + 1.0, // 1 + 2.0, // 2 + 6.0, + 7.0 + ]); + + dzeroTo( 3, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.native.js new file mode 100644 index 000000000000..70737eb96b67 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dzero-to/test/test.ndarray.native.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var dzeroTo = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dzeroTo instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', opts, function test( t ) { + t.strictEqual( dzeroTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', opts, function test( t ) { + var out; + var x; + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = dzeroTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + expected = new Float64Array( [ 3.0, -4.0, 1.0 ] ); + + dzeroTo( 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + dzeroTo( -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]); + expected = new Float64Array([ + 0.0, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0 + ]); + + dzeroTo( x.length, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 0.0, // 0 + -3.0, + 1.0, // 1 + 7.0, + 2.0 // 2 + ]); + + dzeroTo( 3, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]); + expected = new Float64Array([ + 2.0, // 2 + -3.0, + 1.0, // 1 + 7.0, + 0.0 // 0 + ]); + + dzeroTo( 3, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', opts, function test( t ) { + var expected; + var x; + + x = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]); + expected = new Float64Array([ + 1.0, + 0.0, // 0 + 1.0, // 1 + 2.0, // 2 + 6.0, + 7.0 + ]); + + dzeroTo( 3, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.js index 8ec48aa57bd2..90ded8d7f0b6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.js @@ -77,6 +77,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.ndarray.js index 5122d1545755..7eea0dcaccb6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapx/benchmark/benchmark.ndarray.js @@ -77,6 +77,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.js index 3f757ecfed0c..e659e222a962 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gapxsumkbn = require( './../lib/main.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.ndarray.js index ee94a208d654..90eacbc3882f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gapxsumkbn = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.js index d204a2736d89..c539eed38c35 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gapxsumkbn2 = require( './../lib/main.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.ndarray.js index 041e83892e20..4dd0f87c4289 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gapxsumkbn2/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gapxsumkbn2 = require( './../lib/ndarray.js' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/README.md new file mode 100644 index 000000000000..4ef76aafc272 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/README.md @@ -0,0 +1,165 @@ + + +# gcircshift + +> Circularly shift the elements of a strided array by a specified number of positions. + +
+ +## Usage + +```javascript +var gcircshift = require( '@stdlib/blas/ext/base/gcircshift' ); +``` + +#### gcircshift( N, k, x, strideX ) + +Circularly shifts the elements of a strided array by a specified number of positions. + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + +gcircshift( x.length, 2, x, 1 ); +// x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **k**: number of positions to shift. +- **x**: input array. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to circularly shift every other element: + +```javascript +var x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]; + +gcircshift( 4, 1, x, 2 ); +// x => [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array... +var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +// Create an offset view... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Circularly shift elements in the view: +gcircshift( 5, 2, x1, 1 ); +// x0 => [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +#### gcircshift.ndarray( N, k, x, strideX, offsetX ) + +Circularly shifts the elements of a strided array by a specified number of positions using alternative indexing semantics. + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + +gcircshift.ndarray( x.length, 2, x, 1, 0 ); +// x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array: + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; + +gcircshift.ndarray( 3, 1, x, 1, x.length-3 ); +// x => [ 1.0, 2.0, 3.0, 6.0, 4.0, 5.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return the strided array unchanged. +- If `k` is a multiple of `N`, both functions return the strided array unchanged. +- If `k > 0`, elements are shifted to the right. +- If `k < 0`, elements are shifted to the left. +- Depending on the environment, the typed versions ([`dcircshift`][@stdlib/blas/ext/base/dcircshift], [`scircshift`][@stdlib/blas/ext/base/scircshift], etc.) are likely to be significantly more performant. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var gcircshift = require( '@stdlib/blas/ext/base/gcircshift' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +gcircshift( x.length, 3, x, 1 ); +console.log( x ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.js new file mode 100644 index 000000000000..c31e78e95464 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gcircshift = require( './../lib/main.js' ); + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100.0, 100.0, { + 'dtype': 'generic' + }); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = gcircshift( x.length, k, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..0c9fe4455bde --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/benchmark/benchmark.ndarray.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gcircshift = require( './../lib/ndarray.js' ); + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100.0, 100.0, { + 'dtype': 'generic' + }); + var k = floor( len / 2 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = gcircshift( x.length, k, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/repl.txt new file mode 100644 index 000000000000..85048059efce --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/repl.txt @@ -0,0 +1,101 @@ + +{{alias}}( N, k, x, strideX ) + Circularly shifts the elements of a strided array by a specified number of + positions. + + If `k > 0`, elements are shifted to the right. If `k < 0`, elements are + shifted to the left. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + k: integer + Number of positions to shift. + + x: ArrayLikeObject + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: ArrayLikeObject + Input array. + + Examples + -------- + // Standard Usage: + > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + > {{alias}}( x.length, 2, x, 1 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + + // Using `N` and stride parameters: + > x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]; + > {{alias}}( 4, 1, x, 2 ) + [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 5, 2, x1, 1 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + > x0 + [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ] + + +{{alias}}.ndarray( N, k, x, strideX, offsetX ) + Circularly shifts the elements of a strided array by a specified number of + positions using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a + starting index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + k: integer + Number of positions to shift. + + x: ArrayLikeObject + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: ArrayLikeObject + Input array. + + Examples + -------- + // Standard Usage: + > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + > {{alias}}.ndarray( x.length, 2, x, 1, 0 ) + [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + + // Using an index offset: + > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; + > {{alias}}.ndarray( 3, 1, x, 2, 1 ) + [ 1.0, 6.0, 3.0, 2.0, 5.0, 4.0 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/index.d.ts new file mode 100644 index 000000000000..14acdc0bcc5f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/index.d.ts @@ -0,0 +1,91 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Collection } from '@stdlib/types/array'; + +/** +* Interface describing `gcircshift`. +*/ +interface Routine { + /** + * Circularly shifts the elements of a strided array by a specified number of positions. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @returns `x` + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * + * gcircshift( x.length, 2, x, 1 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + = Collection>( N: number, k: number, x: U, strideX: number ): U; + + /** + * Circularly shifts the elements of a strided array by a specified number of positions using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param k - number of positions to shift + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns `x` + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * + * gcircshift.ndarray( x.length, 2, x, 1, 0 ); + * // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + ndarray = Collection>( N: number, k: number, x: U, strideX: number, offsetX: number ): U; +} + +/** +* Circularly shifts the elements of a strided array by a specified number of positions. +* +* @param N - number of indexed elements +* @param k - number of positions to shift +* @param x - input array +* @param strideX - stride length +* @returns `x` +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* +* gcircshift( x.length, 2, x, 1 ); +* // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* +* gcircshift.ndarray( x.length, 2, x, 1, 0 ); +* // x => [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +*/ +declare var gcircshift: Routine; + + +// EXPORTS // + +export = gcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/test.ts new file mode 100644 index 000000000000..0a32935fbca7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/docs/types/test.ts @@ -0,0 +1,185 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 gcircshift = require( './index' ); + + +// TESTS // + +// The function returns a collection... +{ + const x = new Float64Array( 10 ); + + gcircshift( x.length, 2, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift( '10', 2, x, 1 ); // $ExpectError + gcircshift( true, 2, x, 1 ); // $ExpectError + gcircshift( false, 2, x, 1 ); // $ExpectError + gcircshift( null, 2, x, 1 ); // $ExpectError + gcircshift( undefined, 2, x, 1 ); // $ExpectError + gcircshift( [], 2, x, 1 ); // $ExpectError + gcircshift( {}, 2, x, 1 ); // $ExpectError + gcircshift( ( x: number ): number => x, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift( x.length, '10', x, 1 ); // $ExpectError + gcircshift( x.length, true, x, 1 ); // $ExpectError + gcircshift( x.length, false, x, 1 ); // $ExpectError + gcircshift( x.length, null, x, 1 ); // $ExpectError + gcircshift( x.length, undefined, x, 1 ); // $ExpectError + gcircshift( x.length, [], x, 1 ); // $ExpectError + gcircshift( x.length, {}, x, 1 ); // $ExpectError + gcircshift( x.length, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a collection... +{ + const x = new Float64Array( 10 ); + + gcircshift( x.length, 2, '10', 1 ); // $ExpectError + gcircshift( x.length, 2, true, 1 ); // $ExpectError + gcircshift( x.length, 2, false, 1 ); // $ExpectError + gcircshift( x.length, 2, null, 1 ); // $ExpectError + gcircshift( x.length, 2, undefined, 1 ); // $ExpectError + gcircshift( x.length, 2, [], 1 ); // $ExpectError + gcircshift( x.length, 2, {}, 1 ); // $ExpectError + gcircshift( x.length, 2, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift( x.length, 2, x, '10' ); // $ExpectError + gcircshift( x.length, 2, x, true ); // $ExpectError + gcircshift( x.length, 2, x, false ); // $ExpectError + gcircshift( x.length, 2, x, null ); // $ExpectError + gcircshift( x.length, 2, x, undefined ); // $ExpectError + gcircshift( x.length, 2, x, [] ); // $ExpectError + gcircshift( x.length, 2, x, {} ); // $ExpectError + gcircshift( x.length, 2, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + gcircshift(); // $ExpectError + gcircshift( x.length ); // $ExpectError + gcircshift( x.length, 2 ); // $ExpectError + gcircshift( x.length, 2, x ); // $ExpectError + gcircshift( x.length, 2, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a collection... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( x.length, 2, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( '10', 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( true, 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( false, 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( null, 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( undefined, 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( [], 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( {}, 2, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( ( x: number ): number => x, 2, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( x.length, '10', x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, true, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, false, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, null, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, undefined, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, [], x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, {}, x, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a collection... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( x.length, 2, '10', 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, true, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, false, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, null, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, undefined, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, [], 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, {}, 1, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( x.length, 2, x, '10', 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, true, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, false, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, null, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, undefined, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, [], 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, {}, 0 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray( x.length, 2, x, 1, '10' ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, true ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, false ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, null ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, undefined ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, [] ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, {} ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + gcircshift.ndarray(); // $ExpectError + gcircshift.ndarray( x.length ); // $ExpectError + gcircshift.ndarray( x.length, 2 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1 ); // $ExpectError + gcircshift.ndarray( x.length, 2, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/examples/index.js new file mode 100644 index 000000000000..969acc6a80b7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 gcircshift = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +gcircshift( x.length, 3, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/accessors.js new file mode 100644 index 000000000000..ee58eb49825d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/accessors.js @@ -0,0 +1,168 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var floor = require( '@stdlib/math/base/special/floor' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a strided array by a specified number of positions. +* +* ## Notes +* +* - This implementation is based on the "trinity rotation" (a.k.a., conjoined triple reversal) algorithm introduced in , by Igor van den Hoven. +* +* @private +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Object} x - input array object +* @param {Collection} x.data - input array data +* @param {Array} x.accessors - array element accessors +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Object} input array object +*/ +function gcircshift( N, k, x, strideX, offsetX ) { + var right; + var left; + var xbuf; + var tmp; + var set; + var get; + var pa; + var pb; + var pc; + var pd; + var n; + var s; + var i; + + // Cache reference to array data: + xbuf = x.data; + + // Cache a reference to the element accessors: + get = x.accessors[ 0 ]; + set = x.accessors[ 1 ]; + + s = strideX; + + // For a right circular shift by `k`, the left partition has `N-k` elements... + left = N - k; + right = k; + if ( left < right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( left / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = get( xbuf, pb ); + set( xbuf, pb, get( xbuf, pa ) ); + set( xbuf, pa, get( xbuf, pc ) ); + set( xbuf, pc, get( xbuf, pd ) ); + set( xbuf, pd, tmp ); + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pd - pc ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = get( xbuf, pc ); + set( xbuf, pc, get( xbuf, pd ) ); + set( xbuf, pd, get( xbuf, pa ) ); + set( xbuf, pa, tmp ); + pa += s; + pc += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = get( xbuf, pa ); + set( xbuf, pa, get( xbuf, pd ) ); + set( xbuf, pd, tmp ); + pa += s; + } + } else if ( left > right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( right / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = get( xbuf, pb ); + set( xbuf, pb, get( xbuf, pa ) ); + set( xbuf, pa, get( xbuf, pc ) ); + set( xbuf, pc, get( xbuf, pd ) ); + set( xbuf, pd, tmp ); + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pb - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = get( xbuf, pb ); + set( xbuf, pb, get( xbuf, pa ) ); + set( xbuf, pa, get( xbuf, pd ) ); + set( xbuf, pd, tmp ); + pa += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = get( xbuf, pa ); + set( xbuf, pa, get( xbuf, pd ) ); + set( xbuf, pd, tmp ); + pa += s; + } + } else { + // Simple pairwise swap... + pa = offsetX; + pb = pa + ( left * s ); + for ( i = 0; i < left; i++ ) { + tmp = get( xbuf, pa ); + set( xbuf, pa, get( xbuf, pb ) ); + set( xbuf, pb, tmp ); + pa += s; + pb += s; + } + } + return x; +} + + +// EXPORTS // + +module.exports = gcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/index.js new file mode 100644 index 000000000000..657ac9e78871 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/index.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Circularly shift the elements of a strided array by a specified number of positions. +* +* @module @stdlib/blas/ext/base/gcircshift +* +* @example +* var gcircshift = require( '@stdlib/blas/ext/base/gcircshift' ); +* +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gcircshift( x.length, 2, x, 1 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var gcircshift = require( '@stdlib/blas/ext/base/gcircshift' ); +* +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gcircshift.ndarray( x.length, 2, x, 1, 0 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/main.js new file mode 100644 index 000000000000..30d496b4ce51 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/main.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a strided array by a specified number of positions. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @returns {Collection} input array +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gcircshift( x.length, 2, x, 1 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function gcircshift( N, k, x, strideX ) { + return ndarray( N, k, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = gcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/ndarray.js new file mode 100644 index 000000000000..c93409517cbb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/lib/ndarray.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var floor = require( '@stdlib/math/base/special/floor' ); +var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var accessors = require( './accessors.js' ); + + +// MAIN // + +/** +* Circularly shifts the elements of a strided array by a specified number of positions. +* +* ## Notes +* +* - This implementation is based on the "trinity rotation" (a.k.a., conjoined triple reversal) algorithm introduced in , by Igor van den Hoven. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {integer} k - number of positions to shift +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Collection} input array +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gcircshift( x.length, 2, x, 1, 0 ); +* // x => [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function gcircshift( N, k, x, strideX, offsetX ) { + var right; + var left; + var tmp; + var pa; + var pb; + var pc; + var pd; + var o; + var n; + var s; + var i; + + if ( N <= 0 ) { + return x; + } + // Normalize `k`: + k %= N; + if ( k < 0 ) { + k += N; + } + if ( k === 0 ) { + return x; + } + o = arraylike2object( x ); + if ( o.accessorProtocol ) { + accessors( N, k, o, strideX, offsetX ); + return o.data; + } + s = strideX; + + // For a right circular shift by `k`, the left partition has `N-k` elements... + left = N - k; + right = k; + if ( left < right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( left / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pd - pc ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = x[ pa ]; + x[ pa ] = tmp; + pa += s; + pc += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + } else if ( left > right ) { + pa = offsetX; + pb = pa + ( left * s ); + pc = pb; + pd = pb + ( right * s ); + + // Four-way swap from both ends and the split point... + n = floor( right / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pc ]; + x[ pc ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + pc += s; + } + // Three-way rotation for the remaining bridge... + n = floor( ( ( pb - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pb -= s; + pd -= s; + tmp = x[ pb ]; + x[ pb ] = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + // Standard reversal of any remaining elements... + n = floor( ( ( pd - pa ) / s ) / 2 ); + for ( i = 0; i < n; i++ ) { + pd -= s; + tmp = x[ pa ]; + x[ pa ] = x[ pd ]; + x[ pd ] = tmp; + pa += s; + } + } else { + // Simple pairwise swap... + pa = offsetX; + pb = pa + ( left * s ); + for ( i = 0; i < left; i++ ) { + tmp = x[ pa ]; + x[ pa ] = x[ pb ]; + x[ pb ] = tmp; + pa += s; + pb += s; + } + } + return x; +} + + +// EXPORTS // + +module.exports = gcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/package.json b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/package.json new file mode 100644 index 000000000000..510e16c9715d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/ext/base/gcircshift", + "version": "0.0.0", + "description": "Circularly shift the elements of a strided array by a specified number of positions.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "circular", + "shift", + "circshift", + "rotate", + "roll", + "strided", + "array", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.js new file mode 100644 index 000000000000..0e31dcb58012 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 gcircshift = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof gcircshift.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.main.js new file mode 100644 index 000000000000..28df9d3f0e77 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.main.js @@ -0,0 +1,312 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Float64Array = require( '@stdlib/array/float64' ); +var gcircshift = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( gcircshift.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + out = gcircshift( x.length, 2, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = [ 3.0, -4.0, 1.0 ]; + expected = [ 3.0, -4.0, 1.0 ]; + + gcircshift( 0, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( -4, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 5.0, 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k, accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]; + expected = [ 5.0, 6.0, 7.0, 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 3, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; + expected = [ 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; + + gcircshift( x.length, 3, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 3.0, 4.0, 5.0, 1.0, 2.0 ]; + + gcircshift( x.length, -2, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 2.0, 3.0, 4.0, 5.0, 1.0 ]; + + gcircshift( x.length, -1, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k, accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]; + expected = [ 4.0, 5.0, 6.0, 7.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, -3, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 3.0, 4.0, 1.0, 2.0 ]; + + gcircshift( x.length, -2, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 8, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 3.0, 4.0, 5.0, 1.0, 2.0 ]; + + gcircshift( x.length, -7, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 0, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 4, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 7, toAccessorArray( x ), 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = [ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]; + expected = [ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]; + + gcircshift( 4, 1, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; + expected = [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ]; + + gcircshift( 4, 1, toAccessorArray( x ), 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = [ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]; + expected = [ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]; + + gcircshift( 4, 1, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; + expected = [ 2.0, 0.0, 3.0, 0.0, 4.0, 0.0, 1.0 ]; + + gcircshift( 4, 1, toAccessorArray( x ), -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]); + expected = new Float64Array([ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + gcircshift( 5, 2, x1, 1 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.ndarray.js new file mode 100644 index 000000000000..651f3013ae57 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gcircshift/test/test.ndarray.js @@ -0,0 +1,333 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gcircshift = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 5', function test( t ) { + t.strictEqual( gcircshift.length, 5, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 5.0, 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (right shift, positive k, accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]; + expected = [ 5.0, 6.0, 7.0, 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 3, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; + expected = [ 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]; + + gcircshift( x.length, 3, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 3.0, 4.0, 5.0, 1.0, 2.0 ]; + + gcircshift( x.length, -2, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 2.0, 3.0, 4.0, 5.0, 1.0 ]; + + gcircshift( x.length, -1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a circular shift (left shift, negative k, accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]; + expected = [ 4.0, 5.0, 6.0, 7.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, -3, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 3.0, 4.0, 1.0, 2.0 ]; + + gcircshift( x.length, -2, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 8, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 3.0, 4.0, 5.0, 1.0, 2.0 ]; + + gcircshift( x.length, -7, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an arbitrary number of positions to shift (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0 ]; + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + gcircshift( x.length, 0, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( x.length, 4, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + expected = [ 4.0, 5.0, 1.0, 2.0, 3.0 ]; + + gcircshift( x.length, 7, toAccessorArray( x ), 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + out = gcircshift( x.length, 2, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = [ 3.0, -4.0, 1.0 ]; + expected = [ 3.0, -4.0, 1.0 ]; + + gcircshift( 0, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + gcircshift( -4, 1, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = [ + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]; + expected = [ + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]; + + gcircshift( 4, 1, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; + expected = [ 4.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ]; + + gcircshift( 4, 1, toAccessorArray( x ), 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = [ + 1.0, // 3 + 0.0, + 2.0, // 2 + 0.0, + 3.0, // 1 + 0.0, + 4.0 // 0 + ]; + expected = [ + 2.0, // 3 + 0.0, + 3.0, // 2 + 0.0, + 4.0, // 1 + 0.0, + 1.0 // 0 + ]; + + gcircshift( 4, 1, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride (accessors)', function test( t ) { + var expected; + var x; + + x = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0 ]; + expected = [ 2.0, 0.0, 3.0, 0.0, 4.0, 0.0, 1.0 ]; + + gcircshift( 4, 1, toAccessorArray( x ), -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset', function test( t ) { + var expected; + var x; + + x = [ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0, // 3 + 5.0 // 4 + ]; + expected = [ + 0.0, + 4.0, // 0 + 5.0, // 1 + 1.0, // 2 + 2.0, // 3 + 3.0 // 4 + ]; + + gcircshift( 5, 2, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + x = [ + 0.0, + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0, // 2 + 0.0, + 4.0 // 3 + ]; + expected = [ + 0.0, + 4.0, // 0 + 0.0, + 1.0, // 1 + 0.0, + 2.0, // 2 + 0.0, + 3.0 // 3 + ]; + + gcircshift( 4, 1, x, 2, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/README.md b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/README.md new file mode 100644 index 000000000000..2a25b1f92b92 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/README.md @@ -0,0 +1,188 @@ + + +# gconjoin + +> Return a string created by joining strided array elements into a human-readable list using a conjunction. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var gconjoin = require( '@stdlib/blas/ext/base/gconjoin' ); +``` + +#### gconjoin( N, prefix, suffix, conjunction, oxfordComma, x, strideX ) + +Returns a string created by joining strided array elements into a human-readable list using a conjunction. + +```javascript +var x = [ 1, 2, 3, 4 ]; + +var str = gconjoin( x.length, '', '', 'and', true, x, 1 ); +// returns '1, 2, 3, and 4' +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **prefix**: string to prepend. +- **suffix**: string to append. +- **conjunction**: conjunction before the last element. +- **oxfordComma**: boolean specifying whether to include an Oxford comma. +- **x**: input array. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to join every other element: + +```javascript +var x = [ 1, 2, 3, 4, 5, 6 ]; + +var str = gconjoin( 3, '', '', 'and', true, x, 2 ); +// returns '1, 3, and 5' +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array: +var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + +// Create an offset view: +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Join elements: +var str = gconjoin( 3, '', '', 'and', true, x1, 2 ); +// returns '2, 4, and 6' +``` + + + +#### gconjoin.ndarray( N, prefix, suffix, conjunction, oxfordComma, x, strideX, offsetX ) + + + +Returns a string created by joining strided array elements into a human-readable list using a conjunction and alternative indexing semantics. + +```javascript +var x = [ 1, 2, 3, 4 ]; + +var str = gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); +// returns '1, 2, 3, and 4' +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array: + +```javascript +var x = [ 1, 2, 3, 4, 5, 6 ]; + +var str = gconjoin.ndarray( 3, '', '', 'and', true, x, 1, x.length-3 ); +// returns '4, 5, and 6' +``` + +
+ + + + + +
+ +## Notes + +- If `N <= 0`, both functions return the prefix followed by the suffix. +- If `N < 2`, the `conjunction` parameter is ignored. +- If `N < 3`, the `oxfordComma` parameter has no effect. +- If an array element is either `null` or `undefined`, both functions will serialize the element as an empty string. +- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). + +
+ + + + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var gconjoin = require( '@stdlib/blas/ext/base/gconjoin' ); + +var x = discreteUniform( 5, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +var out = gconjoin( x.length, '', '', 'and', true, x, 1 ); +console.log( out ); +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.js new file mode 100644 index 000000000000..ca81577fd584 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gconjoin = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = oneTo( len, 'float64' ); + 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 = gconjoin( x.length, '', '', 'and', true, x, 1 ); + if ( out !== out ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..1e102bd2189f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/benchmark/benchmark.ndarray.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gconjoin = require( './../lib/ndarray.js' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = oneTo( len, 'float64' ); + 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 = gconjoin( x.length, '', '', 'and', true, x, 1, 0 ); + if ( out !== out ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/repl.txt new file mode 100644 index 000000000000..d33ecd255aab --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/repl.txt @@ -0,0 +1,95 @@ + +{{alias}}( N, prefix, suffix, conjunction, oxfordComma, x, strideX ) + Returns a string created by joining strided array elements into a human- + readable list using a conjunction. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use a typed + array view. + + If `N <= 0`, the function returns the prefix followed by the suffix. + + Parameters + ---------- + N: integer + Number of indexed elements. + + prefix: string + String to prepend. + + suffix: string + String to append. + + conjunction: string + Conjunction before the last element. + + oxfordComma: boolean + Boolean specifying whether to include an Oxford comma. + + x: Array|TypedArray + Input array. + + strideX: integer + Stride length. + + Returns + ------- + str: string + Joined string. + + Examples + -------- + > var x = [ 1, 2, 3, 4 ]; + > var str = {{alias}}( x.length, '', '', 'and', true, x, 1 ) + '1, 2, 3, and 4' + + +{{alias}}.ndarray( N, prefix, suffix, conjunction, oxfordComma, x, sx, ox ) + Returns a string created by joining strided array elements into a human- + readable list using a conjunction and alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + prefix: string + String to prepend. + + suffix: string + String to append. + + conjunction: string + Conjunction before the last element. + + oxfordComma: boolean + Boolean specifying whether to include an Oxford comma. + + x: Array|TypedArray + Input array. + + sx: integer + Stride length. + + ox: integer + Starting index. + + Returns + ------- + str: string + Joined string. + + Examples + -------- + > var x = [ 1, 2, 3, 4 ]; + > var str = {{alias}}.ndarray( x.length, '', '', 'and', true, x, 1, 0 ) + '1, 2, 3, and 4' + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/index.d.ts new file mode 100644 index 000000000000..7d190e27b2d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/index.d.ts @@ -0,0 +1,105 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Collection, AccessorArrayLike } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = Collection | AccessorArrayLike; + +/** +* Interface describing `gconjoin`. +*/ +interface Routine { + /** + * Returns a string created by joining strided array elements into a human-readable list using a conjunction. + * + * @param N - number of indexed elements + * @param prefix - string to prepend + * @param suffix - string to append + * @param conjunction - conjunction before the last element + * @param oxfordComma - boolean specifying whether to include an Oxford comma + * @param x - input array + * @param strideX - stride length + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var str = gconjoin( x.length, '', '', 'and', true, x, 1 ); + * // returns '1, 2, 3, and 4' + */ + ( N: number, prefix: string, suffix: string, conjunction: string, oxfordComma: boolean, x: InputArray, strideX: number ): string; + + /** + * Returns a string created by joining strided array elements into a human-readable list using a conjunction and alternative indexing semantics. + * + * @param N - number of indexed elements + * @param prefix - string to prepend + * @param suffix - string to append + * @param conjunction - conjunction before the last element + * @param oxfordComma - boolean specifying whether to include an Oxford comma + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var str = gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); + * // returns '1, 2, 3, and 4' + */ + ndarray( N: number, prefix: string, suffix: string, conjunction: string, oxfordComma: boolean, x: InputArray, strideX: number, offsetX: number ): string; +} + +/** +* Returns a string created by joining strided array elements into a human-readable list using a conjunction. +* +* @param N - number of indexed elements +* @param prefix - string to prepend +* @param suffix - string to append +* @param conjunction - conjunction before the last element +* @param oxfordComma - boolean specifying whether to include an Oxford comma +* @param x - input array +* @param strideX - stride length +* @returns joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var str = gconjoin( x.length, '', '', 'and', true, x, 1 ); +* // returns '1, 2, 3, and 4' +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var str = gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); +* // returns '1, 2, 3, and 4' +*/ +declare var gconjoin: Routine; + + +// EXPORTS // + +export = gconjoin; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/test.ts new file mode 100644 index 000000000000..dd4580321281 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/docs/types/test.ts @@ -0,0 +1,263 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 gconjoin = require( './index' ); + + +// TESTS // + +// The function returns a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, '', '', 'and', true, x, 1 ); // $ExpectType string +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( '5', '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( true, '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( false, '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( null, '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( undefined, '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( [], '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( {}, '', '', 'and', true, x, 1 ); // $ExpectError + gconjoin( ( x: number ): number => x, '', '', 'and', true, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, 5, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, true, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, false, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, null, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, undefined, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, [], '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, {}, '', 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, ( x: number ): number => x, '', 'and', true, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, '', 5, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', true, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', false, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', null, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', undefined, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', [], 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', {}, 'and', true, x, 1 ); // $ExpectError + gconjoin( x.length, '', ( x: number ): number => x, 'and', true, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, '', '', 5, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', true, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', false, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', null, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', undefined, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', [], true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', {}, true, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', ( x: number ): number => x, true, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a boolean... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, '', '', 'and', '5', x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', 5, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', null, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', undefined, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', [], x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', {}, x, 1 ); // $ExpectError + gconjoin( x.length, '', '', 'and', ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not an array-like object... +{ + gconjoin( 4, '', '', 'and', true, 5, 1 ); // $ExpectError + gconjoin( 4, '', '', 'and', true, true, 1 ); // $ExpectError + gconjoin( 4, '', '', 'and', true, false, 1 ); // $ExpectError + gconjoin( 4, '', '', 'and', true, null, 1 ); // $ExpectError + gconjoin( 4, '', '', 'and', true, undefined, 1 ); // $ExpectError + gconjoin( 4, '', '', 'and', true, {}, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin( x.length, '', '', 'and', true, x, '5' ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, true ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, false ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, null ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, undefined ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, [] ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, {} ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin(); // $ExpectError + gconjoin( x.length ); // $ExpectError + gconjoin( x.length, '' ); // $ExpectError + gconjoin( x.length, '', '' ); // $ExpectError + gconjoin( x.length, '', '', 'and' ); // $ExpectError + gconjoin( x.length, '', '', 'and', true ); // $ExpectError + gconjoin( x.length, '', '', 'and', true, x ); // $ExpectError +} + +// Attached to the main export is an `ndarray` method which returns a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); // $ExpectType string +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( '5', '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( true, '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( false, '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( null, '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( undefined, '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( [], '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( {}, '', '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( ( x: number ): number => x, '', '', 'and', true, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, 5, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, true, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, false, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, null, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, undefined, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, [], '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, {}, '', 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, ( x: number ): number => x, '', 'and', true, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', 5, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', true, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', false, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', null, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', undefined, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', [], 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', {}, 'and', true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', ( x: number ): number => x, 'and', true, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', '', 5, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', true, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', false, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', null, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', undefined, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', [], true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', {}, true, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', ( x: number ): number => x, true, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a boolean... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', '', 'and', '5', x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', 5, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', null, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', undefined, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', [], x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', {}, x, 1, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not an array-like object... +{ + gconjoin.ndarray( 4, '', '', 'and', true, 5, 1, 0 ); // $ExpectError + gconjoin.ndarray( 4, '', '', 'and', true, true, 1, 0 ); // $ExpectError + gconjoin.ndarray( 4, '', '', 'and', true, false, 1, 0 ); // $ExpectError + gconjoin.ndarray( 4, '', '', 'and', true, null, 1, 0 ); // $ExpectError + gconjoin.ndarray( 4, '', '', 'and', true, undefined, 1, 0 ); // $ExpectError + gconjoin.ndarray( 4, '', '', 'and', true, {}, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', '', 'and', true, x, '5', 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, true, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, false, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, null, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, undefined, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, [], 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, {}, 0 ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, '5' ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, true ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, false ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, null ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, undefined ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, [] ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, {} ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided insufficient arguments... +{ + const x = [ 1, 2, 3, 4 ]; + + gconjoin.ndarray(); // $ExpectError + gconjoin.ndarray( x.length ); // $ExpectError + gconjoin.ndarray( x.length, '' ); // $ExpectError + gconjoin.ndarray( x.length, '', '' ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and' ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x ); // $ExpectError + gconjoin.ndarray( x.length, '', '', 'and', true, x, 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/examples/index.js new file mode 100644 index 000000000000..11ea4aecdba6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 gconjoin = require( './../lib' ); + +var x = discreteUniform( 5, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +var out = gconjoin( x.length, '', '', 'and', true, x, 1 ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/index.js new file mode 100644 index 000000000000..ed3d198c9d5f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/index.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return a string created by joining strided array elements into a human-readable list using a conjunction. +* +* @module @stdlib/blas/ext/base/gconjoin +* +* @example +* var gconjoin = require( '@stdlib/blas/ext/base/gconjoin' ); +* +* var x = [ 1, 2, 3, 4 ]; +* +* var str = gconjoin( x.length, '', '', 'and', true, x, 1 ); +* // returns '1, 2, 3, and 4' +* +* @example +* var gconjoin = require( '@stdlib/blas/ext/base/gconjoin' ); +* +* var x = [ 1, 2, 3, 4 ]; +* +* var str = gconjoin.ndarray( x.length, '', '', 'and', true, x, 1, 0 ); +* // returns '1, 2, 3, and 4' +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/main.js new file mode 100644 index 000000000000..2b0a2e1f13f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/main.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Returns a string created by joining strided array elements into a human-readable list using a conjunction. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {string} prefix - string to prepend +* @param {string} suffix - string to append +* @param {string} conjunction - conjunction before the last element +* @param {boolean} oxfordComma - boolean specifying whether to include an Oxford comma +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @returns {string} joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var out = gconjoin( x.length, '', '', 'and', true, x, 1 ); +* // returns '1, 2, 3, and 4' +*/ +function gconjoin( N, prefix, suffix, conjunction, oxfordComma, x, strideX ) { + return ndarray( N, prefix, suffix, conjunction, oxfordComma, x, strideX, stride2offset( N, strideX ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = gconjoin; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/ndarray.js new file mode 100644 index 000000000000..97b8977c4e0e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/lib/ndarray.js @@ -0,0 +1,98 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); +var resolveGetter = require( '@stdlib/array/base/resolve-getter' ); +var gjoin = require( '@stdlib/blas/ext/base/gjoin' ).ndarray; + + +// VARIABLES // + +var SEP = ', '; +var SPACE = ' '; + + +// FUNCTIONS // + +/** +* Returns the string representation of an array element. +* +* @private +* @param {Function} get - accessor function +* @param {Collection} x - input array +* @param {integer} idx - element index +* @returns {string} string representation +*/ +function str( get, x, idx ) { + var v = get( x, idx ); + if ( isUndefinedOrNull( v ) ) { + return ''; + } + return String( v ); +} + + +// MAIN // + +/** +* Returns a string created by joining strided array elements into a human-readable list using a conjunction and alternative indexing semantics. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {string} prefix - string to prepend +* @param {string} suffix - string to append +* @param {string} conjunction - conjunction before the last element +* @param {boolean} oxfordComma - boolean specifying whether to include an Oxford comma +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {string} joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var out = gconjoin( x.length, '', '', 'and', true, x, 1, 0 ); +* // returns '1, 2, 3, and 4' +*/ +function gconjoin( N, prefix, suffix, conjunction, oxfordComma, x, strideX, offsetX ) { // eslint-disable-line max-len + var last; + var out; + var get; + + if ( N <= 0 ) { + return prefix + suffix; + } + if ( conjunction === '' || N === 1 ) { + return prefix + gjoin( N, SEP, x, strideX, offsetX ) + suffix; + } + get = resolveGetter( x ); + out = prefix + gjoin( N-1, SEP, x, strideX, offsetX ); + last = str( get, x, offsetX + ( (N-1) * strideX ) ); + if ( N >= 3 && oxfordComma ) { + return out + SEP + conjunction + SPACE + last + suffix; + } + return out + SPACE + conjunction + SPACE + last + suffix; +} + + +// EXPORTS // + +module.exports = gconjoin; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/package.json b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/package.json new file mode 100644 index 000000000000..8f3d29ba829a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/blas/ext/base/gconjoin", + "version": "0.0.0", + "description": "Return a string created by joining strided array elements into a human-readable list using a conjunction.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "join", + "conjoin", + "conjunction", + "oxford", + "comma", + "string", + "strided", + "array", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.js new file mode 100644 index 000000000000..3660cc70ea2c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 gconjoin = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gconjoin, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof gconjoin.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.main.js new file mode 100644 index 000000000000..0ca26ebed025 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.main.js @@ -0,0 +1,180 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 Complex128Array = require( '@stdlib/array/complex128' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gconjoin = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gconjoin, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 7', function test( t ) { + t.strictEqual( gconjoin.length, 7, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction', function test( t ) { + var actual; + var x; + + x = [ 1, 2, 3, 4 ]; + + // Three or more elements with Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1, 2, 3, and 4', 'returns expected value' ); + + // Three or more elements without Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', false, x, 1 ); + t.strictEqual( actual, 'result: 1, 2, 3 and 4', 'returns expected value' ); + + // Two elements... + actual = gconjoin( 2, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1 and 2', 'returns expected value' ); + + // Single element... + actual = gconjoin( 1, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1', 'returns expected value' ); + + // Empty conjunction... + actual = gconjoin( x.length, '[ ', ' ]', '', true, x, 1 ); + t.strictEqual( actual, '[ 1, 2, 3, 4 ]', 'returns expected value' ); + + // Prefix and suffix... + actual = gconjoin( 3, '(', ')', 'or', false, [ 1, 2, 3 ], 1 ); + t.strictEqual( actual, '(1, 2 or 3)', 'returns expected value' ); + + // Nonnegative stride... + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], 2 ); + t.strictEqual( actual, '1, 3, and 5', 'returns expected value' ); + + // Negative stride... + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], -2 ); + t.strictEqual( actual, '5, 3, and 1', 'returns expected value' ); + + // Null and undefined values... + x = [ 1, null, 3, undefined, 5 ]; + actual = gconjoin( x.length, '', '', 'and', true, x, 1 ); + t.strictEqual( actual, '1, , 3, , and 5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction (accessors)', function test( t ) { + var actual; + var x; + + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + + // Three or more elements with Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1, 2, 3, and 4', 'returns expected value' ); + + // Three or more elements without Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', false, x, 1 ); + t.strictEqual( actual, 'result: 1, 2, 3 and 4', 'returns expected value' ); + + // Two elements... + actual = gconjoin( 2, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1 and 2', 'returns expected value' ); + + // Single element... + actual = gconjoin( 1, 'result: ', '', 'and', true, x, 1 ); + t.strictEqual( actual, 'result: 1', 'returns expected value' ); + + // Empty conjunction... + actual = gconjoin( x.length, '[ ', ' ]', '', true, x, 1 ); + t.strictEqual( actual, '[ 1, 2, 3, 4 ]', 'returns expected value' ); + + // Nonnegative stride... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + actual = gconjoin( 3, '', '', 'and', true, x, 2 ); + t.strictEqual( actual, '1, 3, and 5', 'returns expected value' ); + + // Negative stride... + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + actual = gconjoin( x.length, '', '', 'and', true, x, -1 ); + t.strictEqual( actual, '4, 3, 2, and 1', 'returns expected value' ); + + // Null and undefined values... + x = toAccessorArray( [ 1, null, 3, undefined, 5 ] ); + actual = gconjoin( x.length, '', '', 'and', true, x, 1 ); + t.strictEqual( actual, '1, , 3, , and 5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction (complex128)', function test( t ) { + var actual; + var x; + + x = new Complex128Array( [ 1, 2, 3, 4, 5, 6 ] ); + + // Unit stride... + actual = gconjoin( x.length, '', '', 'and', true, x, 1 ); + t.strictEqual( actual, '1 + 2i, 3 + 4i, and 5 + 6i', 'returns expected value' ); + + // Non-unit stride... + actual = gconjoin( 2, '', '', 'and', true, x, 2 ); + t.strictEqual( actual, '1 + 2i and 5 + 6i', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the prefix followed by the suffix if provided an `N` parameter less than or equal to zero', function test( t ) { + var actual; + + actual = gconjoin( 0, '', '', 'and', true, [ 1, 2, 3 ], 1 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( -1, '', '', 'and', true, [ 1, 2, 3 ], 1 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( 0, '[', ']', 'and', true, [ 1, 2, 3 ], 1 ); + t.strictEqual( actual, '[]', 'returns expected value' ); + + actual = gconjoin( -1, '[ ', ' ]', 'and', true, [ 1, 2, 3 ], 1 ); + t.strictEqual( actual, '[ ]', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the prefix followed by the suffix if provided an `N` parameter less than or equal to zero (accessors)', function test( t ) { + var actual; + + actual = gconjoin( 0, '', '', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( -1, '', '', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( 0, '[', ']', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1 ); + t.strictEqual( actual, '[]', 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.ndarray.js new file mode 100644 index 000000000000..f89b035a6647 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gconjoin/test/test.ndarray.js @@ -0,0 +1,186 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 Complex128Array = require( '@stdlib/array/complex128' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gconjoin = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gconjoin, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', function test( t ) { + t.strictEqual( gconjoin.length, 8, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction', function test( t ) { + var actual; + var x; + + x = [ 1, 2, 3, 4 ]; + + // Three or more elements with Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1, 2, 3, and 4', 'returns expected value' ); + + // Three or more elements without Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', false, x, 1, 0 ); + t.strictEqual( actual, 'result: 1, 2, 3 and 4', 'returns expected value' ); + + // Two elements... + actual = gconjoin( 2, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1 and 2', 'returns expected value' ); + + // Single element... + actual = gconjoin( 1, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1', 'returns expected value' ); + + // Empty conjunction... + actual = gconjoin( x.length, '[ ', ' ]', '', true, x, 1, 0 ); + t.strictEqual( actual, '[ 1, 2, 3, 4 ]', 'returns expected value' ); + + // Prefix and suffix... + actual = gconjoin( 3, '(', ')', 'or', false, [ 1, 2, 3 ], 1, 0 ); + t.strictEqual( actual, '(1, 2 or 3)', 'returns expected value' ); + + // Nonnegative stride with offset... + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], 2, 0 ); + t.strictEqual( actual, '1, 3, and 5', 'returns expected value' ); + + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], 1, 1 ); + t.strictEqual( actual, '2, 3, and 4', 'returns expected value' ); + + // Negative stride... + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], -2, 5 ); + t.strictEqual( actual, '6, 4, and 2', 'returns expected value' ); + + actual = gconjoin( 3, '', '', 'and', true, [ 1, 2, 3, 4, 5, 6 ], -1, 5 ); + t.strictEqual( actual, '6, 5, and 4', 'returns expected value' ); + + // Null and undefined values... + x = [ 1, null, 3, undefined, 5 ]; + actual = gconjoin( x.length, '', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, '1, , 3, , and 5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction (accessors)', function test( t ) { + var actual; + var x; + + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + + // Three or more elements with Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1, 2, 3, and 4', 'returns expected value' ); + + // Three or more elements without Oxford comma... + actual = gconjoin( x.length, 'result: ', '', 'and', false, x, 1, 0 ); + t.strictEqual( actual, 'result: 1, 2, 3 and 4', 'returns expected value' ); + + // Two elements... + actual = gconjoin( 2, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1 and 2', 'returns expected value' ); + + // Single element... + actual = gconjoin( 1, 'result: ', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, 'result: 1', 'returns expected value' ); + + // Empty conjunction... + actual = gconjoin( x.length, '[ ', ' ]', '', true, x, 1, 0 ); + t.strictEqual( actual, '[ 1, 2, 3, 4 ]', 'returns expected value' ); + + // Nonnegative stride... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + actual = gconjoin( 3, '', '', 'and', true, x, 2, 0 ); + t.strictEqual( actual, '1, 3, and 5', 'returns expected value' ); + + // Negative stride... + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + actual = gconjoin( x.length, '', '', 'and', true, x, -1, 3 ); + t.strictEqual( actual, '4, 3, 2, and 1', 'returns expected value' ); + + // Null and undefined values... + x = toAccessorArray( [ 1, null, 3, undefined, 5 ] ); + actual = gconjoin( x.length, '', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, '1, , 3, , and 5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements into a human-readable list using a conjunction (complex128)', function test( t ) { + var actual; + var x; + + x = new Complex128Array( [ 1, 2, 3, 4, 5, 6 ] ); + + // Unit stride... + actual = gconjoin( x.length, '', '', 'and', true, x, 1, 0 ); + t.strictEqual( actual, '1 + 2i, 3 + 4i, and 5 + 6i', 'returns expected value' ); + + // Non-unit stride... + actual = gconjoin( 2, '', '', 'and', true, x, 2, 0 ); + t.strictEqual( actual, '1 + 2i and 5 + 6i', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the prefix followed by the suffix if provided an `N` parameter less than or equal to zero', function test( t ) { + var actual; + + actual = gconjoin( 0, '', '', 'and', true, [ 1, 2, 3 ], 1, 0 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( -1, '', '', 'and', true, [ 1, 2, 3 ], 1, 0 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( 0, '[', ']', 'and', true, [ 1, 2, 3 ], 1, 0 ); + t.strictEqual( actual, '[]', 'returns expected value' ); + + actual = gconjoin( -1, '[ ', ' ]', 'and', true, [ 1, 2, 3 ], 1, 0 ); + t.strictEqual( actual, '[ ]', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the prefix followed by the suffix if provided an `N` parameter less than or equal to zero (accessors)', function test( t ) { + var actual; + + actual = gconjoin( 0, '', '', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1, 0 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( -1, '', '', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1, 0 ); + t.strictEqual( actual, '', 'returns expected value' ); + + actual = gconjoin( 0, '[', ']', 'and', true, toAccessorArray( [ 1, 2, 3 ] ), 1, 0 ); + t.strictEqual( actual, '[]', 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.js index 97bc76199db8..b8ac5ca22ba2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gcusum = require( './../lib/main.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.ndarray.js index ee5687b4e13f..82f0685b0965 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusum/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ); var zeros = require( '@stdlib/array/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gcusum = require( './../lib/ndarray.js' ); @@ -101,7 +102,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.js index af4259fb69e6..c2df62c4fd8c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.js @@ -74,6 +74,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.ndarray.js index b4f9ddfc5a58..5f2bb44e4063 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill-by/benchmark/benchmark.ndarray.js @@ -74,6 +74,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.js index ab677d11bb3d..07991c6b3dc6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gfill = require( './../lib/main.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.ndarray.js index b7a16499b7fd..bb35271fffc1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfill/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gfill = require( './../lib/ndarray.js' ); @@ -77,6 +78,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; @@ -90,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.js index 80a66a886e7e..9286ca981624 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.js @@ -82,6 +82,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.ndarray.js index d23f39b28bb4..810a4e431ada 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/benchmark/benchmark.ndarray.js @@ -82,6 +82,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/test/test.js index 4b2ce7715e21..b380ce088dd0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-index/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-index/test/test.js @@ -21,7 +21,7 @@ // MODULES // var tape = require( 'tape' ); -var gfindIndex = require( '@stdlib/blas/ext/base/gfind-index/lib' ); +var gfindIndex = require( './../lib' ); // TESTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.js index bb61dd2ee4e5..d991a3bfe451 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.js @@ -82,6 +82,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.ndarray.js index bb62a18c161e..5c93d0eb214a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/benchmark/benchmark.ndarray.js @@ -82,6 +82,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/test/test.js index 37ae7279fc63..5cf7557a0af0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gfind-last-index/test/test.js @@ -21,7 +21,7 @@ // MODULES // var tape = require( 'tape' ); -var gfindLastIndex = require( '@stdlib/blas/ext/base/gfind-last-index/lib' ); +var gfindLastIndex = require( './../lib' ); // TESTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/README.md b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/README.md new file mode 100644 index 000000000000..167d35495aed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/README.md @@ -0,0 +1,207 @@ + + +# gindexOfColumn + +> Return the index of the first column in an input matrix which has the same elements as a provided search vector. + +
+ +## Usage + +```javascript +var gindexOfColumn = require( '@stdlib/blas/ext/base/gindex-of-column' ); +``` + +#### gindexOfColumn( order, M, N, A, LDA, x, strideX ) + +Returns the index of the first column in an input matrix which has the same elements as a provided search vector. + +```javascript +/* + A = [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + +var x = [ 2.0, 4.0, 0.0 ]; +var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); +// returns 1 +``` + +The function has the following parameters: + +- **order**: storage layout. +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix as a linear array. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: search vector. +- **strideX**: stride length of `x`. + +If the function is unable to find a matching column, the function returns `-1`. + +```javascript +var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + +var x = [ -2.0, -4.0, 0.0 ]; +var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); +// returns -1 +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays: +var A0 = new Float64Array( [ 9999.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ] ); +var x0 = new Float64Array( [ 9999.0, 2.0, 4.0, 0.0 ] ); + +// Create offset views: +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +var out = gindexOfColumn( 'row-major', 3, 2, A1, 2, x1, 1 ); +// returns 1 +``` + + + +#### gindexOfColumn.ndarray( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) + + + +Returns the index of the first column in an input matrix which has the same elements as a provided search vector using alternative indexing semantics. + +```javascript +/* + A = [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + +var x = [ 2.0, 4.0, 0.0 ]; +var out = gindexOfColumn.ndarray( 3, 2, A, 2, 1, 0, x, 1, 0 ); +// returns 1 +``` + +The function has the following parameters: + +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input matrix as a linear array. +- **strideA1**: stride of the first dimension of `A`. +- **strideA2**: stride of the second dimension of `A`. +- **offsetA**: starting index for `A`. +- **x**: search vector. +- **strideX**: stride length of `x`. +- **offsetX**: starting index for `x`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, + +```javascript +/* + A = [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ] +*/ +var A = [ 9999.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + +var x = [ 9999.0, 2.0, 4.0, 0.0 ]; +var out = gindexOfColumn.ndarray( 3, 2, A, 2, 1, 1, x, 1, 1 ); +// returns 1 +``` + +
+ + + +
+ +## Notes + +- When searching for a matching column, the function checks for equality using the strict equality operator `===`. As a consequence, `NaN` values are considered distinct, and `-0` and `+0` are considered the same. +- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). + +
+ + + +
+ +## Examples + + + + + +```javascript +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var gindexOfColumn = require( '@stdlib/blas/ext/base/gindex-of-column' ); + +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ]; +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = [ 2.0, 5.0, 8.0 ]; +console.log( x ); + +var out = gindexOfColumn( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, 0 ); +console.log( out ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.js new file mode 100644 index 000000000000..fb267acdaefb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gindexOfColumn = require( './../lib' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var A = zeros( N*N, 'generic' ); + var x = zeros( N, 'generic' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = gindexOfColumn( order, N, N, A, N, x, 1 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..0b79ff3e8be2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/benchmark/benchmark.ndarray.js @@ -0,0 +1,124 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zeros = require( '@stdlib/array/zeros' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gindexOfColumn = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var A = zeros( N*N, 'generic' ); + var x = zeros( N, 'generic' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var sa1; + var sa2; + var z; + var i; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x[ N-1 ] += 1; + z = gindexOfColumn( N, N, A, sa1, sa2, 0, x, 1, 0 ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( format( '%s::square_matrix:ndarray:order=%s,size=%d', pkg, ord, N*N ), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/repl.txt new file mode 100644 index 000000000000..a5a472ecfee6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/repl.txt @@ -0,0 +1,103 @@ + +{{alias}}( order, M, N, A, LDA, x, strideX ) + Returns the index of the first column in an input matrix which has the same + elements as a provided search vector. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If the function is provided an empty matrix or if the function is unable to + find a matching column, the function returns `-1` (i.e., an invalid index). + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Array|TypedArray + Input matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Array|TypedArray + Search vector. + + strideX: integer + Stride length for `x`. + + Returns + ------- + out: integer + Column index. + + Examples + -------- + > var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + > var x = [ 2.0, 4.0 ]; + > {{alias}}( 'row-major', 2, 2, A, 2, x, 1 ) + 1 + + +{{alias}}.ndarray( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) + Returns the index of the first column in an input matrix which has the same + elements as a provided search vector using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, offset parameters support indexing semantics based on starting + indices. + + If the method is provided an empty matrix or if the method is unable to find + a matching column, the method returns `-1` (i.e., an invalid index). + + Parameters + ---------- + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Array|TypedArray + Input matrix `A`. + + strideA1: integer + Stride of the first dimension of `A`. + + strideA2: integer + Stride of the second dimension of `A`. + + offsetA: integer + Starting index for `A`. + + x: Array|TypedArray + Search vector. + + strideX: integer + Stride length for `x`. + + offsetX: integer + Starting index for `x`. + + Returns + ------- + out: integer + Column index. + + Examples + -------- + > var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; + > var x = [ 2.0, 4.0 ]; + > {{alias}}.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0 ) + 1 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/index.d.ts new file mode 100644 index 000000000000..c57e7aef71e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/index.d.ts @@ -0,0 +1,122 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Collection, AccessorArrayLike } from '@stdlib/types/array'; +import { Layout } from '@stdlib/types/blas'; + +/** +* Input array. +*/ +type InputArray = Collection | AccessorArrayLike; + +/** +* Interface describing `gindexOfColumn`. +*/ +interface Routine { + /** + * Returns the index of the first column in an input matrix which has the same elements as a provided search vector. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * + * @param order - storage layout + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - search vector + * @param strideX - stride length for `x` + * @returns column index + * + * @example + * var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] + * var x = [ 2.0, 4.0, 0.0 ]; + * + * var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); + * // returns 1 + */ + ( order: Layout, M: number, N: number, A: InputArray, LDA: number, x: InputArray, strideX: number ): number; + + /** + * Returns the index of the first column in an input matrix which has the same elements as a provided search vector using alternative indexing semantics. + * + * ## Notes + * + * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * + * @param M - number of rows in `A` + * @param N - number of columns in `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param x - search vector + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @returns column index + * + * @example + * var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] + * var x = [ 2.0, 4.0, 0.0 ]; + * + * var out = gindexOfColumn.ndarray( 3, 2, A, 2, 1, 0, x, 1, 0 ); + * // returns 1 + */ + ndarray( M: number, N: number, A: InputArray, strideA1: number, strideA2: number, offsetA: number, x: InputArray, strideX: number, offsetX: number ): number; +} + +/** +* Returns the index of the first column in an input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* +* @param order - storage layout +* @param M - number of rows in `A` +* @param N - number of columns in `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - search vector +* @param strideX - stride length for `x` +* @returns column index +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = [ 2.0, 4.0, 0.0 ]; +* +* var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); +* // returns 1 +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = [ 2.0, 4.0, 0.0 ]; +* +* var out = gindexOfColumn.ndarray( 3, 2, A, 2, 1, 0, x, 1, 0 ); +* // returns 1 +*/ +declare var gindexOfColumn: Routine; + + +// EXPORTS // + +export = gindexOfColumn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/test.ts new file mode 100644 index 000000000000..b895c1dc2f89 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/docs/types/test.ts @@ -0,0 +1,302 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 gindexOfColumn = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, 2, A, 2, x, 1 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 5, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( true, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( false, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( null, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( void 0, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( [], 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( {}, 2, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( ( x: number ): number => x, 2, 2, A, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', '5', 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', true, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', false, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', null, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', void 0, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', [], 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', {}, 2, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', ( x: number ): number => x, 2, A, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, '5', A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, true, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, false, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, null, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, void 0, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, [], A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, {}, A, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, ( x: number ): number => x, A, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a collection... +{ + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, 2, 5, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, true, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, false, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, null, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, void 0, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, {}, 2, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, ( x: number ): number => x, 2, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, 2, A, '5', x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, true, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, false, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, null, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, void 0, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, [], x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, {}, x, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a collection... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, 2, A, 2, 5, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, true, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, false, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, null, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, void 0, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, {}, 1 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn( 'row-major', 2, 2, A, 2, x, '5' ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, true ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, false ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, null ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, void 0 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, [] ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, {} ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn(); // $ExpectError + gindexOfColumn( 'row-major' ); // $ExpectError + gindexOfColumn( 'row-major', 2 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2 ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x ); // $ExpectError + gindexOfColumn( 'row-major', 2, 2, A, 2, x, 1, 0 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( '5', 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( true, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( false, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( null, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( void 0, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( [], 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( {}, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( ( x: number ): number => x, 2, A, 2, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, '5', A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, true, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, false, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, null, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, void 0, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, [], A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, {}, A, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, ( x: number ): number => x, A, 2, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a collection... +{ + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, 5, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, true, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, false, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, null, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, void 0, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, {}, 2, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, ( x: number ): number => x, 2, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, '5', 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, true, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, false, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, null, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, void 0, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, [], 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, '5', 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, true, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, false, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, null, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, void 0, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, [], 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, {}, 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, 1, '5', x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, true, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, false, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, null, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, void 0, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, [], x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, {}, x, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a collection... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, 5, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, true, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, false, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, null, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, void 0, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, {}, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, '5', 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, true, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, false, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, null, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, void 0, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, [], 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, {}, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, '5' ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, true ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, false ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, null ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, void 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, [] ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, {} ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = [ 1.0, 2.0, 3.0, 4.0 ]; + const x = [ 2.0, 4.0 ]; + + gindexOfColumn.ndarray(); // $ExpectError + gindexOfColumn.ndarray( 2 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1 ); // $ExpectError + gindexOfColumn.ndarray( 2, 2, A, 2, 1, 0, x, 1, 0, 0 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/examples/index.js new file mode 100644 index 000000000000..1866eaf64992 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/examples/index.js @@ -0,0 +1,36 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var gindexOfColumn = require( './../lib' ); + +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var A = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ]; +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +var x = [ 2.0, 5.0, 8.0 ]; +console.log( x ); + +var out = gindexOfColumn( order, shape[ 0 ], shape[ 1 ], A, strides[ 0 ], x, 1, 0 ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/accessors.js new file mode 100644 index 000000000000..13ef44a3091c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/accessors.js @@ -0,0 +1,188 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); +var ones = require( '@stdlib/array/base/ones' ); + + +// MAIN // + +/** +* Returns the index of the first column in an input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* +* @private +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Object} A - input matrix object +* @param {Collection} A.data - input matrix data +* @param {Array} A.accessors - matrix element accessors +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Object} x - search vector object +* @param {Collection} x.data - search vector data +* @param {Array} x.accessors - search vector element accessors +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @returns {integer} column index +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var A = [ 1.0, 3.0, 0.0, 2.0, 4.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 3.0, 4.0 ]; +* +* var out = gindexOfColumn( 2, 3, arraylike2object( toAccessorArray( A ) ), 3, 1, 0, arraylike2object( toAccessorArray( x ) ), 1, 0 ); +* // returns 1 +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 3.0, 4.0 ]; +* +* var out = gindexOfColumn( 2, 3, arraylike2object( toAccessorArray( A ) ), 1, 2, 0, arraylike2object( toAccessorArray( x ) ), 1, 0 ); +* // returns 1 +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 1.0, 2.0 ]; +* +* var out = gindexOfColumn( 2, 3, arraylike2object( toAccessorArray( A ) ), 1, 2, 0, arraylike2object( toAccessorArray( x ) ), 1, 0 ); +* // returns 0 +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 0.0, 0.0 ]; +* +* var out = gindexOfColumn( 2, 3, arraylike2object( toAccessorArray( A ) ), 1, 2, 0, arraylike2object( toAccessorArray( x ) ), 1, 0 ); +* // returns 2 +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ -3.0, -4.0 ]; +* +* var out = gindexOfColumn( 2, 3, arraylike2object( toAccessorArray( A ) ), 1, 2, 0, arraylike2object( toAccessorArray( x ) ), 1, 0 ); +* // returns -1 +*/ +function gindexOfColumn( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-len + var matches; + var abuf; + var xbuf; + var aget; + var xget; + var da0; + var da1; + var S0; + var S1; + var ia; + var ix; + var i0; + var i1; + + // Cache references to array data: + abuf = A.data; + xbuf = x.data; + + // Cache references to the element accessors: + aget = A.accessors[ 0 ]; + xget = x.accessors[ 0 ]; + + // Search for the first column matching the search vector... + if ( isColumnMajor( [ strideA1, strideA2 ] ) ) { + S0 = M; + S1 = N; + + // Scan a column-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA2 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( aget( abuf, ia ) !== xget( xbuf, ix ) ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA1; + ix += strideX; + } + // If we successfully iterated over all rows, then that means we've found a match... + if ( i0 === S0 ) { + return i1; + } + } + // If we've made it here, then no columns match the search vector: + return -1; + } + // Row-major... + S0 = N; + S1 = M; + + // Resolve loop offset (pointer) increments: + da0 = strideA2; + da1 = strideA1 - ( S0*strideA2 ); + + // Create an array for tracking which columns contain matching elements: + matches = ones( N ); + + // Finding the first matching column when a matrix is stored in row-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan across each row (otherwise, if we went column-by-column, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan across the columns in a row looking for a matching element... + for ( i0 = 0; i0 < S0; i0++ ) { + if ( aget( abuf, ia ) !== xget( xbuf, ix ) ) { + // We found a non-matching element, which means we can exclude this column from the list of column candidates... + matches[ i0 ] = 0; + } + ia += da0; + } + ia += da1; + ix += strideX; + } + // Search for the first matching column... + for ( i0 = 0; i0 < S0; i0++ ) { + if ( matches[ i0 ] === 1 ) { + break; + } + } + return ( i0 === S0 ) ? -1 : i0; +} + + +// EXPORTS // + +module.exports = gindexOfColumn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/base.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/base.js new file mode 100644 index 000000000000..97c8e3f47f32 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/base.js @@ -0,0 +1,170 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); +var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var ones = require( '@stdlib/array/base/ones' ); +var accessors = require( './accessors.js' ); + + +// MAIN // + +/** +* Returns the index of the first column in an input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* +* @private +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Collection} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Collection} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @returns {integer} column index +* +* @example +* var A = [ 1.0, 3.0, 0.0, 2.0, 4.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 3.0, 4.0 ]; +* +* var out = gindexOfColumn( 2, 3, A, 3, 1, 0, x, 1, 0 ); +* // returns 1 +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 3.0, 4.0 ]; +* +* var out = gindexOfColumn( 2, 3, A, 1, 2, 0, x, 1, 0 ); +* // returns 1 +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 1.0, 2.0 ]; +* +* var out = gindexOfColumn( 2, 3, A, 1, 2, 0, x, 1, 0 ); +* // returns 0 +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ 0.0, 0.0 ]; +* +* var out = gindexOfColumn( 2, 3, A, 1, 2, 0, x, 1, 0 ); +* // returns 2 +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 3.0, 0.0 ], [ 2.0, 4.0, 0.0 ] ] +* var x = [ -3.0, -4.0 ]; +* +* var out = gindexOfColumn( 2, 3, A, 1, 2, 0, x, 1, 0 ); +* // returns -1 +*/ +function gindexOfColumn( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-len + var matches; + var da0; + var da1; + var S0; + var S1; + var ia; + var ix; + var i0; + var i1; + var oa; + var ox; + + // Check whether the matrix is an empty matrix... + if ( M <= 0 || N <= 0 ) { + return -1; + } + oa = arraylike2object( A ); + ox = arraylike2object( x ); + if ( oa.accessorProtocol || ox.accessorProtocol ) { + return accessors( M, N, oa, strideA1, strideA2, offsetA, ox, strideX, offsetX ); // eslint-disable-line max-len + } + // Search for the first column matching the search vector... + if ( isColumnMajor( [ strideA1, strideA2 ] ) ) { + S0 = M; + S1 = N; + + // Scan a column-major linear buffer from the first indexed element to the last indexed element, always moving in the same direction when both strides are the same sign, thus ensuring cache optimal traversal... + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA2 ); + ix = offsetX; + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] !== x[ ix ] ) { + // We found an element which is not in the search vector... + break; + } + ia += strideA1; + ix += strideX; + } + // If we successfully iterated over all rows, then that means we've found a match... + if ( i0 === S0 ) { + return i1; + } + } + // If we've made it here, then no columns match the search vector: + return -1; + } + // Row-major... + S0 = N; + S1 = M; + + // Resolve loop offset (pointer) increments: + da0 = strideA2; + da1 = strideA1 - ( S0*strideA2 ); + + // Create an array for tracking which columns contain matching elements: + matches = ones( N ); + + // Finding the first matching column when a matrix is stored in row-major order requires effectively performing a full linear scan. In order to ensure cache-efficient traversal, scan across each row (otherwise, if we went column-by-column, we'd hop around linear memory, resulting in poor cache behavior)... + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + // Scan across the columns in a row looking for a matching element... + for ( i0 = 0; i0 < S0; i0++ ) { + if ( A[ ia ] !== x[ ix ] ) { + // We found a non-matching element, which means we can exclude this column from the list of column candidates... + matches[ i0 ] = 0; + } + ia += da0; + } + ia += da1; + ix += strideX; + } + // Search for the first matching column... + for ( i0 = 0; i0 < S0; i0++ ) { + if ( matches[ i0 ] === 1 ) { + break; + } + } + return ( i0 === S0 ) ? -1 : i0; +} + + +// EXPORTS // + +module.exports = gindexOfColumn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/index.js new file mode 100644 index 000000000000..7b51733e3332 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/index.js @@ -0,0 +1,50 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return the index of the first column in an input matrix which has the same elements as a provided search vector. +* +* @module @stdlib/blas/ext/base/gindex-of-column +* +* @example +* var gindexOfColumn = require( '@stdlib/blas/ext/base/gindex-of-column' ); +* +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = [ 2.0, 4.0, 0.0 ]; +* +* var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); +* // returns 1 +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js new file mode 100644 index 000000000000..0d51f86097bb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js @@ -0,0 +1,87 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Returns the index of the first column in an input matrix which has the same elements as a provided search vector. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* +* @param {string} order - storage layout +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Collection} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Collection} x - search vector +* @param {integer} strideX - stride length for `x` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {integer} column index +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = [ 2.0, 4.0, 0.0 ]; +* +* var out = gindexOfColumn( 'row-major', 3, 2, A, 2, x, 1 ); +* // returns 1 +*/ +function gindexOfColumn( order, M, N, A, LDA, x, strideX ) { + var sa1; + var sa2; + var s; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) ) { + s = N; + } else { + s = M; + } + if ( LDA < max( 1, s ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return base( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = gindexOfColumn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/ndarray.js new file mode 100644 index 000000000000..73b3c5b44bd1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/ndarray.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var base = require( './base.js' ); + + +// MAIN // + +/** +* Returns the index of the first column in an input matrix which has the same elements as a provided search vector using alternative indexing semantics. +* +* ## Notes +* +* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). +* +* @param {PositiveInteger} M - number of rows in `A` +* @param {PositiveInteger} N - number of columns in `A` +* @param {Collection} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Collection} x - search vector +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @returns {integer} column index +* +* @example +* var A = [ 1.0, 2.0, 3.0, 4.0, 0.0, 0.0 ]; // => [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ] +* var x = [ 2.0, 4.0, 0.0 ]; +* +* var out = gindexOfColumn( 3, 2, A, 2, 1, 0, x, 1, 0 ); +* // returns 1 +*/ +function gindexOfColumn( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-len + return base( M, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); +} + + +// EXPORTS // + +module.exports = gindexOfColumn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/package.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/package.json new file mode 100644 index 000000000000..c65d9f4e9e1e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stdlib/blas/ext/base/gindex-of-column", + "version": "0.0.0", + "description": "Return the index of the first column in an input matrix which has the same elements as a provided search vector.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "blas", + "matrix", + "strided", + "array", + "ndarray", + "vector", + "column", + "index", + "search", + "find", + "index-of", + "indexof" + ] +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major.json new file mode 100644 index 000000000000..8f1d3cbceed3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "A": [ 1.0, 2.0, 2.0, 0.0, 3.0, 4.0, 4.0, 0.0 ], + "M": 4, + "N": 2, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "LDA": 4, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 4.0, 4.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major_no_match.json new file mode 100644 index 000000000000..ffd69b299114 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/column_major_no_match.json @@ -0,0 +1,19 @@ +{ + "order": "column-major", + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 4.0, 5.0 ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major.json new file mode 100644 index 000000000000..44d2889c4217 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major.json @@ -0,0 +1,32 @@ +{ + "order": "column-major", + "A": [ + 1.0, + 9999.0, + 2.0, + 9999.0, + 0.0, + 9999.0, + 3.0, + 9999.0, + 4.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 0.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major_no_match.json new file mode 100644 index 000000000000..92a2f628c2a8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/column_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 5.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major.json new file mode 100644 index 000000000000..7297b186102d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "A": [ + 1.0, + 9999.0, + 2.0, + 9999.0, + 3.0, + 9999.0, + 4.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 9999.0, 4.0, 9999.0, 0.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major_no_match.json new file mode 100644 index 000000000000..02cb9617a8e7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/large-strides/row_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 5.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major.json new file mode 100644 index 000000000000..152988e47052 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 3.0, + 4.0, + 0.0, + 1.0, + 2.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 0.0, 9999.0, 4.0, 9999.0, 3.0 ], + "strideX": -2, + "offsetX": 4, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major_no_match.json new file mode 100644 index 000000000000..296bdbe3a26b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/column_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 5.0, 9999.0, 4.0, 9999.0, 3.0 ], + "strideX": -2, + "offsetX": 4, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major.json new file mode 100644 index 000000000000..70e009cd0f68 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 3.0, + 4.0, + 1.0, + 2.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 0.0, 9999.0, 4.0, 9999.0, 2.0 ], + "strideX": -2, + "offsetX": 4, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major_no_match.json new file mode 100644 index 000000000000..f00295a2096e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/mixed-strides/row_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 5.0, 9999.0, 4.0, 9999.0, 3.0 ], + "strideX": -2, + "offsetX": 4, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major.json new file mode 100644 index 000000000000..923304fe25f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 4.0, + 3.0, + 0.0, + 2.0, + 1.0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 0.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major_no_match.json new file mode 100644 index 000000000000..7d538fb9ba4c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/column_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 5.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major.json new file mode 100644 index 000000000000..c2d92dbc586e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 4.0, + 3.0, + 2.0, + 1.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 9999.0, 4.0, 9999.0, 0.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major_no_match.json new file mode 100644 index 000000000000..e86a1e4e55d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/negative-strides/row_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0, 5.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major.json new file mode 100644 index 000000000000..7ebf372db006 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major.json @@ -0,0 +1,27 @@ +{ + "order": "column-major", + "A": [ + 9999.0, + 1.0, + 2.0, + 0.0, + 3.0, + 4.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0, 0.0 ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major_no_match.json new file mode 100644 index 000000000000..c20037246a89 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/column_major_no_match.json @@ -0,0 +1,27 @@ +{ + "order": "column-major", + "A": [ + 9999.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0, 5.0 ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major.json new file mode 100644 index 000000000000..43119617f582 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "A": [ + 9999.0, + 1.0, + 2.0, + 3.0, + 4.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 2.0, 4.0, 0.0 ], + "strideX": 1, + "offsetX": 1, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major_no_match.json new file mode 100644 index 000000000000..039d3a6dc1d9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/offsets/row_major_no_match.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "A": [ + 9999.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 3.0, 4.0, 5.0 ], + "strideX": 1, + "offsetX": 1, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major.json new file mode 100644 index 000000000000..6a54b30a1732 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "A": [ 1.0, 2.0, 3.0, 4.0, 3.0, 4.0, 0.0, 0.0 ], + "M": 4, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 4.0, 4.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major_no_match.json new file mode 100644 index 000000000000..ed5a1f18366b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/fixtures/row_major_no_match.json @@ -0,0 +1,19 @@ +{ + "order": "row-major", + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 4.0, 5.0 ], + "strideX": 1, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.js new file mode 100644 index 000000000000..7fc7dc64a69b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 gindexOfColumn = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gindexOfColumn, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof gindexOfColumn.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.main.js new file mode 100644 index 000000000000..85082a5ce1b4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.main.js @@ -0,0 +1,242 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gindexOfColumn = require( './../lib' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gindexOfColumn, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 7', function test( t ) { + t.strictEqual( gindexOfColumn.length, 7, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + gindexOfColumn( value, data.M, data.N, data.A, data.LDA, data.x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + gindexOfColumn( data.order, data.M, data.N, data.A, value, data.x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', function test( t ) { + var values; + var data; + var i; + + data = COLUMN_MAJOR_DATA; + + values = [ + 0, + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + gindexOfColumn( data.order, data.M, data.N, data.A, value, data.x, data.strideX ); + }; + } +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, 0, data.N, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, 0, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, data.N, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, data.N, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.order, data.M, data.N, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.order, data.M, data.N, data.A, data.LDA, data.x, data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, accessors)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, data.N, toAccessorArray( data.A ), data.LDA, toAccessorArray( data.x ), data.strideX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, accessors)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, data.N, toAccessorArray( data.A ), data.LDA, toAccessorArray( data.x ), data.strideX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, accessors)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.order, data.M, data.N, toAccessorArray( data.A ), data.LDA, toAccessorArray( data.x ), data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, accessors)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.order, data.M, data.N, toAccessorArray( data.A ), data.LDA, toAccessorArray( data.x ), data.strideX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.ndarray.js new file mode 100644 index 000000000000..f6280fde9b07 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/test/test.ndarray.js @@ -0,0 +1,549 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gindexOfColumn = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); +var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); +var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); +var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); +var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); +var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); +var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); +var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gindexOfColumn, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( gindexOfColumn.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, 0, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, 0, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when M is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.order, 0, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index when N is less than or equal to zero (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.order, data.M, 0, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, -1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, data.A, data.strideA1, data.strideA2, data.offsetA, data.x, data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, accessors)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, accessors)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, accessors)', function test( t ) { + var data; + var out; + + data = ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, accessors)', function test( t ) { + var data; + var out; + + data = COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, offsets, accessors)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, offsets, accessors)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, offsets, accessors)', function test( t ) { + var data; + var out; + + data = OFFSET_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, offsets, accessors)', function test( t ) { + var data; + var out; + + data = OFFSET_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, mixed strides, accessors)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, mixed strides, accessors)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, mixed strides, accessors)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, mixed strides, accessors)', function test( t ) { + var data; + var out; + + data = MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, negative strides, accessors)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, negative strides, accessors)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, negative strides, accessors)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, negative strides, accessors)', function test( t ) { + var data; + var out; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (row-major, large strides, accessors)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the index of the first column matching a search vector (column-major, large strides, accessors)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_DATA; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (row-major, large strides, accessors)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_ROW_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns an invalid index if unable to find a search vector (column-major, large strides, accessors)', function test( t ) { + var data; + var out; + + data = LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH; + out = gindexOfColumn( data.M, data.N, toAccessorArray( data.A ), data.strideA1, data.strideA2, data.offsetA, toAccessorArray( data.x ), data.strideX, data.offsetX ); + + t.strictEqual( out, data.expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major.json new file mode 100644 index 000000000000..b76888a50e24 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major.json @@ -0,0 +1,32 @@ +{ + "order": "column-major", + "A": [ + 1, + 9999.0, + 2.0, + 9999.0, + 0.0, + 9999.0, + 3.0, + 9999.0, + 4.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major_no_match.json new file mode 100644 index 000000000000..29de47f49af6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/column_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major.json new file mode 100644 index 000000000000..cc7f7a6ddf0a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "A": [ + 1.0, + 9999.0, + 2.0, + 9999.0, + 3.0, + 9999.0, + 4.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major_no_match.json new file mode 100644 index 000000000000..5337eee8283c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/large-strides/row_major_no_match.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0, + 0.0, + 9999.0 + ], + "M": 3, + "N": 2, + "strideA1": 4, + "strideA2": 2, + "offsetA": 0, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major.json new file mode 100644 index 000000000000..aaa21b653d14 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 3.0, + 4.0, + 0.0, + 1.0, + 2.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 4.0, 9999.0, 2.0, 9999.0 ], + "strideX": -2, + "offsetX": 2, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json new file mode 100644 index 000000000000..efd5cb66e8c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/column_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": 1, + "strideA2": -3, + "offsetA": 3, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 4.0, 9999.0, 3.0, 9999.0 ], + "strideX": -2, + "offsetX": 2, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major.json new file mode 100644 index 000000000000..d7fe9ee838da --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 3.0, + 4.0, + 1.0, + 2.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 4.0, 9999.0, 3.0, 9999.0 ], + "strideX": -2, + "offsetX": 3, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json new file mode 100644 index 000000000000..0270879b82ad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/mixed-strides/row_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": 1, + "offsetA": 4, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 9999.0, 4.0, 9999.0, 3.0, 9999.0 ], + "strideX": -2, + "offsetX": 3, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major.json new file mode 100644 index 000000000000..fd8c1de70614 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 4.0, + 3.0, + 0.0, + 2.0, + 1.0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "A_mat": [ + [ 1.0, 3.0 ], + [ 2.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major_no_match.json new file mode 100644 index 000000000000..5fc0e96d96a2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/column_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -1, + "strideA2": -3, + "offsetA": 5, + "LDA": 3, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 2.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major.json new file mode 100644 index 000000000000..a3b47eb643bc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 4.0, + 3.0, + 2.0, + 1.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "A_mat": [ + [ 1.0, 2.0 ], + [ 3.0, 4.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": 1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major_no_match.json b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major_no_match.json new file mode 100644 index 000000000000..4e430bab2070 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/fixtures/negative-strides/row_major_no_match.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + "A": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "M": 3, + "N": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "LDA": 2, + "A_mat": [ + [ 0.0, 0.0 ], + [ 0.0, 0.0 ], + [ 0.0, 0.0 ] + ], + "x": [ 3.0, 9999.0, 4.0, 9999.0 ], + "strideX": 2, + "offsetX": 0, + "expected": -1 +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/test.ndarray.js index b8a979086801..cc8d42b21400 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/test/test.ndarray.js @@ -32,26 +32,22 @@ var ROW_MAJOR_DATA = require( './fixtures/row_major.json' ); var ROW_MAJOR_NO_MATCH = require( './fixtures/row_major_no_match.json' ); var COLUMN_MAJOR_DATA = require( './fixtures/column_major.json' ); var COLUMN_MAJOR_NO_MATCH = require( './fixtures/column_major_no_match.json' ); - var OFFSET_ROW_MAJOR_DATA = require( './fixtures/offsets/row_major.json' ); var OFFSET_ROW_MAJOR_NO_MATCH = require( './fixtures/offsets/row_major_no_match.json' ); var OFFSET_COLUMN_MAJOR_DATA = require( './fixtures/offsets/column_major.json' ); var OFFSET_COLUMN_MAJOR_NO_MATCH = require( './fixtures/offsets/column_major_no_match.json' ); - -var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative_strides/row_major.json' ); -var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative_strides/row_major_no_match.json' ); -var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative_strides/column_major.json' ); -var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative_strides/column_major_no_match.json' ); - -var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed_strides/row_major.json' ); -var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed_strides/row_major_no_match.json' ); -var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed_strides/column_major.json' ); -var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed_strides/column_major_no_match.json' ); - -var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large_strides/row_major.json' ); -var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large_strides/row_major_no_match.json' ); -var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large_strides/column_major.json' ); -var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large_strides/column_major_no_match.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/negative-strides/row_major.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/negative-strides/row_major_no_match.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/negative-strides/column_major.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/negative-strides/column_major_no_match.json' ); +var MIXED_STRIDES_ROW_MAJOR_DATA = require( './fixtures/mixed-strides/row_major.json' ); +var MIXED_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/row_major_no_match.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/mixed-strides/column_major.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/mixed-strides/column_major_no_match.json' ); +var LARGE_STRIDES_ROW_MAJOR_DATA = require( './fixtures/large-strides/row_major.json' ); +var LARGE_STRIDES_ROW_MAJOR_NO_MATCH = require( './fixtures/large-strides/row_major_no_match.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_DATA = require( './fixtures/large-strides/column_major.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_NO_MATCH = require( './fixtures/large-strides/column_major_no_match.json' ); // TESTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/README.md b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/README.md new file mode 100644 index 000000000000..522cb1037870 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/README.md @@ -0,0 +1,195 @@ + + +# gjoinBetween + +> Return a string by joining strided array elements using a specified separator for each pair of consecutive elements. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var gjoinBetween = require( '@stdlib/blas/ext/base/gjoin-between' ); +``` + +#### gjoinBetween( N, prefix, suffix, x, strideX, separators, strideS ) + +Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. + +```javascript +var x = [ 1, 2, 3, 4 ]; +var sep = [ ' + ', ' - ', ' != ' ]; + +var str = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); +// returns 'op: 1 + 2 - 3 != 4' +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **prefix**: string to prepend to the output string. +- **suffix**: string to append to the output string. +- **x**: input array. +- **strideX**: stride length for `x`. +- **separators**: separators array. +- **strideS**: stride length for `separators`. + +The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to join every other element: + +```javascript +var x = [ 1, 2, 3, 4, 5, 6 ]; +var sep = [ ',', '-' ]; + +var str = gjoinBetween( 3, '', '', x, 2, sep, 1 ); +// returns '1,3-5' +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array: +var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + +// Create an offset view: +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Join elements: +var sep = [ ' | ', ' | ' ]; +var str = gjoinBetween( 3, '[', ']', x1, 2, sep, 1 ); +// returns '[2 | 4 | 6]' +``` + + + +#### gjoinBetween.ndarray( N, prefix, suffix, x, strideX, offsetX, separators, strideS, offsetS ) + + + +Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements and alternative indexing semantics. + +```javascript +var x = [ 1, 2, 3, 4 ]; +var sep = [ ' + ', ' - ', ' != ' ]; + +var str = gjoinBetween.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); +// returns 'op: 1 + 2 - 3 != 4' +``` + +The function has the following additional parameters: + +- **offsetX**: starting index for `x`. +- **offsetS**: starting index for `separators`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to access only the last three elements of the input strided array: + +```javascript +var x = [ 1, 2, 3, 4, 5, 6 ]; +var sep = [ ' | ', ' | ' ]; + +var str = gjoinBetween.ndarray( 3, '[ ', ' ]', x, 1, x.length-3, sep, 1, 0 ); +// returns '[ 4 | 5 | 6 ]' +``` + +
+ + + + + +
+ +## Notes + +- If `N <= 0`, both functions return the prefix and suffix joined together. +- The `separators` array is assumed to have at least `N-1` indexed elements (i.e., equal to the number of "gaps" between consecutive elements). +- If an array element is either `null` or `undefined`, both functions serialize the element as an empty string. +- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). + +
+ + + + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var filled = require( '@stdlib/array/base/filled' ); +var gjoinBetween = require( '@stdlib/blas/ext/base/gjoin-between' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +var sep = filled( ' | ', x.length - 1 ); +var out = gjoinBetween( x.length, '[ ', ' ]', x, 1, sep, 1 ); +console.log( out ); +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.js new file mode 100644 index 000000000000..b6e5e247fa68 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.js @@ -0,0 +1,99 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var oneTo = require( '@stdlib/array/one-to' ); +var filled = require( '@stdlib/array/base/filled' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gjoinBetween = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var sep = filled( ',', len - 1 ); + var x = oneTo( len, 'float64' ); + 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 = gjoinBetween( x.length, '', '', x, 1, sep, 1 ); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..70c8b7406c4a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/benchmark/benchmark.ndarray.js @@ -0,0 +1,99 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var oneTo = require( '@stdlib/array/one-to' ); +var filled = require( '@stdlib/array/base/filled' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gjoinBetween = require( './../lib/ndarray.js' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var sep = filled( ',', len - 1 ); + var x = oneTo( len, 'float64' ); + 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 = gjoinBetween( x.length, '', '', x, 1, 0, sep, 1, 0 ); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( out ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/repl.txt new file mode 100644 index 000000000000..2649371fa4dc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/repl.txt @@ -0,0 +1,104 @@ + +{{alias}}( N, prefix, suffix, x, strideX, separators, strideS ) + Returns a string by joining strided array elements using a specified + separator for each pair of consecutive elements. + + The `N` and stride parameters determine which elements in the strided arrays + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use a typed + array view. + + If `N <= 0`, the function returns the prefix and suffix joined together. + + If an array element is either `null` or `undefined`, the function serializes + the element as an empty string. + + Parameters + ---------- + N: integer + Number of indexed elements. + + prefix: string + String to prepend to the output string. + + suffix: string + String to append to the output string. + + x: Array|TypedArray + Input array. + + strideX: integer + Stride length for `x`. + + separators: Array + Separators array. + + strideS: integer + Stride length for `separators`. + + Returns + ------- + str: string + Joined string. + + Examples + -------- + > var x = [ 1, 2, 3, 4 ]; + > var sep = [ ' + ', ' - ', ' != ' ]; + > var str = {{alias}}( x.length, 'op: ', '', x, 1, sep, 1 ) + 'op: 1 + 2 - 3 != 4' + + +{{alias}}.ndarray( N, prefix, suffix, x, sx, ox, separators, ss, os ) + Returns a string by joining strided array elements using a specified + separator for each pair of consecutive elements and alternative indexing + semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on + starting indices. + + Parameters + ---------- + N: integer + Number of indexed elements. + + prefix: string + String to prepend to the output string. + + suffix: string + String to append to the output string. + + x: Array|TypedArray + Input array. + + sx: integer + Stride length for `x`. + + ox: integer + Starting index for `x`. + + separators: Array + Separators array. + + ss: integer + Stride length for `separators`. + + os: integer + Starting index for `separators`. + + Returns + ------- + str: string + Joined string. + + Examples + -------- + > var x = [ 1, 2, 3, 4 ]; + > var sep = [ ' + ', ' - ', ' != ' ]; + > var str = {{alias}}.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ) + 'op: 1 + 2 - 3 != 4' + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/index.d.ts new file mode 100644 index 000000000000..52e5a6aaf735 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/index.d.ts @@ -0,0 +1,110 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Collection, AccessorArrayLike } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = Collection | AccessorArrayLike; + +/** +* Interface describing `gjoinBetween`. +*/ +interface Routine { + /** + * Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. + * + * @param N - number of indexed elements + * @param prefix - string to prepend to the output string + * @param suffix - string to append to the output string + * @param x - input array + * @param strideX - stride length for `x` + * @param separators - separators array + * @param strideS - stride length for `separators` + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * var sep = [ ' + ', ' - ', ' != ' ]; + * + * var str = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); + * // returns 'op: 1 + 2 - 3 != 4' + */ + ( N: number, prefix: string, suffix: string, x: InputArray, strideX: number, separators: Collection, strideS: number ): string; + + /** + * Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements and alternative indexing semantics. + * + * @param N - number of indexed elements + * @param prefix - string to prepend to the output string + * @param suffix - string to append to the output string + * @param x - input array + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @param separators - separators array + * @param strideS - stride length for `separators` + * @param offsetS - starting index for `separators` + * @returns joined string + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * var sep = [ ' + ', ' - ', ' != ' ]; + * + * var str = gjoinBetween.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); + * // returns 'op: 1 + 2 - 3 != 4' + */ + ndarray( N: number, prefix: string, suffix: string, x: InputArray, strideX: number, offsetX: number, separators: Collection, strideS: number, offsetS: number ): string; +} + +/** +* Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. +* +* @param N - number of indexed elements +* @param prefix - string to prepend to the output string +* @param suffix - string to append to the output string +* @param x - input array +* @param strideX - stride length for `x` +* @param separators - separators array +* @param strideS - stride length for `separators` +* @returns joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var str = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); +* // returns 'op: 1 + 2 - 3 != 4' +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var str = gjoinBetween.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); +* // returns 'op: 1 + 2 - 3 != 4' +*/ +declare var gjoinBetween: Routine; + + +// EXPORTS // + +export = gjoinBetween; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/test.ts new file mode 100644 index 000000000000..0cc58f2b62ca --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/docs/types/test.ts @@ -0,0 +1,296 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 gjoinBetween = require( './index' ); + + +// TESTS // + +// The function returns a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( x.length, '', '', x, 1, sep, 1 ); // $ExpectType string +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( '5', '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( true, '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( false, '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( null, '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( undefined, '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( [], '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( {}, '', '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( ( x: number ): number => x, '', '', x, 1, sep, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( x.length, 5, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, true, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, false, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, null, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, undefined, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, [], '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, {}, '', x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, ( x: number ): number => x, '', x, 1, sep, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( x.length, '', 5, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', true, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', false, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', null, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', undefined, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', [], x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', {}, x, 1, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', ( x: number ): number => x, x, 1, sep, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not an array-like object... +{ + const sep = [ ',', '-', '|' ]; + + gjoinBetween( 4, '', '', 5, 1, sep, 1 ); // $ExpectError + gjoinBetween( 4, '', '', true, 1, sep, 1 ); // $ExpectError + gjoinBetween( 4, '', '', false, 1, sep, 1 ); // $ExpectError + gjoinBetween( 4, '', '', null, 1, sep, 1 ); // $ExpectError + gjoinBetween( 4, '', '', undefined, 1, sep, 1 ); // $ExpectError + gjoinBetween( 4, '', '', {}, 1, sep, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( x.length, '', '', x, '5', sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, true, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, false, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, null, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, undefined, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, [], sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, {}, sep, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, ( x: number ): number => x, sep, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not an array-like object... +{ + const x = [ 1, 2, 3, 4 ]; + + gjoinBetween( x.length, '', '', x, 1, 5, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, true, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, false, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, null, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, undefined, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, {}, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween( x.length, '', '', x, 1, sep, '5' ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, true ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, false ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, null ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, undefined ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, [] ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, {} ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween(); // $ExpectError + gjoinBetween( x.length ); // $ExpectError + gjoinBetween( x.length, '' ); // $ExpectError + gjoinBetween( x.length, '', '' ); // $ExpectError + gjoinBetween( x.length, '', '', x ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1 ); // $ExpectError + gjoinBetween( x.length, '', '', x, 1, sep ); // $ExpectError +} + +// Attached to the main export is an `ndarray` method which returns a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectType string +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( '5', '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( true, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( false, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( null, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( undefined, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( [], '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( {}, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( ( x: number ): number => x, '', '', x, 1, 0, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, 5, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, true, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, false, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, null, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, undefined, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, [], '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, {}, '', x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, ( x: number ): number => x, '', x, 1, 0, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a string... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', 5, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', true, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', false, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', null, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', undefined, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', [], x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', {}, x, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', ( x: number ): number => x, x, 1, 0, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not an array-like object... +{ + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( 4, '', '', 5, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( 4, '', '', true, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( 4, '', '', false, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( 4, '', '', null, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( 4, '', '', undefined, 1, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( 4, '', '', {}, 1, 0, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', '', x, '5', 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, true, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, false, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, null, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, undefined, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, [], 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, {}, 0, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, ( x: number ): number => x, 0, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', '', x, 1, '5', sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, true, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, false, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, null, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, undefined, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, [], sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, {}, sep, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, ( x: number ): number => x, sep, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not an array-like object... +{ + const x = [ 1, 2, 3, 4 ]; + + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, 5, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, true, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, false, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, null, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, undefined, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, {}, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, '5', 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, true, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, false, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, null, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, undefined, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, [], 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, {}, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, '5' ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, true ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, false ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, null ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, undefined ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, [] ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, {} ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided insufficient arguments... +{ + const x = [ 1, 2, 3, 4 ]; + const sep = [ ',', '-', '|' ]; + + gjoinBetween.ndarray(); // $ExpectError + gjoinBetween.ndarray( x.length ); // $ExpectError + gjoinBetween.ndarray( x.length, '' ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '' ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0 ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep ); // $ExpectError + gjoinBetween.ndarray( x.length, '', '', x, 1, 0, sep, 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/examples/index.js new file mode 100644 index 000000000000..36b17ff752d8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/examples/index.js @@ -0,0 +1,32 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 filled = require( '@stdlib/array/base/filled' ); +var gjoinBetween = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +var sep = filled( ' | ', x.length - 1 ); +var out = gjoinBetween( x.length, '[ ', ' ]', x, 1, sep, 1 ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/accessors.js new file mode 100644 index 000000000000..13bcf0bc43ba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/accessors.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); + + +// MAIN // + +/** +* Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. +* +* @private +* @param {PositiveInteger} N - number of indexed elements +* @param {string} prefix - string to prepend to the output string +* @param {string} suffix - string to append to the output string +* @param {Object} x - input array object +* @param {Collection} x.data - input array data +* @param {Array} x.accessors - array element accessors +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Object} separators - separators array object +* @param {Collection} separators.data - separators array data +* @param {Array} separators.accessors - array element accessors +* @param {integer} strideS - stride length for `separators` +* @param {NonNegativeInteger} offsetS - starting index for `separators` +* @returns {string} joined string +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var out = gjoinBetween( x.length, 'op: ', '', arraylike2object( toAccessorArray( x ) ), 1, 0, arraylike2object( toAccessorArray( sep ) ), 1, 0 ); +* // returns 'op: 1 + 2 - 3 != 4' +*/ +function gjoinBetween( N, prefix, suffix, x, strideX, offsetX, separators, strideS, offsetS ) { // eslint-disable-line max-len + var sbuf; + var xbuf; + var sget; + var xget; + var out; + var ix; + var is; + var v; + var i; + + // Cache references to array data: + xbuf = x.data; + sbuf = separators.data; + + // Cache references to element accessors: + xget = x.accessors[ 0 ]; + sget = separators.accessors[ 0 ]; + + out = prefix; + ix = offsetX; + is = offsetS; + for ( i = 0; i < N; i++ ) { + if ( i > 0 ) { + out += sget( sbuf, is ); + is += strideS; + } + v = xget( xbuf, ix ); + if ( !isUndefinedOrNull( v ) ) { + out += String( v ); + } + ix += strideX; + } + out += suffix; + return out; +} + + +// EXPORTS // + +module.exports = gjoinBetween; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/index.js new file mode 100644 index 000000000000..9856f63bc7ce --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/index.js @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return a string by joining strided array elements using a specified separator for each pair of consecutive elements. +* +* @module @stdlib/blas/ext/base/gjoin-between +* +* @example +* var gjoinBetween = require( '@stdlib/blas/ext/base/gjoin-between' ); +* +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var str = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); +* // returns 'op: 1 + 2 - 3 != 4' +* +* @example +* var gjoinBetween = require( '@stdlib/blas/ext/base/gjoin-between' ); +* +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var str = gjoinBetween.ndarray( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); +* // returns 'op: 1 + 2 - 3 != 4' +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/main.js new file mode 100644 index 000000000000..d79117f975e7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/main.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {string} prefix - string to prepend to the output string +* @param {string} suffix - string to append to the output string +* @param {Collection} x - input array +* @param {integer} strideX - stride length for `x` +* @param {Collection} separators - separators array +* @param {integer} strideS - stride length for `separators` +* @returns {string} joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var out = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); +* // returns 'op: 1 + 2 - 3 != 4' +*/ +function gjoinBetween( N, prefix, suffix, x, strideX, separators, strideS ) { + var ox; + var os; + + ox = stride2offset( N, strideX ); + os = stride2offset( N - 1, strideS ); + return ndarray( N, prefix, suffix, x, strideX, ox, separators, strideS, os ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = gjoinBetween; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/ndarray.js new file mode 100644 index 000000000000..bfc0ae6379e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/lib/ndarray.js @@ -0,0 +1,89 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' ); +var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var accessors = require( './accessors.js' ); + + +// MAIN // + +/** +* Returns a string by joining strided array elements using a specified separator for each pair of consecutive elements and alternative indexing semantics. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {string} prefix - string to prepend to the output string +* @param {string} suffix - string to append to the output string +* @param {Collection} x - input array +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Collection} separators - separators array +* @param {integer} strideS - stride length for `separators` +* @param {NonNegativeInteger} offsetS - starting index for `separators` +* @returns {string} joined string +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* var sep = [ ' + ', ' - ', ' != ' ]; +* +* var out = gjoinBetween( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); +* // returns 'op: 1 + 2 - 3 != 4' +*/ +function gjoinBetween( N, prefix, suffix, x, strideX, offsetX, separators, strideS, offsetS ) { // eslint-disable-line max-len + var out; + var ox; + var os; + var ix; + var is; + var v; + var i; + + if ( N <= 0 ) { + return prefix + suffix; + } + ox = arraylike2object( x ); + os = arraylike2object( separators ); + if ( ox.accessorProtocol || os.accessorProtocol ) { + return accessors( N, prefix, suffix, ox, strideX, offsetX, os, strideS, offsetS ); // eslint-disable-line max-len + } + out = prefix; + ix = offsetX; + is = offsetS; + for ( i = 0; i < N; i++ ) { + if ( i > 0 ) { + out += separators[ is ]; + is += strideS; + } + v = x[ ix ]; + if ( !isUndefinedOrNull( v ) ) { + out += String( v ); + } + ix += strideX; + } + out += suffix; + return out; +} + + +// EXPORTS // + +module.exports = gjoinBetween; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/package.json b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/package.json new file mode 100644 index 000000000000..1249ba9d7bc9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/package.json @@ -0,0 +1,63 @@ +{ + "name": "@stdlib/blas/ext/base/gjoin-between", + "version": "0.0.0", + "description": "Return a string by joining strided array elements using a specified separator for each pair of consecutive elements.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "blas", + "extended", + "join", + "string", + "strided", + "array", + "ndarray", + "separator" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.js new file mode 100644 index 000000000000..72a0fa647b80 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 gjoinBetween = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gjoinBetween, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof gjoinBetween.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.main.js new file mode 100644 index 000000000000..502dcd817bcd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.main.js @@ -0,0 +1,156 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gjoinBetween = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gjoinBetween, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 7', function test( t ) { + t.strictEqual( gjoinBetween.length, 7, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns the prefix and suffix joined together if provided an `N` parameter less than or equal to zero', function test( t ) { + var actual; + + actual = gjoinBetween( 0, 'a', 'b', [ 1, 2, 3 ], 1, [ ',', ',' ], 1 ); + t.strictEqual( actual, 'ab', 'returns expected value' ); + + actual = gjoinBetween( -1, 'a', 'b', [ 1, 2, 3 ], 1, [ ',', ',' ], 1 ); + t.strictEqual( actual, 'ab', 'returns expected value' ); + + actual = gjoinBetween( 0, '', '', [ 1, 2, 3 ], 1, [ ',', ',' ], 1 ); + t.strictEqual( actual, '', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements using specified separators', function test( t ) { + var actual; + var sep; + var x; + + x = [ 1, 2, 3, 4 ]; + sep = [ ' + ', ' - ', ' != ' ]; + + // Basic usage with prefix... + actual = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); + t.strictEqual( actual, 'op: 1 + 2 - 3 != 4', 'returns expected value' ); + + // With suffix... + actual = gjoinBetween( x.length, '[', ']', x, 1, sep, 1 ); + t.strictEqual( actual, '[1 + 2 - 3 != 4]', 'returns expected value' ); + + // Without prefix or suffix... + actual = gjoinBetween( x.length, '', '', x, 1, sep, 1 ); + t.strictEqual( actual, '1 + 2 - 3 != 4', 'returns expected value' ); + + // Single element... + actual = gjoinBetween( 1, '<', '>', x, 1, sep, 1 ); + t.strictEqual( actual, '<1>', 'returns expected value' ); + + // Nonnegative stride for x and separators... + x = [ 1, 2, 3, 4, 5, 6 ]; + sep = [ ',', 'a', '-', 'b' ]; + actual = gjoinBetween( 3, '', '', x, 2, sep, 2 ); + t.strictEqual( actual, '1,3-5', 'returns expected value' ); + + // Negative stride for x... + x = [ 1, 2, 3, 4, 5, 6 ]; + sep = [ ',', '-', '|', '~', '=' ]; + actual = gjoinBetween( x.length, '', '', x, -1, sep, 1 ); + t.strictEqual( actual, '6,5-4|3~2=1', 'returns expected value' ); + + // Negative stride for separators... + x = [ 1, 2, 3, 4 ]; + sep = [ ' + ', ' - ', ' != ' ]; + actual = gjoinBetween( x.length, '', '', x, 1, sep, -1 ); + t.strictEqual( actual, '1 != 2 - 3 + 4', 'returns expected value' ); + + // Null and undefined values... + x = [ 1, null, 3, undefined, 5 ]; + sep = [ ',', ',', ',', ',' ]; + actual = gjoinBetween( x.length, '', '', x, 1, sep, 1 ); + t.strictEqual( actual, '1,,3,,5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements using specified separators (accessors)', function test( t ) { + var actual; + var sep; + var x; + + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + sep = toAccessorArray( [ ' + ', ' - ', ' != ' ] ); + + // Basic usage with prefix... + actual = gjoinBetween( x.length, 'op: ', '', x, 1, sep, 1 ); + t.strictEqual( actual, 'op: 1 + 2 - 3 != 4', 'returns expected value' ); + + // With suffix... + actual = gjoinBetween( x.length, '[', ']', x, 1, sep, 1 ); + t.strictEqual( actual, '[1 + 2 - 3 != 4]', 'returns expected value' ); + + // Without prefix or suffix... + actual = gjoinBetween( x.length, '', '', x, 1, sep, 1 ); + t.strictEqual( actual, '1 + 2 - 3 != 4', 'returns expected value' ); + + // Single element... + actual = gjoinBetween( 1, '<', '>', x, 1, sep, 1 ); + t.strictEqual( actual, '<1>', 'returns expected value' ); + + // Nonnegative stride for x and separators... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + sep = toAccessorArray( [ ',', 'a', '-', 'b' ] ); + actual = gjoinBetween( 3, '', '', x, 2, sep, 2 ); + t.strictEqual( actual, '1,3-5', 'returns expected value' ); + + // Negative stride for x... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + sep = toAccessorArray( [ ',', '-', '|', '~', '=' ] ); + actual = gjoinBetween( x.length, '', '', x, -1, sep, 1 ); + t.strictEqual( actual, '6,5-4|3~2=1', 'returns expected value' ); + + // Negative stride for separators... + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + sep = toAccessorArray( [ ' + ', ' - ', ' != ' ] ); + actual = gjoinBetween( x.length, '', '', x, 1, sep, -1 ); + t.strictEqual( actual, '1 != 2 - 3 + 4', 'returns expected value' ); + + // Null and undefined values... + x = toAccessorArray( [ 1, null, 3, undefined, 5 ] ); + sep = toAccessorArray( [ ',', ',', ',', ',' ] ); + actual = gjoinBetween( x.length, '', '', x, 1, sep, 1 ); + t.strictEqual( actual, '1,,3,,5', 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.ndarray.js new file mode 100644 index 000000000000..3d84f09d9d89 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gjoin-between/test/test.ndarray.js @@ -0,0 +1,168 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gjoinBetween = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gjoinBetween, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( gjoinBetween.length, 9, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns the prefix and suffix joined together if provided an `N` parameter less than or equal to zero', function test( t ) { + var actual; + + actual = gjoinBetween( 0, 'a', 'b', [ 1, 2, 3 ], 1, 0, [ ',', ',' ], 1, 0 ); + t.strictEqual( actual, 'ab', 'returns expected value' ); + + actual = gjoinBetween( -1, 'a', 'b', [ 1, 2, 3 ], 1, 0, [ ',', ',' ], 1, 0 ); + t.strictEqual( actual, 'ab', 'returns expected value' ); + + actual = gjoinBetween( 0, '', '', [ 1, 2, 3 ], 1, 0, [ ',', ',' ], 1, 0 ); + t.strictEqual( actual, '', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements using specified separators', function test( t ) { + var actual; + var sep; + var x; + + x = [ 1, 2, 3, 4 ]; + sep = [ ' + ', ' - ', ' != ' ]; + + // Basic usage... + actual = gjoinBetween( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, 'op: 1 + 2 - 3 != 4', 'returns expected value' ); + + // With suffix... + actual = gjoinBetween( x.length, '[', ']', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '[1 + 2 - 3 != 4]', 'returns expected value' ); + + // Without prefix or suffix... + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '1 + 2 - 3 != 4', 'returns expected value' ); + + // Single element... + actual = gjoinBetween( 1, '<', '>', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '<1>', 'returns expected value' ); + + // With offset for x and separators... + x = [ 1, 2, 3, 4, 5, 6 ]; + sep = [ 'a', ',', '-' ]; + actual = gjoinBetween( 3, '', '', x, 1, 1, sep, 1, 1 ); + t.strictEqual( actual, '2,3-4', 'returns expected value' ); + + // Nonnegative stride for x and separators... + x = [ 1, 2, 3, 4, 5, 6 ]; + sep = [ ',', 'a', '-', 'b' ]; + actual = gjoinBetween( 3, '', '', x, 2, 0, sep, 2, 0 ); + t.strictEqual( actual, '1,3-5', 'returns expected value' ); + + // Negative stride for x... + x = [ 1, 2, 3, 4, 5, 6 ]; + sep = [ ',', '-', '|', '~', '=' ]; + actual = gjoinBetween( x.length, '', '', x, -1, x.length-1, sep, 1, 0 ); + t.strictEqual( actual, '6,5-4|3~2=1', 'returns expected value' ); + + // Negative stride for separators... + x = [ 1, 2, 3, 4 ]; + sep = [ ' + ', ' - ', ' != ' ]; + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, -1, sep.length-1 ); + t.strictEqual( actual, '1 != 2 - 3 + 4', 'returns expected value' ); + + // Null and undefined values... + x = [ 1, null, 3, undefined, 5 ]; + sep = [ ',', ',', ',', ',' ]; + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '1,,3,,5', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a string created by joining strided array elements using specified separators (accessors)', function test( t ) { + var actual; + var sep; + var x; + + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + sep = toAccessorArray( [ ' + ', ' - ', ' != ' ] ); + + // Basic usage... + actual = gjoinBetween( x.length, 'op: ', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, 'op: 1 + 2 - 3 != 4', 'returns expected value' ); + + // With suffix... + actual = gjoinBetween( x.length, '[', ']', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '[1 + 2 - 3 != 4]', 'returns expected value' ); + + // Without prefix or suffix... + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '1 + 2 - 3 != 4', 'returns expected value' ); + + // Single element... + actual = gjoinBetween( 1, '<', '>', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '<1>', 'returns expected value' ); + + // With offset for x and separators... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + sep = toAccessorArray( [ 'a', ',', '-' ] ); + actual = gjoinBetween( 3, '', '', x, 1, 1, sep, 1, 1 ); + t.strictEqual( actual, '2,3-4', 'returns expected value' ); + + // Nonnegative stride for x and separators... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + sep = toAccessorArray( [ ',', 'a', '-', 'b' ] ); + actual = gjoinBetween( 3, '', '', x, 2, 0, sep, 2, 0 ); + t.strictEqual( actual, '1,3-5', 'returns expected value' ); + + // Negative stride for x... + x = toAccessorArray( [ 1, 2, 3, 4, 5, 6 ] ); + sep = toAccessorArray( [ ',', '-', '|', '~', '=' ] ); + actual = gjoinBetween( x.length, '', '', x, -1, x.length-1, sep, 1, 0 ); + t.strictEqual( actual, '6,5-4|3~2=1', 'returns expected value' ); + + // Negative stride for separators... + x = toAccessorArray( [ 1, 2, 3, 4 ] ); + sep = toAccessorArray( [ ' + ', ' - ', ' != ' ] ); + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, -1, sep.length-1 ); + t.strictEqual( actual, '1 != 2 - 3 + 4', 'returns expected value' ); + + // Null and undefined values... + x = toAccessorArray( [ 1, null, 3, undefined, 5 ] ); + sep = toAccessorArray( [ ',', ',', ',', ',' ] ); + actual = gjoinBetween( x.length, '', '', x, 1, 0, sep, 1, 0 ); + t.strictEqual( actual, '1,,3,,5', 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.js index b782b7106100..d781ee20f4d6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var glastIndexOf = require( './../lib' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.ndarray.js index 889cb5b1d0ad..6b7f3f9c0091 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/glast-index-of/benchmark/benchmark.ndarray.js @@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; var oneTo = require( '@stdlib/array/one-to' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var glastIndexOf = require( './../lib/ndarray.js' ); @@ -89,7 +90,7 @@ function main() { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.js index cb4737bc52d7..6eb7f00f1aad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.js @@ -77,6 +77,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.ndarray.js index 17c79091ed6d..6dec7d9441bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/glinspace/benchmark/benchmark.ndarray.js @@ -77,6 +77,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.js index 71f134279ffc..7160fd65abf3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var zeros = require( '@stdlib/array/base/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gnannsumkbn = require( './../lib/main.js' ); @@ -104,7 +105,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.ndarray.js index 75516d27168e..73ce07e9fb9f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.ndarray.js @@ -27,6 +27,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var zeros = require( '@stdlib/array/base/zeros' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var gnannsumkbn = require( './../lib/ndarray.js' ); @@ -104,7 +105,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/package.json b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/package.json index 3038c2d918c5..a3948dde7f0b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/package.json @@ -14,7 +14,6 @@ } ], "main": "./lib", - "browser": "./lib/main.js", "directories": { "benchmark": "./benchmark", "doc": "./docs", diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/examples/index.js index 1b2d1e1d5df2..9dbc9bcdbcc4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn/examples/index.js @@ -21,7 +21,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var bernoulli = require( '@stdlib/random/base/bernoulli' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); -var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' ); +var gnansumkbn = require( './../lib' ); function rand() { if ( bernoulli( 0.7 ) > 0 ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/examples/index.js index fadc6162a5f0..b456d8be0868 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gnansumkbn2/examples/index.js @@ -21,7 +21,7 @@ var bernoulli = require( '@stdlib/random/base/bernoulli' ); var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); -var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' ); +var gnansumkbn2 = require( './../lib' ); function rand() { if ( bernoulli( 0.8 ) > 0 ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/gone-to/README.md new file mode 100644 index 000000000000..77a023a5d9aa --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/README.md @@ -0,0 +1,160 @@ + + +# goneTo + +> Fill a strided array with linearly spaced numeric elements which increment by `1` starting from one. + +
+ +## Usage + +```javascript +var goneTo = require( '@stdlib/blas/ext/base/gone-to' ); +``` + +#### goneTo( N, x, strideX ) + +Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. + +```javascript +var x = [ 0.0, 0.0, 0.0, 0.0 ]; + +goneTo( x.length, x, 1 ); +// x => [ 1.0, 2.0, 3.0, 4.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input array. +- **strideX**: stride length. + +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element: + +```javascript +var x = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + +goneTo( 3, x, 2 ); +// x => [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array... +var x0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + +// Create an offset view... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Fill every other element... +goneTo( 3, x1, 2 ); +// x0 => [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] +``` + +#### goneTo.ndarray( N, x, strideX, offsetX ) + +Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + +```javascript +var x = [ 0.0, 0.0, 0.0, 0.0 ]; + +goneTo.ndarray( x.length, x, 1, 0 ); +// x => [ 1.0, 2.0, 3.0, 4.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements: + +```javascript +var x = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + +goneTo.ndarray( 3, x, 1, x.length-3 ); +// x => [ 0.0, 0.0, 0.0, 1.0, 2.0, 3.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `x` unchanged. +- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/complex64`][@stdlib/array/complex64]). +- Depending on the environment, the typed versions ([`doneTo`][@stdlib/blas/ext/base/done-to], [`soneTo`][@stdlib/blas/ext/base/sone-to], etc.) are likely to be significantly more performant. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var goneTo = require( '@stdlib/blas/ext/base/gone-to' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +goneTo( x.length, x, 1 ); +console.log( x ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.js new file mode 100644 index 000000000000..de696a1ffbef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var goneTo = require( './../lib/main.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100, 100, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = goneTo( x.length, x, 1 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..372128c64ed4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/benchmark/benchmark.ndarray.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var goneTo = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100, 100, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = goneTo( x.length, x, 1, 0 ); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/repl.txt new file mode 100644 index 000000000000..6d71baded2f6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/repl.txt @@ -0,0 +1,91 @@ + +{{alias}}( N, x, strideX ) + Fills a strided array with linearly spaced numeric elements which increment + by `1` starting from one. + + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `x` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: ArrayLikeObject + Input array. + + strideX: integer + Stride length. + + Returns + ------- + x: ArrayLikeObject + Input array. + + Examples + -------- + // Standard Usage: + > var x = [ 0.0, 0.0, 0.0, 0.0 ]; + > {{alias}}( x.length, x, 1 ) + [ 1.0, 2.0, 3.0, 4.0 ] + + // Using `N` and stride parameters: + > x = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + > {{alias}}( 3, x, 2 ) + [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] + + // Using view offsets: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 3, x1, 2 ) + [ 1.0, 0.0, 2.0, 0.0, 3.0 ] + > x0 + [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] + + +{{alias}}.ndarray( N, x, strideX, offsetX ) + Fills a strided array with linearly spaced numeric elements which increment + by `1` starting from one using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: ArrayLikeObject + Input array. + + strideX: integer + Stride length. + + offsetX: integer + Starting index. + + Returns + ------- + x: ArrayLikeObject + Input array. + + Examples + -------- + // Standard Usage: + > var x = [ 0.0, 0.0, 0.0, 0.0 ]; + > {{alias}}.ndarray( x.length, x, 1, 0 ) + [ 1.0, 2.0, 3.0, 4.0 ] + + // Using an index offset: + > x = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + > {{alias}}.ndarray( 3, x, 2, 1 ) + [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/index.d.ts new file mode 100644 index 000000000000..be169b7d480c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/index.d.ts @@ -0,0 +1,93 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Collection, AccessorArrayLike } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = Collection | AccessorArrayLike; + +/** +* Interface describing `goneTo`. +*/ +interface Routine { + /** + * Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @returns input array + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * goneTo( x.length, x, 1 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + = InputArray>( N: number, x: U, strideX: number ): U; + + /** + * Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param strideX - stride length + * @param offsetX - starting index + * @returns input array + * + * @example + * var x = [ 0.0, 0.0, 0.0, 0.0 ]; + * + * goneTo.ndarray( x.length, x, 1, 0 ); + * // x => [ 1.0, 2.0, 3.0, 4.0 ] + */ + ndarray = InputArray>( N: number, x: U, strideX: number, offsetX: number ): U; +} + +/** +* Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param N - number of indexed elements +* @param x - input array +* @param strideX - stride length +* @returns input array +* +* @example +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +declare var goneTo: Routine; + + +// EXPORTS // + +export = goneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/test.ts new file mode 100644 index 000000000000..5104996dfb84 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/docs/types/test.ts @@ -0,0 +1,151 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 goneTo = require( './index' ); + + +// TESTS // + +// The function returns a collection... +{ + const x = new Float64Array( 10 ); + + goneTo( x.length, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + goneTo( '10', x, 1 ); // $ExpectError + goneTo( true, x, 1 ); // $ExpectError + goneTo( false, x, 1 ); // $ExpectError + goneTo( null, x, 1 ); // $ExpectError + goneTo( undefined, x, 1 ); // $ExpectError + goneTo( [], x, 1 ); // $ExpectError + goneTo( {}, x, 1 ); // $ExpectError + goneTo( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a collection... +{ + const x = new Float64Array( 10 ); + + goneTo( x.length, 10, 1 ); // $ExpectError + goneTo( x.length, true, 1 ); // $ExpectError + goneTo( x.length, false, 1 ); // $ExpectError + goneTo( x.length, null, 1 ); // $ExpectError + goneTo( x.length, undefined, 1 ); // $ExpectError + goneTo( x.length, {}, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + goneTo( x.length, x, '10' ); // $ExpectError + goneTo( x.length, x, true ); // $ExpectError + goneTo( x.length, x, false ); // $ExpectError + goneTo( x.length, x, null ); // $ExpectError + goneTo( x.length, x, undefined ); // $ExpectError + goneTo( x.length, x, [] ); // $ExpectError + goneTo( x.length, x, {} ); // $ExpectError + goneTo( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + goneTo(); // $ExpectError + goneTo( x.length ); // $ExpectError + goneTo( x.length, x ); // $ExpectError + goneTo( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a collection... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray( x.length, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray( '10', x, 1, 0 ); // $ExpectError + goneTo.ndarray( true, x, 1, 0 ); // $ExpectError + goneTo.ndarray( false, x, 1, 0 ); // $ExpectError + goneTo.ndarray( null, x, 1, 0 ); // $ExpectError + goneTo.ndarray( undefined, x, 1, 0 ); // $ExpectError + goneTo.ndarray( [], x, 1, 0 ); // $ExpectError + goneTo.ndarray( {}, x, 1, 0 ); // $ExpectError + goneTo.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a collection... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray( x.length, 10, 1, 0 ); // $ExpectError + goneTo.ndarray( x.length, true, 1, 0 ); // $ExpectError + goneTo.ndarray( x.length, false, 1, 0 ); // $ExpectError + goneTo.ndarray( x.length, null, 1, 0 ); // $ExpectError + goneTo.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + goneTo.ndarray( x.length, {}, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray( x.length, x, '10', 0 ); // $ExpectError + goneTo.ndarray( x.length, x, true, 0 ); // $ExpectError + goneTo.ndarray( x.length, x, false, 0 ); // $ExpectError + goneTo.ndarray( x.length, x, null, 0 ); // $ExpectError + goneTo.ndarray( x.length, x, undefined, 0 ); // $ExpectError + goneTo.ndarray( x.length, x, [], 0 ); // $ExpectError + goneTo.ndarray( x.length, x, {}, 0 ); // $ExpectError + goneTo.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray( x.length, x, 1, '10' ); // $ExpectError + goneTo.ndarray( x.length, x, 1, true ); // $ExpectError + goneTo.ndarray( x.length, x, 1, false ); // $ExpectError + goneTo.ndarray( x.length, x, 1, null ); // $ExpectError + goneTo.ndarray( x.length, x, 1, undefined ); // $ExpectError + goneTo.ndarray( x.length, x, 1, [] ); // $ExpectError + goneTo.ndarray( x.length, x, 1, {} ); // $ExpectError + goneTo.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + + goneTo.ndarray(); // $ExpectError + goneTo.ndarray( x.length ); // $ExpectError + goneTo.ndarray( x.length, x ); // $ExpectError + goneTo.ndarray( x.length, x, 1 ); // $ExpectError + goneTo.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/examples/index.js new file mode 100644 index 000000000000..fec4a0cb157c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 goneTo = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'generic' +}); +console.log( x ); + +goneTo( x.length, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/accessors.js new file mode 100644 index 000000000000..66eb2d936cf0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/accessors.js @@ -0,0 +1,72 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 // + +/** +* Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @private +* @param {PositiveInteger} N - number of indexed elements +* @param {Object} x - input array object +* @param {Collection} x.data - input array data +* @param {Array} x.accessors - array element accessors +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Object} input array object +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var x = toAccessorArray( [ 0.0, 0.0, 0.0, 0.0 ] ); +* +* goneTo( 4, arraylike2object( x ), 1, 0 ); +* +* var v = x.get( 0 ); +* // returns 1.0 +* +* v = x.get( 1 ); +* // returns 2.0 +*/ +function goneTo( N, x, strideX, offsetX ) { + var xbuf; + var set; + var ix; + var i; + + // Cache reference to array data: + xbuf = x.data; + + // Cache a reference to the element accessor: + set = x.accessors[ 1 ]; + + ix = offsetX; + for ( i = 1; i <= N; i++ ) { + set( xbuf, ix, i ); + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = goneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/index.js new file mode 100644 index 000000000000..89c5d17e9365 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/index.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @module @stdlib/blas/ext/base/gone-to +* +* @example +* var goneTo = require( '@stdlib/blas/ext/base/gone-to' ); +* +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +* +* @example +* var goneTo = require( '@stdlib/blas/ext/base/gone-to' ); +* +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo.ndarray( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/main.js new file mode 100644 index 000000000000..82b934a97665 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/main.js @@ -0,0 +1,50 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @returns {Collection} input array +* +* @example +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo( x.length, x, 1 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function goneTo( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); +} + + +// EXPORTS // + +module.exports = goneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/ndarray.js new file mode 100644 index 000000000000..5527903291ef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/lib/ndarray.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var accessors = require( './accessors.js' ); + + +// MAIN // + +/** +* Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Collection} x - input array +* @param {integer} strideX - stride length +* @param {NonNegativeInteger} offsetX - starting index +* @returns {Collection} input array +* +* @example +* var x = [ 0.0, 0.0, 0.0, 0.0 ]; +* +* goneTo( x.length, x, 1, 0 ); +* // x => [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function goneTo( N, x, strideX, offsetX ) { + var ix; + var o; + var i; + + if ( N <= 0 ) { + return x; + } + o = arraylike2object( x ); + if ( o.accessorProtocol ) { + accessors( N, o, strideX, offsetX ); + return x; + } + ix = offsetX; + for ( i = 1; i <= N; i++ ) { + x[ ix ] = i; + ix += strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = goneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/gone-to/package.json new file mode 100644 index 000000000000..bb39d285c69d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/package.json @@ -0,0 +1,70 @@ +{ + "name": "@stdlib/blas/ext/base/gone-to", + "version": "0.0.0", + "description": "Fill a strided array with linearly spaced numeric elements which increment by `1` starting from one.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "assign", + "set", + "one-to", + "oneto", + "sequence", + "seq", + "strided", + "array", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.js new file mode 100644 index 000000000000..ec3cdc79a9a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 goneTo = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof goneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof goneTo.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.main.js new file mode 100644 index 000000000000..1899883ce356 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.main.js @@ -0,0 +1,253 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 goneTo = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof goneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( goneTo.length, 3, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + out = goneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array (accessors)', function test( t ) { + var out; + var x; + + x = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = goneTo( x.length, x, 1 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = [ 3.0, -4.0, 1.0 ]; + expected = [ 3.0, -4.0, 1.0 ]; + + goneTo( 0, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + goneTo( -4, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = [ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]; + expected = [ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]; + + goneTo( x.length, x, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ 4.0, 2.0, -3.0, 5.0 ]; + x = toAccessorArray( xbuf ); + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + goneTo( x.length, x, 1 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = [ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]; + expected = [ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]; + + goneTo( 3, x, 2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a stride (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]; + x = toAccessorArray( xbuf ); + expected = [ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]; + + goneTo( 3, x, 2 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = [ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]; + expected = [ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]; + + goneTo( 3, x, -2 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]; + x = toAccessorArray( xbuf ); + expected = [ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]; + + goneTo( 3, x, -2 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var x1; + + x0 = new Float64Array([ + 1.0, + 2.0, // 0 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 2 + ]); + expected = new Float64Array([ + 1.0, + 1.0, // 0 + 3.0, + 2.0, // 1 + 5.0, + 3.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + + goneTo( 3, x1, 2 ); + t.deepEqual( x0, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.ndarray.js new file mode 100644 index 000000000000..1774624bdba2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gone-to/test/test.ndarray.js @@ -0,0 +1,277 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var goneTo = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof goneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( goneTo.length, 4, 'has expected arity' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array', function test( t ) { + var out; + var x; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + out = goneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'the function returns a reference to the input array (accessors)', function test( t ) { + var out; + var x; + + x = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + out = goneTo( x.length, x, 1, 0 ); + + t.strictEqual( out, x, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { + var expected; + var x; + + x = [ 3.0, -4.0, 1.0 ]; + expected = [ 3.0, -4.0, 1.0 ]; + + goneTo( 0, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + goneTo( -4, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array', function test( t ) { + var expected; + var x; + + x = [ + 4.0, + 2.0, + -3.0, + 5.0, + -1.0, + 2.0, + -5.0, + 6.0 + ]; + expected = [ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 7.0, + 8.0 + ]; + + goneTo( x.length, x, 1, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a strided array (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ 4.0, 2.0, -3.0, 5.0 ]; + x = toAccessorArray( xbuf ); + expected = [ 1.0, 2.0, 3.0, 4.0 ]; + + goneTo( x.length, x, 1, 0 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var x; + + x = [ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]; + expected = [ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]; + + goneTo( 3, x, 2, 0 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a stride (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ + 2.0, // 0 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 2 + ]; + x = toAccessorArray( xbuf ); + expected = [ + 1.0, // 0 + -3.0, + 2.0, // 1 + 7.0, + 3.0 // 2 + ]; + + goneTo( 3, x, 2, 0 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var x; + + x = [ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]; + expected = [ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]; + + goneTo( 3, x, -2, x.length-1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ + 2.0, // 2 + -3.0, + -5.0, // 1 + 7.0, + 6.0 // 0 + ]; + x = toAccessorArray( xbuf ); + expected = [ + 3.0, // 2 + -3.0, + 2.0, // 1 + 7.0, + 1.0 // 0 + ]; + + goneTo( 3, x, -2, x.length-1 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter', function test( t ) { + var expected; + var x; + + x = [ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]; + expected = [ + 1.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 6.0, + 7.0 + ]; + + goneTo( 3, x, 1, 1 ); + t.deepEqual( x, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an offset parameter (accessors)', function test( t ) { + var expected; + var xbuf; + var x; + + xbuf = [ + 1.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 6.0, + 7.0 + ]; + x = toAccessorArray( xbuf ); + expected = [ + 1.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 6.0, + 7.0 + ]; + + goneTo( 3, x, 1, 1 ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.js index 74f7c354e310..9e985df98d1a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.js @@ -72,6 +72,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.ndarray.js index c19d603eaf81..3ee5a5913d6b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/grev/benchmark/benchmark.ndarray.js @@ -72,6 +72,11 @@ function createBenchmark( len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var len; var min; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.js b/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.js index b0cd680e6657..96c44b2be7ca 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.js @@ -88,6 +88,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.ndarray.js index dd2df8f7f178..6117388ac215 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort/benchmark/benchmark.unsorted_random.ndarray.js @@ -88,6 +88,11 @@ function createBenchmark( iter, len ) { // MAIN // +/** +* Main execution sequence. +* +* @private +*/ function main() { var opts; var iter; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md b/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md index 8e729c75540d..18ff5d93b8ff 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gsort2hp/README.md @@ -192,6 +192,8 @@ console.log( y ); + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/README.md new file mode 100644 index 000000000000..f4eca5937a8b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/README.md @@ -0,0 +1,110 @@ + + +# coneTo + +> Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. + +
+ +
+ + + +
+ +## Usage + +```javascript +var coneTo = require( '@stdlib/blas/ext/base/ndarray/cone-to' ); +``` + +#### coneTo( arrays ) + +Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + +var out = coneTo( [ x ] ); +// returns [ [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ], [ 4.0, 0.0 ] ] +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +## Notes + +- The input ndarray is modified **in-place** (i.e., the input ndarray is **mutated**). + +
+ + + +
+ +## Examples + + + +```javascript +var zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var coneTo = require( '@stdlib/blas/ext/base/ndarray/cone-to' ); + +var xbuf = zeros( 10, 'complex64' ); +var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +coneTo( [ x ] ); +console.log( ndarray2array( x ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/benchmark/benchmark.js new file mode 100644 index 000000000000..673e390818ea --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var pkg = require( './../package.json' ).name; +var coneTo = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'complex64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = zeros( len, options.dtype ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + 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 = coneTo( [ x ] ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/repl.txt new file mode 100644 index 000000000000..c6a976c28d44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Fills a one-dimensional single-precision complex floating-point ndarray with + linearly spaced numeric elements which increment by `1` starting from one. + + The input ndarray is modified *in-place* (i.e., the input ndarray is + *mutated*). + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > var dt = 'complex64'; + > var sh = [ 2 ]; + > var sx = [ 1 ]; + > var ox = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); + > {{alias}}( [ x ] ) + [ [ 1.0, 0.0 ], [ 2.0, 0.0 ] ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/index.d.ts new file mode 100644 index 000000000000..f4b37e6b4393 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/index.d.ts @@ -0,0 +1,46 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { complex64ndarray } from '@stdlib/types/ndarray'; + +/** +* Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns input ndarray +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = coneTo( [ x ] ); +* // returns [ [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ], [ 4.0, 0.0 ] ] +*/ +declare function coneTo( arrays: [ complex64ndarray ] ): complex64ndarray; + + +// EXPORTS // + +export = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/test.ts new file mode 100644 index 000000000000..0694d73a36d9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import coneTo = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const x = zeros( [ 10 ], { + 'dtype': 'complex64' + }); + + coneTo( [ x ] ); // $ExpectType complex64ndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + coneTo( '10' ); // $ExpectError + coneTo( 10 ); // $ExpectError + coneTo( true ); // $ExpectError + coneTo( false ); // $ExpectError + coneTo( null ); // $ExpectError + coneTo( undefined ); // $ExpectError + coneTo( [] ); // $ExpectError + coneTo( {} ); // $ExpectError + coneTo( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'complex64' + }); + + coneTo(); // $ExpectError + coneTo( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/examples/index.js new file mode 100644 index 000000000000..825bd3d14112 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/examples/index.js @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var coneTo = require( './../lib' ); + +var xbuf = zeros( 10, 'complex64' ); +var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +coneTo( [ x ] ); +console.log( ndarray2array( x ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/index.js new file mode 100644 index 000000000000..bfeba8135238 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/index.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @module @stdlib/blas/ext/base/ndarray/cone-to +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var coneTo = require( '@stdlib/blas/ext/base/ndarray/cone-to' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = coneTo( [ x ] ); +* // returns [ [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ], [ 4.0, 0.0 ] ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/main.js new file mode 100644 index 000000000000..e053e2cea257 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/lib/main.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/cone-to' ).ndarray; + + +// MAIN // + +/** +* Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {ndarray} input ndarray +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = coneTo( [ x ] ); +* // returns [ [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ], [ 4.0, 0.0 ] ] +*/ +function coneTo( arrays ) { + var x = arrays[ 0 ]; + strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len + return x; +} + + +// EXPORTS // + +module.exports = coneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/package.json new file mode 100644 index 000000000000..755055e0857c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/cone-to", + "version": "0.0.0", + "description": "Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by 1 starting from one.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "one", + "oneto", + "one-to", + "linearly", + "spaced", + "increment", + "strided", + "array", + "ndarray", + "complex64", + "complex", + "single-precision", + "float32" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/test/test.js new file mode 100644 index 000000000000..061b571a5d33 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/cone-to/test/test.js @@ -0,0 +1,290 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); +var coneTo = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Complex64Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'complex64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof coneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( coneTo.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray with linearly spaced numeric elements which increment by 1 starting from one', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 4, 1, 0 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the input ndarray is empty', function test( t ) { + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [] ); + x = vector( xbuf, 0, 1, 0 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.strictEqual( getData( actual ).length, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray containing a single element', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [ 5.0, 5.0 ] ); + x = vector( xbuf, 1, 1, 0 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array( [ 1.0, 0.0 ] ); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-unit stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 9.0, + 9.0, + 0.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 0.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 0.0, // 3 + 0.0, // 3 + 9.0, + 9.0 + ]); + x = vector( xbuf, 4, 2, 0 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 1.0, // 0 + 0.0, // 0 + 9.0, + 9.0, + 2.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 3.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 4.0, // 3 + 0.0, // 3 + 9.0, + 9.0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 0.0, // 4 + 0.0, // 4 + 0.0, // 3 + 0.0, // 3 + 0.0, // 2 + 0.0, // 2 + 0.0, // 1 + 0.0, // 1 + 0.0, // 0 + 0.0 // 0 + ]); + x = vector( xbuf, 5, -1, 4 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 5.0, // 4 + 0.0, // 4 + 4.0, // 3 + 0.0, // 3 + 3.0, // 2 + 0.0, // 2 + 2.0, // 1 + 0.0, // 1 + 1.0, // 0 + 0.0 // 0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 9.0, + 9.0, + 9.0, + 9.0, + 0.0, // 0 + 0.0, // 0 + 0.0, // 1 + 0.0, // 1 + 0.0, // 2 + 0.0, // 2 + 0.0, // 3 + 0.0 // 3 + ]); + x = vector( xbuf, 4, 1, 2 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 9.0, + 9.0, + 9.0, + 9.0, + 1.0, // 0 + 0.0, // 0 + 2.0, // 1 + 0.0, // 1 + 3.0, // 2 + 0.0, // 2 + 4.0, // 3 + 0.0 // 3 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride and non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 9.0, + 9.0, + 0.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 0.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 0.0, // 0 + 0.0 // 0 + ]); + x = vector( xbuf, 3, -2, 5 ); + + actual = coneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 9.0, + 9.0, + 3.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 2.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 1.0, // 0 + 0.0 // 0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/README.md new file mode 100644 index 000000000000..e567d514a645 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/README.md @@ -0,0 +1,110 @@ + + +# czeroTo + +> Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + +
+ +
+ + + +
+ +## Usage + +```javascript +var czeroTo = require( '@stdlib/blas/ext/base/ndarray/czero-to' ); +``` + +#### czeroTo( arrays ) + +Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + +var out = czeroTo( [ x ] ); +// returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +## Notes + +- The input ndarray is modified **in-place** (i.e., the input ndarray is **mutated**). + +
+ + + +
+ +## Examples + + + +```javascript +var zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var czeroTo = require( '@stdlib/blas/ext/base/ndarray/czero-to' ); + +var xbuf = zeros( 10, 'complex64' ); +var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +czeroTo( [ x ] ); +console.log( ndarray2array( x ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/benchmark/benchmark.js new file mode 100644 index 000000000000..104af47f5ceb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var pkg = require( './../package.json' ).name; +var czeroTo = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'complex64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = zeros( len, options.dtype ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + 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 = czeroTo( [ x ] ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/repl.txt new file mode 100644 index 000000000000..171f3e8144e1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Fills a one-dimensional single-precision complex floating-point ndarray with + linearly spaced numeric elements which increment by `1` starting from zero. + + The input ndarray is modified *in-place* (i.e., the input ndarray is + *mutated*). + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > var dt = 'complex64'; + > var sh = [ 2 ]; + > var sx = [ 1 ]; + > var ox = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); + > {{alias}}( [ x ] ) + [ [ 0.0, 0.0 ], [ 1.0, 0.0 ] ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/index.d.ts new file mode 100644 index 000000000000..08572bd7ee55 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/index.d.ts @@ -0,0 +1,46 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { complex64ndarray } from '@stdlib/types/ndarray'; + +/** +* Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns input ndarray +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = czeroTo( [ x ] ); +* // returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] +*/ +declare function czeroTo( arrays: [ complex64ndarray ] ): complex64ndarray; + + +// EXPORTS // + +export = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/test.ts new file mode 100644 index 000000000000..9ff9d7683f79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import czeroTo = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const x = zeros( [ 10 ], { + 'dtype': 'complex64' + }); + + czeroTo( [ x ] ); // $ExpectType complex64ndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + czeroTo( '10' ); // $ExpectError + czeroTo( 10 ); // $ExpectError + czeroTo( true ); // $ExpectError + czeroTo( false ); // $ExpectError + czeroTo( null ); // $ExpectError + czeroTo( undefined ); // $ExpectError + czeroTo( [] ); // $ExpectError + czeroTo( {} ); // $ExpectError + czeroTo( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'complex64' + }); + + czeroTo(); // $ExpectError + czeroTo( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/examples/index.js new file mode 100644 index 000000000000..9a8f6e60589f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/examples/index.js @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var czeroTo = require( './../lib' ); + +var xbuf = zeros( 10, 'complex64' ); +var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +czeroTo( [ x ] ); +console.log( ndarray2array( x ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/index.js new file mode 100644 index 000000000000..251e4bc50045 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/index.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @module @stdlib/blas/ext/base/ndarray/czero-to +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var czeroTo = require( '@stdlib/blas/ext/base/ndarray/czero-to' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = czeroTo( [ x ] ); +* // returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/main.js new file mode 100644 index 000000000000..7263e26a690d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/lib/main.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/czero-to' ).ndarray; + + +// MAIN // + +/** +* Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {ndarray} input ndarray +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var out = czeroTo( [ x ] ); +* // returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] +*/ +function czeroTo( arrays ) { + var x = arrays[ 0 ]; + strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len + return x; +} + + +// EXPORTS // + +module.exports = czeroTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/package.json new file mode 100644 index 000000000000..cfadff77bfb8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/czero-to", + "version": "0.0.0", + "description": "Fill a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by 1 starting from zero.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "zero", + "zeroto", + "zero-to", + "linearly", + "spaced", + "increment", + "strided", + "array", + "ndarray", + "complex64", + "complex", + "single-precision", + "float32" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/test/test.js new file mode 100644 index 000000000000..405a2c15576a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/czero-to/test/test.js @@ -0,0 +1,290 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); +var czeroTo = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Complex64Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'complex64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof czeroTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( czeroTo.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray with linearly spaced numeric elements which increment by 1 starting from zero', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 4, 1, 0 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] ); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the input ndarray is empty', function test( t ) { + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [] ); + x = vector( xbuf, 0, 1, 0 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.strictEqual( getData( actual ).length, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray containing a single element', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array( [ 5.0, 5.0 ] ); + x = vector( xbuf, 1, 1, 0 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array( [ 0.0, 0.0 ] ); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-unit stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 9.0, + 9.0, + 0.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 0.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 0.0, // 3 + 0.0, // 3 + 9.0, + 9.0 + ]); + x = vector( xbuf, 4, 2, 0 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 0.0, // 0 + 0.0, // 0 + 9.0, + 9.0, + 1.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 2.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 3.0, // 3 + 0.0, // 3 + 9.0, + 9.0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 0.0, // 4 + 0.0, // 4 + 0.0, // 3 + 0.0, // 3 + 0.0, // 2 + 0.0, // 2 + 0.0, // 1 + 0.0, // 1 + 0.0, // 0 + 0.0 // 0 + ]); + x = vector( xbuf, 5, -1, 4 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 4.0, // 4 + 0.0, // 4 + 3.0, // 3 + 0.0, // 3 + 2.0, // 2 + 0.0, // 2 + 1.0, // 1 + 0.0, // 1 + 0.0, // 0 + 0.0 // 0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 9.0, + 9.0, + 9.0, + 9.0, + 0.0, // 0 + 0.0, // 0 + 0.0, // 1 + 0.0, // 1 + 0.0, // 2 + 0.0, // 2 + 0.0, // 3 + 0.0 // 3 + ]); + x = vector( xbuf, 4, 1, 2 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 9.0, + 9.0, + 9.0, + 9.0, + 0.0, // 0 + 0.0, // 0 + 1.0, // 1 + 0.0, // 1 + 2.0, // 2 + 0.0, // 2 + 3.0, // 3 + 0.0 // 3 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride and non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Complex64Array([ + 9.0, + 9.0, + 0.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 0.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 0.0, // 0 + 0.0 // 0 + ]); + x = vector( xbuf, 3, -2, 5 ); + + actual = czeroTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Complex64Array([ + 9.0, + 9.0, + 2.0, // 2 + 0.0, // 2 + 9.0, + 9.0, + 1.0, // 1 + 0.0, // 1 + 9.0, + 9.0, + 0.0, // 0 + 0.0 // 0 + ]); + t.strictEqual( isSameComplex64Array( getData( actual ), expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/README.md new file mode 100644 index 000000000000..3a950b599617 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/README.md @@ -0,0 +1,124 @@ + + +# dcircshift + +> Circularly shift the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. + +
+ +
+ + + +
+ +## Usage + +```javascript +var dcircshift = require( '@stdlib/blas/ext/base/ndarray/dcircshift' ); +``` + +#### dcircshift( arrays ) + +Circularly shifts the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + +var k = scalar2ndarray( 2, { + 'dtype': 'generic' +}); + +var out = dcircshift( [ x, k ] ); +// returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift. + +
+ + + +
+ +## Notes + +- The input ndarray is shifted **in-place** (i.e., the input ndarray is **mutated**). + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var dcircshift = require( '@stdlib/blas/ext/base/ndarray/dcircshift' ); + +var xbuf = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +var x = new ndarray( 'float64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var k = scalar2ndarray( 3, { + 'dtype': 'generic' +}); +console.log( 'Shift:', ndarraylike2scalar( k ) ); + +dcircshift( [ x, k ] ); +console.log( ndarray2array( x ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/benchmark/benchmark.js new file mode 100644 index 000000000000..22d2e38a82d7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/benchmark/benchmark.js @@ -0,0 +1,112 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var pkg = require( './../package.json' ).name; +var dcircshift = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + var k; + + xbuf = uniform( len, 0.0, 100.0, options ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + k = scalar2ndarray( 3, options ); + + 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 = dcircshift( [ x, k ] ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( xbuf[ i%len ] !== xbuf[ i%len ] ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/repl.txt new file mode 100644 index 000000000000..b5842e10a895 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/repl.txt @@ -0,0 +1,37 @@ + +{{alias}}( arrays ) + Circularly shifts the elements of a one-dimensional double-precision + floating-point ndarray by a specified number of positions. + + The input ndarray is shifted *in-place* (i.e., the input ndarray is + *mutated*). + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing the following ndarrays: + + - a one-dimensional input ndarray. + - a zero-dimensional ndarray specifying the number of positions to + shift. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var dt = 'float64'; + > var sh = [ xbuf.length ]; + > var sx = [ 1 ]; + > var ox = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); + > var k = {{alias:@stdlib/ndarray/from-scalar}}( 2, { 'dtype': dt } ); + > {{alias}}( [ x, k ] ) + [ 3.0, 4.0, 1.0, 2.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/index.d.ts new file mode 100644 index 000000000000..33d99c4d1fed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/index.d.ts @@ -0,0 +1,51 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { typedndarray, float64ndarray } from '@stdlib/types/ndarray'; + +/** +* Circularly shifts the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. +* +* @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift +* @returns input ndarray +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var out = dcircshift( [ x, k ] ); +* // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +*/ +declare function dcircshift( arrays: [ float64ndarray, typedndarray ] ): float64ndarray; + + +// EXPORTS // + +export = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/test.ts new file mode 100644 index 000000000000..00911b7404af --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/docs/types/test.ts @@ -0,0 +1,64 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +import dcircshift = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + dcircshift( [ x, k ] ); // $ExpectType float64ndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + dcircshift( '10' ); // $ExpectError + dcircshift( 10 ); // $ExpectError + dcircshift( true ); // $ExpectError + dcircshift( false ); // $ExpectError + dcircshift( null ); // $ExpectError + dcircshift( undefined ); // $ExpectError + dcircshift( [] ); // $ExpectError + dcircshift( {} ); // $ExpectError + dcircshift( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + dcircshift(); // $ExpectError + dcircshift( [ x, k ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/examples/index.js new file mode 100644 index 000000000000..3b974eb97fee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/examples/index.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var dcircshift = require( './../lib' ); + +var xbuf = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +var x = new ndarray( 'float64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var k = scalar2ndarray( 3, { + 'dtype': 'generic' +}); +console.log( 'Shift:', ndarraylike2scalar( k ) ); + +dcircshift( [ x, k ] ); +console.log( ndarray2array( x ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/index.js new file mode 100644 index 000000000000..57b46752097d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/index.js @@ -0,0 +1,50 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Circularly shift the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. +* +* @module @stdlib/blas/ext/base/ndarray/dcircshift +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var dcircshift = require( '@stdlib/blas/ext/base/ndarray/dcircshift' ); +* +* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var out = dcircshift( [ x, k ] ); +* // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/main.js new file mode 100644 index 000000000000..9759d827285e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/lib/main.js @@ -0,0 +1,67 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/dcircshift' ).ndarray; + + +// MAIN // + +/** +* Circularly shifts the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift +* @returns {ndarray} input ndarray +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var out = dcircshift( [ x, k ] ); +* // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] +*/ +function dcircshift( arrays ) { + var x; + var k; + + x = arrays[ 0 ]; + k = ndarraylike2scalar( arrays[ 1 ] ); + strided( numelDimension( x, 0 ), k, getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len + return x; +} + + +// EXPORTS // + +module.exports = dcircshift; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/package.json new file mode 100644 index 000000000000..55a39b208a72 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/dcircshift", + "version": "0.0.0", + "description": "Circularly shift the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "circshift", + "circular", + "shift", + "rotate", + "rotation", + "strided", + "array", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/test/test.js new file mode 100644 index 000000000000..5711faff38e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcircshift/test/test.js @@ -0,0 +1,252 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var dcircshift = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dcircshift, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( dcircshift.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function circularly shifts elements of a one-dimensional ndarray (right shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function circularly shifts elements of a one-dimensional ndarray (left shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( -2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the number of elements to shift is zero', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 0, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the input ndarray is empty', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [] ), [ 0 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the input ndarray contains a single element', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 7.0 ] ), [ 1 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 3, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 7.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the number of positions to shift equals the number of elements in the input ndarray (right shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 5, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the number of positions to shift equals the number of elements in the input ndarray (left shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( -5, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports shifting elements in multiple cycles (right shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( 7, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 4.0, 5.0, 1.0, 2.0, 3.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports shifting elements in multiple cycles (left shift)', function test( t ) { + var actual; + var x; + var k; + + x = ndarray( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ), [ 5 ], [ 1 ], 0, 'row-major' ); + k = scalar2ndarray( -7, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride', function test( t ) { + var actual; + var xbuf; + var x; + var k; + + xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + x = ndarray( 'float64', xbuf, [ 5 ], [ -1 ], 4, 'row-major' ); + k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 3.0, 4.0, 5.0, 1.0, 2.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-zero offset', function test( t ) { + var actual; + var xbuf; + var x; + var k; + + xbuf = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + x = ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 1, 'row-major' ); + k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ] ), 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride and non-zero offset', function test( t ) { + var actual; + var xbuf; + var x; + var k; + + xbuf = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + x = ndarray( 'float64', xbuf, [ 5 ], [ -2 ], 9, 'row-major' ); + k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + actual = dcircshift( [ x, k ] ); + t.strictEqual( actual, x, 'returns expected value' ); + t.deepEqual( getData( actual ), new Float64Array( [ 0.0, 5.0, 2.0, 7.0, 4.0, 9.0, 6.0, 1.0, 8.0, 3.0 ] ), 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcusumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcusumpw/benchmark/benchmark.js index 8bfbb80f25db..54ee194a308c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcusumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dcusumpw/benchmark/benchmark.js @@ -27,6 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var ndarray = require( '@stdlib/ndarray/base/ctor' ); var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var dcusumpw = require( './../lib' ); @@ -111,7 +112,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg + ':len=' + len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/README.md index 3b0071e6efbd..bec7a44bcfb4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/README.md @@ -43,7 +43,6 @@ Fills a one-dimensional double-precision floating-point ndarray with linearly sp ```javascript var Float64Array = require( '@stdlib/array/float64' ); var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); var ndarray = require( '@stdlib/ndarray/base/ctor' ); var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); @@ -62,10 +61,7 @@ var endpoint = scalar2ndarray( true, { }); var out = dlinspace( [ x, start, end, endpoint ] ); -// returns - -var arr = ndarray2array( out ); -// returns [ 0.0, 1.0, 2.0, 3.0 ] +// returns [ 0.0, 1.0, 2.0, 3.0 ] ``` The function has the following parameters: diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/repl.txt index db19f266a84e..5e3cd62adfbe 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/repl.txt @@ -59,10 +59,7 @@ // Fill the input ndarray: > {{alias}}( [ x, start, stop, endpoint ] ) - - - > {{alias:@stdlib/ndarray/to-array}}( x ) - [ 0.0, 1.0, 2.0, 3.0 ] + [ 0.0, 1.0, 2.0, 3.0 ] See Also -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/types/index.d.ts index 3210ab71a43d..be5597897782 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/docs/types/index.d.ts @@ -40,7 +40,6 @@ import { float64ndarray, boolndarray } from '@stdlib/types/ndarray'; * @example * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * * var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); @@ -59,10 +58,7 @@ import { float64ndarray, boolndarray } from '@stdlib/types/ndarray'; * }); * * var out = dlinspace( [ x, start, stop, endpoint ] ); -* // returns -* -* var arr = ndarray2array( out ); -* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] +* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] */ declare function dlinspace( arrays: [ float64ndarray, float64ndarray, float64ndarray, boolndarray ] ): float64ndarray; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/index.js index 9895a8ddebf1..1f3e117603bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/index.js @@ -26,7 +26,6 @@ * @example * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * var dlinspace = require( '@stdlib/blas/ext/base/ndarray/dlinspace' ); * @@ -46,10 +45,7 @@ * }); * * var out = dlinspace( [ x, start, stop, endpoint ] ); -* // returns -* -* var arr = ndarray2array( out ); -* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] +* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/main.js index ee4ce6e829a9..2dce854827aa 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlinspace/lib/main.js @@ -48,7 +48,6 @@ var strided = require( '@stdlib/blas/ext/base/dlinspace' ).ndarray; * @example * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); -* var ndarray2array = require( '@stdlib/ndarray/to-array' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * * var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); @@ -67,10 +66,7 @@ var strided = require( '@stdlib/blas/ext/base/dlinspace' ).ndarray; * }); * * var out = dlinspace( [ x, start, stop, endpoint ] ); -* // returns -* -* var arr = ndarray2array( out ); -* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] +* // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] */ function dlinspace( arrays ) { var endpoint; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/docs/types/index.d.ts index bdaf02e7aa11..e50f11ad392f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/docs/types/index.d.ts @@ -21,27 +21,83 @@ /* eslint-disable max-lines */ import csum = require( '@stdlib/blas/ext/base/ndarray/csum' ); +import csumkbn = require( '@stdlib/blas/ext/base/ndarray/csumkbn' ); +import czeroTo = require( '@stdlib/blas/ext/base/ndarray/czero-to' ); +import dcircshift = require( '@stdlib/blas/ext/base/ndarray/dcircshift' ); import dcusum = require( '@stdlib/blas/ext/base/ndarray/dcusum' ); +import dcusumkbn = require( '@stdlib/blas/ext/base/ndarray/dcusumkbn' ); +import dcusumkbn2 = require( '@stdlib/blas/ext/base/ndarray/dcusumkbn2' ); +import dcusumors = require( '@stdlib/blas/ext/base/ndarray/dcusumors' ); +import dcusumpw = require( '@stdlib/blas/ext/base/ndarray/dcusumpw' ); import dindexOf = require( '@stdlib/blas/ext/base/ndarray/dindex-of' ); import dlastIndexOf = require( '@stdlib/blas/ext/base/ndarray/dlast-index-of' ); import dlinspace = require( '@stdlib/blas/ext/base/ndarray/dlinspace' ); +import dnansum = require( '@stdlib/blas/ext/base/ndarray/dnansum' ); +import dnansumkbn = require( '@stdlib/blas/ext/base/ndarray/dnansumkbn' ); +import dnansumkbn2 = require( '@stdlib/blas/ext/base/ndarray/dnansumkbn2' ); +import dnansumors = require( '@stdlib/blas/ext/base/ndarray/dnansumors' ); +import dnansumpw = require( '@stdlib/blas/ext/base/ndarray/dnansumpw' ); +import doneTo = require( '@stdlib/blas/ext/base/ndarray/done-to' ); import dsorthp = require( '@stdlib/blas/ext/base/ndarray/dsorthp' ); +import dsortins = require( '@stdlib/blas/ext/base/ndarray/dsortins' ); +import dsortsh = require( '@stdlib/blas/ext/base/ndarray/dsortsh' ); import dsum = require( '@stdlib/blas/ext/base/ndarray/dsum' ); +import dsumkbn = require( '@stdlib/blas/ext/base/ndarray/dsumkbn' ); +import dsumkbn2 = require( '@stdlib/blas/ext/base/ndarray/dsumkbn2' ); +import dsumors = require( '@stdlib/blas/ext/base/ndarray/dsumors' ); +import dsumpw = require( '@stdlib/blas/ext/base/ndarray/dsumpw' ); +import dzeroTo = require( '@stdlib/blas/ext/base/ndarray/dzero-to' ); +import gcircshift = require( '@stdlib/blas/ext/base/ndarray/gcircshift' ); import gcusum = require( '@stdlib/blas/ext/base/ndarray/gcusum' ); +import gcusumkbn = require( '@stdlib/blas/ext/base/ndarray/gcusumkbn' ); +import gcusumkbn2 = require( '@stdlib/blas/ext/base/ndarray/gcusumkbn2' ); +import gcusumors = require( '@stdlib/blas/ext/base/ndarray/gcusumors' ); +import gcusumpw = require( '@stdlib/blas/ext/base/ndarray/gcusumpw' ); import gfindIndex = require( '@stdlib/blas/ext/base/ndarray/gfind-index' ); import gfindLastIndex = require( '@stdlib/blas/ext/base/ndarray/gfind-last-index' ); import gindexOf = require( '@stdlib/blas/ext/base/ndarray/gindex-of' ); +import gjoin = require( '@stdlib/blas/ext/base/ndarray/gjoin' ); +import gjoinBetween = require( '@stdlib/blas/ext/base/ndarray/gjoin-between' ); import glastIndexOf = require( '@stdlib/blas/ext/base/ndarray/glast-index-of' ); import glinspace = require( '@stdlib/blas/ext/base/ndarray/glinspace' ); +import gnansum = require( '@stdlib/blas/ext/base/ndarray/gnansum' ); +import gnansumkbn = require( '@stdlib/blas/ext/base/ndarray/gnansumkbn' ); +import gnansumkbn2 = require( '@stdlib/blas/ext/base/ndarray/gnansumkbn2' ); +import gnansumors = require( '@stdlib/blas/ext/base/ndarray/gnansumors' ); +import gnansumpw = require( '@stdlib/blas/ext/base/ndarray/gnansumpw' ); +import goneTo = require( '@stdlib/blas/ext/base/ndarray/gone-to' ); +import gsort = require( '@stdlib/blas/ext/base/ndarray/gsort' ); import gsorthp = require( '@stdlib/blas/ext/base/ndarray/gsorthp' ); import gsum = require( '@stdlib/blas/ext/base/ndarray/gsum' ); +import gsumkbn = require( '@stdlib/blas/ext/base/ndarray/gsumkbn' ); +import gsumkbn2 = require( '@stdlib/blas/ext/base/ndarray/gsumkbn2' ); +import gsumors = require( '@stdlib/blas/ext/base/ndarray/gsumors' ); +import gsumpw = require( '@stdlib/blas/ext/base/ndarray/gsumpw' ); +import gzeroTo = require( '@stdlib/blas/ext/base/ndarray/gzero-to' ); +import scircshift = require( '@stdlib/blas/ext/base/ndarray/scircshift' ); import scusum = require( '@stdlib/blas/ext/base/ndarray/scusum' ); +import scusumkbn = require( '@stdlib/blas/ext/base/ndarray/scusumkbn' ); +import scusumkbn2 = require( '@stdlib/blas/ext/base/ndarray/scusumkbn2' ); +import scusumors = require( '@stdlib/blas/ext/base/ndarray/scusumors' ); import sindexOf = require( '@stdlib/blas/ext/base/ndarray/sindex-of' ); import slastIndexOf = require( '@stdlib/blas/ext/base/ndarray/slast-index-of' ); import slinspace = require( '@stdlib/blas/ext/base/ndarray/slinspace' ); +import snansum = require( '@stdlib/blas/ext/base/ndarray/snansum' ); +import snansumkbn = require( '@stdlib/blas/ext/base/ndarray/snansumkbn' ); +import snansumkbn2 = require( '@stdlib/blas/ext/base/ndarray/snansumkbn2' ); +import snansumors = require( '@stdlib/blas/ext/base/ndarray/snansumors' ); +import snansumpw = require( '@stdlib/blas/ext/base/ndarray/snansumpw' ); +import soneTo = require( '@stdlib/blas/ext/base/ndarray/sone-to' ); import ssorthp = require( '@stdlib/blas/ext/base/ndarray/ssorthp' ); import ssum = require( '@stdlib/blas/ext/base/ndarray/ssum' ); +import ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); +import ssumkbn2 = require( '@stdlib/blas/ext/base/ndarray/ssumkbn2' ); +import ssumors = require( '@stdlib/blas/ext/base/ndarray/ssumors' ); +import ssumpw = require( '@stdlib/blas/ext/base/ndarray/ssumpw' ); +import szeroTo = require( '@stdlib/blas/ext/base/ndarray/szero-to' ); import zsum = require( '@stdlib/blas/ext/base/ndarray/zsum' ); +import zsumkbn = require( '@stdlib/blas/ext/base/ndarray/zsumkbn' ); +import zzeroTo = require( '@stdlib/blas/ext/base/ndarray/zzero-to' ); /** * Interface describing the `ndarray` namespace. @@ -65,6 +121,65 @@ interface Namespace { */ csum: typeof csum; + /** + * Computes the sum of all elements in a one-dimensional single-precision complex floating-point ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Complex64Array( [ 1.0, -2.0, 2.0, 3.0 ] ); + * var x = new ndarray( 'complex64', xbuf, [ 2 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.csumkbn( [ x ] ); + * // returns [ 3.0, 1.0 ] + */ + csumkbn: typeof csumkbn; + + /** + * Fills a one-dimensional single-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var out = ns.czeroTo( [ x ] ); + * // returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] + */ + czeroTo: typeof czeroTo; + + /** + * Circularly shifts the elements of a one-dimensional double-precision floating-point ndarray by a specified number of positions. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift + * @returns input ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var k = scalar2ndarray( 2, { + * 'dtype': 'generic' + * }); + * + * var out = ns.dcircshift( [ x, k ] ); + * // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + dcircshift: typeof dcircshift; + /** * Computes the cumulative sum of a one-dimensional double-precision floating-point ndarray. * @@ -92,6 +207,118 @@ interface Namespace { */ dcusum: typeof dcusum; + /** + * Computes the cumulative sum of a one-dimensional double-precision floating-point ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'float64', 'row-major' ); + * + * var v = ns.dcusumkbn( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + */ + dcusumkbn: typeof dcusumkbn; + + /** + * Computes the cumulative sum of a one-dimensional double-precision floating-point ndarray using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'float64', 'row-major' ); + * + * var v = ns.dcusumkbn2( [ x, y, initial ] ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + * + * var bool = ( v === y ); + * // returns true + */ + dcusumkbn2: typeof dcusumkbn2; + + /** + * Computes the cumulative sum of a one-dimensional double-precision floating-point ndarray using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'float64', 'row-major' ); + * + * var v = ns.dcusumors( [ x, y, initial ] ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + * + * var bool = ( v === y ); + * // returns true + */ + dcusumors: typeof dcusumors; + + /** + * Computes the cumulative sum of a one-dimensional double-precision floating-point ndarray using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'float64', 'row-major' ); + * + * var v = ns.dcusumpw( [ x, y, initial ] ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + * + * var bool = ( v === y ); + * // returns true + */ + dcusumpw: typeof dcusumpw; + /** * Returns the first index of a search element in a one-dimensional double-precision floating-point ndarray. * @@ -164,7 +391,6 @@ interface Namespace { * @example * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); - * var ndarray2array = require( '@stdlib/ndarray/to-array' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * * var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); @@ -183,46 +409,30 @@ interface Namespace { * }); * * var out = ns.dlinspace( [ x, start, stop, endpoint ] ); - * // returns - * - * var arr = ndarray2array( out ); - * // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] + * // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] */ dlinspace: typeof dlinspace; /** - * Sorts a one-dimensional double-precision floating-point ndarray using heapsort. - * - * ## Notes - * - * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * Computes the sum of a one-dimensional double-precision floating-point ndarray, ignoring NaN values. * - * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order - * @returns input ndarray + * @param arrays - array-like object containing an input ndarray + * @returns sum * * @example * var Float64Array = require( '@stdlib/array/float64' ); - * var ndarray2array = require( '@stdlib/ndarray/to-array' ); - * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * var xbuf = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var ord = scalar2ndarray( 1.0, { - * 'dtype': 'generic' - * }); - * - * var out = ns.dsorthp( [ x, ord ] ); - * // returns - * - * var arr = ndarray2array( out ); - * // returns [ -4.0, -2.0, 1.0, 3.0 ] + * var v = ns.dnansum( [ x ] ); + * // returns 1.0 */ - dsorthp: typeof dsorthp; + dnansum: typeof dnansum; /** - * Computes the sum of all elements in a one-dimensional double-precision floating-point ndarray. + * Computes the sum of a one-dimensional double-precision floating-point ndarray, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. * * @param arrays - array-like object containing an input ndarray * @returns sum @@ -231,129 +441,597 @@ interface Namespace { * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var xbuf = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var v = ns.dsum( [ x ] ); - * // returns 10.0 + * var v = ns.dnansumkbn( [ x ] ); + * // returns 1.0 */ - dsum: typeof dsum; + dnansumkbn: typeof dnansumkbn; /** - * Computes the cumulative sum of a one-dimensional ndarray. + * Computes the sum of a one-dimensional double-precision floating-point ndarray, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. * - * @param arrays - array-like object containing an input ndarray, an output ndarray, and ndarray containing the initial sum - * @returns output ndarray + * @param arrays - array-like object containing an input ndarray + * @returns sum * * @example - * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); - * - * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; - * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); - * - * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); - * - * var v = ns.gcusum( [ x, y, initial ] ); - * // returns [ 1.0, 4.0, 8.0, 10.0 ] + * var xbuf = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var bool = ( v === y ); - * // returns true + * var v = ns.dnansumkbn2( [ x ] ); + * // returns 1.0 */ - gcusum: typeof gcusum; + dnansumkbn2: typeof dnansumkbn2; /** - * Returns the index of the first element in a one-dimensional ndarray which passes a test implemented by a predicate function. - * - * ## Notes - * - * - If no element passes a test implemented by a predicate function, the function returns `-1`. + * Computes the sum of a one-dimensional double-precision floating-point ndarray, ignoring `NaN` values and using ordinary recursive summation. * * @param arrays - array-like object containing an input ndarray - * @param clbk - predicate function - * @param thisArg - predicate function execution context - * @returns index + * @returns sum * * @example + * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * function clbk( v ) { - * return v % 2.0 === 0.0; - * } - * - * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * var xbuf = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var v = ns.gfindIndex( [ x ], clbk ); - * // returns 2 + * var v = ns.dnansumors( [ x ] ); + * // returns 1.0 */ - gfindIndex: typeof gfindIndex; + dnansumors: typeof dnansumors; /** - * Returns the index of the last element in a one-dimensional ndarray which passes a test implemented by a predicate function. - * - * ## Notes - * - * - If no element passes a test implemented by a predicate function, the function returns `-1`. + * Computes the sum of a one-dimensional double-precision floating-point ndarray, ignoring `NaN` values and using pairwise summation. * * @param arrays - array-like object containing an input ndarray - * @param clbk - predicate function - * @param thisArg - predicate execution context - * @returns index + * @returns sum * * @example + * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * function clbk( v ) { - * return v % 2.0 === 0.0; - * } - * - * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * var xbuf = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var v = ns.gfindLastIndex( [ x ], clbk ); - * // returns 3 + * var v = ns.dnansumpw( [ x ] ); + * // returns 1.0 */ - gfindLastIndex: typeof gfindLastIndex; + dnansumpw: typeof dnansumpw; /** - * Returns the first index of a search element in a one-dimensional ndarray. + * Fills a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. * - * @param arrays - array-like object containing a one-dimensional input ndarray, a zero-dimensional ndarray containing the search element, and a zero-dimensional ndarray containing the index from which to begin searching - * @returns index + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray * * @example + * var Float64Array = require( '@stdlib/array/float64' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); - * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); - * - * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); - * - * var searchElement = scalar2ndarray( 2.0, { - * 'dtype': 'generic' - * }); * - * var fromIndex = scalar2ndarray( 0, { - * 'dtype': 'generic' - * }); + * var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] * - * var v = ns.gindexOf( [ x, searchElement, fromIndex ] ); - * // returns 3 + * var out = ns.doneTo( [ x ] ); + * // returns [ 1.0, 2.0, 3.0, 4.0 ] */ - gindexOf: typeof gindexOf; + doneTo: typeof doneTo; /** - * Returns the last index of a search element in a one-dimensional ndarray. + * Sorts a one-dimensional double-precision floating-point ndarray using heapsort. * - * @param arrays - array-like object containing a one-dimensional input ndarray, a zero-dimensional ndarray containing the search element, and a zero-dimensional ndarray containing the index from which to begin searching - * @returns index + * ## Notes * - * @example - * var ndarray = require( '@stdlib/ndarray/base/ctor' ); - * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order + * @returns input ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ord = scalar2ndarray( 1.0, { + * 'dtype': 'generic' + * }); + * + * var out = ns.dsorthp( [ x, ord ] ); + * // returns + * + * var arr = ndarray2array( out ); + * // returns [ -4.0, -2.0, 1.0, 3.0 ] + */ + dsorthp: typeof dsorthp; + + /** + * Sorts a one-dimensional double-precision floating-point ndarray using insertion sort. + * + * ## Notes + * + * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order + * @returns input ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ord = scalar2ndarray( 1.0, { + * 'dtype': 'generic' + * }); + * + * var out = ns.dsortins( [ x, ord ] ); + * // returns + * + * var arr = ndarray2array( out ); + * // returns [ -4.0, -2.0, 1.0, 3.0 ] + */ + dsortins: typeof dsortins; + + /** + * Sorts a one-dimensional double-precision floating-point ndarray using Shellsort. + * + * ## Notes + * + * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order + * @returns input ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ord = scalar2ndarray( 1.0, { + * 'dtype': 'generic' + * }); + * + * var out = ns.dsortsh( [ x, ord ] ); + * // returns + * + * var arr = ndarray2array( out ); + * // returns [ -4.0, -2.0, 1.0, 3.0 ] + */ + dsortsh: typeof dsortsh; + + /** + * Computes the sum of all elements in a one-dimensional double-precision floating-point ndarray. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.dsum( [ x ] ); + * // returns 10.0 + */ + dsum: typeof dsum; + + /** + * Computes the sum of all elements in a one-dimensional double-precision floating-point ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.dsumkbn( [ x ] ); + * // returns 1.0 + */ + dsumkbn: typeof dsumkbn; + + /** + * Computes the sum of all elements in a one-dimensional double-precision floating-point ndarray using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, -2.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.dsumkbn2( [ x ] ); + * // returns 1.0 + */ + dsumkbn2: typeof dsumkbn2; + + /** + * Computes the sum of a one-dimensional double-precision floating-point ndarray using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.dsumors( [ x ] ); + * // returns 10.0 + */ + dsumors: typeof dsumors; + + /** + * Computes the sum of a one-dimensional double-precision floating-point ndarray using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.dsumpw( [ x ] ); + * // returns 10.0 + */ + dsumpw: typeof dsumpw; + + /** + * Fills a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] + * + * var out = ns.dzeroTo( [ x ] ); + * // returns [ 0.0, 1.0, 2.0, 3.0 ] + */ + dzeroTo: typeof dzeroTo; + + /** + * Circularly shifts the elements of a one-dimensional ndarray by a specified number of positions. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift + * @returns input ndarray + * + * @example + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var k = scalar2ndarray( 2, { + * 'dtype': 'generic' + * }); + * + * var out = ns.gcircshift( [ x, k ] ); + * // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + gcircshift: typeof gcircshift; + + /** + * Computes the cumulative sum of a one-dimensional ndarray. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); + * + * var v = ns.gcusum( [ x, y, initial ] ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + * + * var bool = ( v === y ); + * // returns true + */ + gcusum: typeof gcusum; + + /** + * Computes the cumulative sum of a one-dimensional ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); + * + * var v = ns.gcusumkbn( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + */ + gcusumkbn: typeof gcusumkbn; + + /** + * Computes the cumulative sum of a one-dimensional ndarray using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); + * + * var v = ns.gcusumkbn2( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + */ + gcusumkbn2: typeof gcusumkbn2; + + /** + * Computes the cumulative sum of a one-dimensional ndarray using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); + * + * var v = ns.gcusumors( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + */ + gcusumors: typeof gcusumors; + + /** + * Computes the cumulative sum of a one-dimensional ndarray using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var y = new ndarray( 'generic', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'generic', 'row-major' ); + * + * var v = ns.gcusumpw( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] + */ + gcusumpw: typeof gcusumpw; + + /** + * Returns the index of the first element in a one-dimensional ndarray which passes a test implemented by a predicate function. + * + * ## Notes + * + * - If no element passes a test implemented by a predicate function, the function returns `-1`. + * + * @param arrays - array-like object containing an input ndarray + * @param clbk - predicate function + * @param thisArg - predicate function execution context + * @returns index + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * function clbk( v ) { + * return v % 2.0 === 0.0; + * } + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gfindIndex( [ x ], clbk ); + * // returns 2 + */ + gfindIndex: typeof gfindIndex; + + /** + * Returns the index of the last element in a one-dimensional ndarray which passes a test implemented by a predicate function. + * + * ## Notes + * + * - If no element passes a test implemented by a predicate function, the function returns `-1`. + * + * @param arrays - array-like object containing an input ndarray + * @param clbk - predicate function + * @param thisArg - predicate execution context + * @returns index + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * function clbk( v ) { + * return v % 2.0 === 0.0; + * } + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gfindLastIndex( [ x ], clbk ); + * // returns 3 + */ + gfindLastIndex: typeof gfindLastIndex; + + /** + * Returns the first index of a search element in a one-dimensional ndarray. + * + * @param arrays - array-like object containing a one-dimensional input ndarray, a zero-dimensional ndarray containing the search element, and a zero-dimensional ndarray containing the index from which to begin searching + * @returns index + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var searchElement = scalar2ndarray( 2.0, { + * 'dtype': 'generic' + * }); + * + * var fromIndex = scalar2ndarray( 0, { + * 'dtype': 'generic' + * }); + * + * var v = ns.gindexOf( [ x, searchElement, fromIndex ] ); + * // returns 3 + */ + gindexOf: typeof gindexOf; + + /** + * Returns a string created by joining one-dimensional ndarray elements using a specified separator. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a separator + * @returns joined string + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var separator = scalar2ndarray( ',', { + * 'dtype': 'generic' + * }); + * + * var v = ns.gjoin( [ x, separator ] ); + * // returns '1,3,4,2' + */ + gjoin: typeof gjoin; + + /** + * Returns a string by joining one-dimensional ndarray elements using a specified separator for each pair of consecutive elements. + * + * @param arrays - array-like object containing a one-dimensional input ndarray, a zero-dimensional ndarray containing a prefix string, a zero-dimensional ndarray containing a suffix string, and a one-dimensional ndarray containing separator strings + * @returns joined string + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * + * var xbuf = [ 1, 2, 3, 4 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var prefix = scalar2ndarray( 'op: ', { + * 'dtype': 'generic' + * }); + * + * var suffix = scalar2ndarray( '', { + * 'dtype': 'generic' + * }); + * + * var sbuf = [ ' + ', ' - ', ' != ' ]; + * var separators = new ndarray( 'generic', sbuf, [ 3 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gjoinBetween( [ x, prefix, suffix, separators ] ); + * // returns 'op: 1 + 2 - 3 != 4' + */ + gjoinBetween: typeof gjoinBetween; + + /** + * Returns the last index of a search element in a one-dimensional ndarray. + * + * @param arrays - array-like object containing a one-dimensional input ndarray, a zero-dimensional ndarray containing the search element, and a zero-dimensional ndarray containing the index from which to begin searching + * @returns index + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * * var xbuf = [ 1.0, 2.0, 4.0, 2.0 ]; * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); @@ -398,73 +1076,403 @@ interface Namespace { * 'dtype': 'generic' * }); * - * var stop = scalar2ndarray( 100.0, { - * 'dtype': 'generic' - * }); + * var stop = scalar2ndarray( 100.0, { + * 'dtype': 'generic' + * }); + * + * var endpoint = scalar2ndarray( true, { + * 'dtype': 'bool' + * }); + * + * var out = ns.glinspace( [ x, start, stop, endpoint ] ); + * // returns + * + * var arr = ndarray2array( out ); + * // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] + */ + glinspace: typeof glinspace; + + /** + * Computes the sum of a one-dimensional ndarray, ignoring `NaN` values. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, NaN, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gnansum( [ x ] ); + * // returns 1.0 + */ + gnansum: typeof gnansum; + + /** + * Computes the sum of a one-dimensional ndarray, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, NaN, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gnansumkbn( [ x ] ); + * // returns 1.0 + */ + gnansumkbn: typeof gnansumkbn; + + /** + * Computes the sum of a one-dimensional ndarray, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, NaN, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gnansumkbn2( [ x ] ); + * // returns 1.0 + */ + gnansumkbn2: typeof gnansumkbn2; + + /** + * Computes the sum of a one-dimensional ndarray, ignoring `NaN` values and using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, NaN, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gnansumors( [ x ] ); + * // returns 1.0 + */ + gnansumors: typeof gnansumors; + + /** + * Computes the sum of a one-dimensional ndarray, ignoring `NaN` values and using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, NaN, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gnansumpw( [ x ] ); + * // returns 1.0 + */ + gnansumpw: typeof gnansumpw; + + /** + * Fills a one-dimensional ndarray with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] + * + * var out = ns.goneTo( [ x ] ); + * // returns [ 1.0, 2.0, 3.0, 4.0 ] + */ + goneTo: typeof goneTo; + + /** + * Sorts a one-dimensional ndarray. + * + * ## Notes + * + * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order + * @returns input ndarray + * + * @example + * var array = require( '@stdlib/ndarray/array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * + * var x = array( [ 1.0, -2.0, 3.0, -4.0 ], { + * 'dtype': 'generic' + * }); + * // returns [ 1.0, -2.0, 3.0, -4.0 ] + * + * var ord = scalar2ndarray( 1.0, { + * 'dtype': 'generic' + * }); + * // returns [ 1.0 ] + * + * var out = ns.gsort( [ x, ord ] ); + * // returns [ -4.0, -2.0, 1.0, 3.0 ] + */ + gsort: typeof gsort; + + /** + * Sorts a one-dimensional ndarray using heapsort. + * + * ## Notes + * + * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order + * @returns input ndarray + * + * @example + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, -2.0, 3.0, -4.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ord = scalar2ndarray( 1.0, { + * 'dtype': 'generic' + * }); + * + * var out = ns.gsorthp( [ x, ord ] ); + * // returns + * + * var arr = ndarray2array( out ); + * // returns [ -4.0, -2.0, 1.0, 3.0 ] + */ + gsorthp: typeof gsorthp; + + /** + * Computes the sum of all elements in a one-dimensional ndarray. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gsum( [ x ] ); + * // returns 10.0 + */ + gsum: typeof gsum; + + /** + * Computes the sum of all elements in a one-dimensional ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gsumkbn( [ x ] ); + * // returns 10.0 + */ + gsumkbn: typeof gsumkbn; + + /** + * Computes the sum of all elements in a one-dimensional ndarray using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gsumkbn2( [ x ] ); + * // returns 10.0 + */ + gsumkbn2: typeof gsumkbn2; + + /** + * Computes the sum of all elements in a one-dimensional ndarray using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gsumors( [ x ] ); + * // returns 10.0 + */ + gsumors: typeof gsumors; + + /** + * Computes the sum of all elements in a one-dimensional ndarray using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.gsumpw( [ x ] ); + * // returns 10.0 + */ + gsumpw: typeof gsumpw; + + /** + * Fills a one-dimensional ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = [ 0.0, 0.0, 0.0, 0.0 ]; + * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] + * + * var out = ns.gzeroTo( [ x ] ); + * // returns [ 0.0, 1.0, 2.0, 3.0 ] + */ + gzeroTo: typeof gzeroTo; + + /** + * Circularly shifts the elements of a one-dimensional single-precision floating-point ndarray by a specified number of positions. + * + * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the number of positions to shift + * @returns input ndarray + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' ); + * + * var k = scalar2ndarray( 2, { + * 'dtype': 'generic' + * }); + * + * var out = ns.scircshift( [ x, k ] ); + * // returns [ 4.0, 5.0, 1.0, 2.0, 3.0 ] + */ + scircshift: typeof scircshift; + + /** + * Computes the cumulative sum of a one-dimensional single-precision floating-point ndarray. + * + * @param arrays - array-like object containing an input ndarray, an output ndarray, and ndarray containing the initial sum + * @returns output ndarray + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var ybuf = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float32', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var endpoint = scalar2ndarray( true, { - * 'dtype': 'bool' - * }); + * var initial = scalar2ndarray( 0.0, 'float32', 'row-major' ); * - * var out = ns.glinspace( [ x, start, stop, endpoint ] ); - * // returns + * var v = ns.scusum( [ x, y, initial ] ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] * - * var arr = ndarray2array( out ); - * // returns [ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ] + * var bool = ( v === y ); + * // returns true */ - glinspace: typeof glinspace; + scusum: typeof scusum; /** - * Sorts a one-dimensional ndarray using heapsort. - * - * ## Notes - * - * - When the sort order is less than zero, the input ndarray is sorted in **decreasing** order. When the sort order is greater than zero, the input ndarray is sorted in **increasing** order. When the sort order is equal to zero, the input ndarray is left unchanged. + * Computes the cumulative sum of a one-dimensional single-precision floating-point ndarray using an improved Kahan–Babuška algorithm. * - * @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray specifying the sort order - * @returns input ndarray + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray * * @example + * var Float32Array = require( '@stdlib/array/float32' ); * var ndarray2array = require( '@stdlib/ndarray/to-array' ); - * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * var xbuf = [ 1.0, -2.0, 3.0, -4.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var ord = scalar2ndarray( 1.0, { - * 'dtype': 'generic' - * }); + * var ybuf = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float32', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var out = ns.gsorthp( [ x, ord ] ); + * var initial = scalar2ndarray( 0.0, 'float32', 'row-major' ); + * + * var v = ns.scusumkbn( [ x, y, initial ] ); * // returns * - * var arr = ndarray2array( out ); - * // returns [ -4.0, -2.0, 1.0, 3.0 ] + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] */ - gsorthp: typeof gsorthp; + scusumkbn: typeof scusumkbn; /** - * Computes the sum of all elements in a one-dimensional ndarray. + * Computes the cumulative sum of a one-dimensional single-precision floating-point ndarray using a second-order iterative Kahan–Babuška algorithm. * - * @param arrays - array-like object containing an input ndarray - * @returns sum + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum + * @returns output ndarray * * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray2array = require( '@stdlib/ndarray/to-array' ); + * var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * - * var xbuf = [ 1.0, 3.0, 4.0, 2.0 ]; - * var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * - * var v = ns.gsum( [ x ] ); - * // returns 10.0 + * var ybuf = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var y = new ndarray( 'float32', ybuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var initial = scalar2ndarray( 0.0, 'float32', 'row-major' ); + * + * var v = ns.scusumkbn2( [ x, y, initial ] ); + * // returns + * + * var bool = ( v === y ); + * // returns true + * + * var arr = ndarray2array( v ); + * // returns [ 1.0, 4.0, 8.0, 10.0 ] */ - gsum: typeof gsum; + scusumkbn2: typeof scusumkbn2; /** - * Computes the cumulative sum of a one-dimensional single-precision floating-point ndarray. + * Computes the cumulative sum of a one-dimensional single-precision floating-point ndarray using ordinary recursive summation. * - * @param arrays - array-like object containing an input ndarray, an output ndarray, and ndarray containing the initial sum + * @param arrays - array-like object containing an input ndarray, an output ndarray, and an ndarray containing the initial sum * @returns output ndarray * * @example @@ -481,7 +1489,7 @@ interface Namespace { * * var initial = scalar2ndarray( 0.0, 'float32', 'row-major' ); * - * var v = ns.scusum( [ x, y, initial ] ); + * var v = ns.scusumors( [ x, y, initial ] ); * // returns * * var bool = ( v === y ); @@ -490,7 +1498,7 @@ interface Namespace { * var arr = ndarray2array( v ); * // returns [ 1.0, 4.0, 8.0, 10.0 ] */ - scusum: typeof scusum; + scusumors: typeof scusumors; /** * Returns the first index of a search element in a one-dimensional single-precision floating-point ndarray. @@ -590,6 +1598,115 @@ interface Namespace { */ slinspace: typeof slinspace; + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.snansum( [ x ] ); + * // returns 1.0 + */ + snansum: typeof snansum; + + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.snansumkbn( [ x ] ); + * // returns 1.0 + */ + snansumkbn: typeof snansumkbn; + + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.snansumkbn2( [ x ] ); + * // returns 1.0 + */ + snansumkbn2: typeof snansumkbn2; + + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values and using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.snansumors( [ x ] ); + * // returns 1.0 + */ + snansumors: typeof snansumors; + + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values and using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.snansumpw( [ x ] ); + * // returns 1.0 + */ + snansumpw: typeof snansumpw; + + /** + * Fills a one-dimensional single-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] + * + * var out = ns.soneTo( [ x ] ); + * // returns [ 1.0, 2.0, 3.0, 4.0 ] + */ + soneTo: typeof soneTo; + /** * Sorts a one-dimensional single-precision floating-point ndarray using heapsort. * @@ -639,6 +1756,97 @@ interface Namespace { */ ssum: typeof ssum; + /** + * Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.ssumkbn( [ x ] ); + * // returns 10.0 + */ + ssumkbn: typeof ssumkbn; + + /** + * Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using a second-order iterative Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.ssumkbn2( [ x ] ); + * // returns 10.0 + */ + ssumkbn2: typeof ssumkbn2; + + /** + * Computes the sum of a one-dimensional single-precision floating-point ndarray using ordinary recursive summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.ssumors( [ x ] ); + * // returns 10.0 + */ + ssumors: typeof ssumors; + + /** + * Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using pairwise summation. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.ssumpw( [ x ] ); + * // returns 10.0 + */ + ssumpw: typeof ssumpw; + + /** + * Fills a one-dimensional single-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * // returns [ 0.0, 0.0, 0.0, 0.0 ] + * + * var out = ns.szeroTo( [ x ] ); + * // returns [ 0.0, 1.0, 2.0, 3.0 ] + */ + szeroTo: typeof szeroTo; + /** * Computes the sum of all elements in a one-dimensional double-precision complex floating-point ndarray. * @@ -656,6 +1864,42 @@ interface Namespace { * // returns [ 5.0, 5.0 ] */ zsum: typeof zsum; + + /** + * Computes the sum of all elements in a one-dimensional double-precision complex floating-point ndarray using an improved Kahan–Babuška algorithm. + * + * @param arrays - array-like object containing an input ndarray + * @returns sum + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Complex128Array( [ 1.0, 3.0, 4.0, 2.0 ] ); + * var x = new ndarray( 'complex128', xbuf, [ 2 ], [ 1 ], 0, 'row-major' ); + * + * var v = ns.zsumkbn( [ x ] ); + * // returns [ 5.0, 5.0 ] + */ + zsumkbn: typeof zsumkbn; + + /** + * Fills a one-dimensional double-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from zero. + * + * @param arrays - array-like object containing a one-dimensional input ndarray + * @returns input ndarray + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var ndarray = require( '@stdlib/ndarray/base/ctor' ); + * + * var xbuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + * var x = new ndarray( 'complex128', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + * + * var out = ns.zzeroTo( [ x ] ); + * // returns [ [ 0.0, 0.0 ], [ 1.0, 0.0 ], [ 2.0, 0.0 ], [ 3.0, 0.0 ] ] + */ + zzeroTo: typeof zzeroTo; } /** diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/README.md new file mode 100644 index 000000000000..b473b1f9bfa7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/README.md @@ -0,0 +1,111 @@ + + +# doneTo + +> Fill a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. + +
+ +
+ + + +
+ +## Usage + +```javascript +var doneTo = require( '@stdlib/blas/ext/base/ndarray/done-to' ); +``` + +#### doneTo( arrays ) + +Fills a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +// returns [ 0.0, 0.0, 0.0, 0.0 ] + +var out = doneTo( [ x ] ); +// returns [ 1.0, 2.0, 3.0, 4.0 ] +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +## Notes + +- The input ndarray is modified **in-place** (i.e., the input ndarray is **mutated**). + +
+ + + +
+ +## Examples + + + +```javascript +var zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var doneTo = require( '@stdlib/blas/ext/base/ndarray/done-to' ); + +var xbuf = zeros( 10, 'float64' ); +var x = new ndarray( 'float64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +doneTo( [ x ] ); +console.log( ndarray2array( x ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/benchmark/benchmark.js new file mode 100644 index 000000000000..78a5ce3f1627 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var pkg = require( './../package.json' ).name; +var doneTo = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var x; + + xbuf = zeros( len, options.dtype ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + + 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 = doneTo( [ x ] ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( typeof out !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/repl.txt new file mode 100644 index 000000000000..c0b8e33d16d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Fills a one-dimensional double-precision floating-point ndarray with + linearly spaced numeric elements which increment by `1` starting from one. + + The input ndarray is modified *in-place* (i.e., the input ndarray is + *mutated*). + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > var dt = 'float64'; + > var sh = [ xbuf.length ]; + > var sx = [ 1 ]; + > var ox = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); + > {{alias}}( [ x ] ) + [ 1.0, 2.0, 3.0, 4.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/index.d.ts new file mode 100644 index 000000000000..0d5cafad4f2c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/index.d.ts @@ -0,0 +1,47 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { float64ndarray } from '@stdlib/types/ndarray'; + +/** +* Fills a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param arrays - array-like object containing a one-dimensional input ndarray +* @returns input ndarray +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* // returns [ 0.0, 0.0, 0.0, 0.0 ] +* +* var out = doneTo( [ x ] ); +* // returns [ 1.0, 2.0, 3.0, 4.0 ] +*/ +declare function doneTo( arrays: [ float64ndarray ] ): float64ndarray; + + +// EXPORTS // + +export = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/test.ts new file mode 100644 index 000000000000..f7f313782b9f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT 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 space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import doneTo = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + + doneTo( [ x ] ); // $ExpectType float64ndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + doneTo( '10' ); // $ExpectError + doneTo( 10 ); // $ExpectError + doneTo( true ); // $ExpectError + doneTo( false ); // $ExpectError + doneTo( null ); // $ExpectError + doneTo( undefined ); // $ExpectError + doneTo( [] ); // $ExpectError + doneTo( {} ); // $ExpectError + doneTo( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + + doneTo(); // $ExpectError + doneTo( [ x ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/examples/index.js new file mode 100644 index 000000000000..819226e476ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/examples/index.js @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR 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 zeros = require( '@stdlib/array/zeros' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var doneTo = require( './../lib' ); + +var xbuf = zeros( 10, 'float64' ); +var x = new ndarray( 'float64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +doneTo( [ x ] ); +console.log( ndarray2array( x ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/index.js new file mode 100644 index 000000000000..17959700aebc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/index.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @module @stdlib/blas/ext/base/ndarray/done-to +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var doneTo = require( '@stdlib/blas/ext/base/ndarray/done-to' ); +* +* var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* // returns [ 0.0, 0.0, 0.0, 0.0 ] +* +* var out = doneTo( [ x ] ); +* // returns [ 1.0, 2.0, 3.0, 4.0 ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/main.js new file mode 100644 index 000000000000..93e808631a6e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/lib/main.js @@ -0,0 +1,58 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/done-to' ).ndarray; + + +// MAIN // + +/** +* Fills a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from one. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray +* @returns {ndarray} input ndarray +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* +* var xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +* var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* // returns [ 0.0, 0.0, 0.0, 0.0 ] +* +* var out = doneTo( [ x ] ); +* // returns [ 1.0, 2.0, 3.0, 4.0 ] +*/ +function doneTo( arrays ) { + var x = arrays[ 0 ]; + strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len + return x; +} + + +// EXPORTS // + +module.exports = doneTo; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/package.json new file mode 100644 index 000000000000..2e673701d0c9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/done-to", + "version": "0.0.0", + "description": "Fill a one-dimensional double-precision floating-point ndarray with linearly spaced numeric elements which increment by 1 starting from one.", + "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": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "fill", + "one", + "oneto", + "one-to", + "linearly", + "spaced", + "increment", + "strided", + "array", + "ndarray", + "float64", + "double", + "double-precision" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/test/test.js new file mode 100644 index 000000000000..1308ed191b21 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/done-to/test/test.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF 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 ndarray = require( '@stdlib/ndarray/base/ctor' ); +var doneTo = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Float64Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'float64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof doneTo, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( doneTo.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray with linearly spaced numeric elements which increment by 1 starting from one', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 4, 1, 0 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the input ndarray unchanged when the input ndarray is empty', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [] ); + x = vector( xbuf, 0, 1, 0 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function fills a one-dimensional ndarray containing a single element', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 5.0 ] ); + x = vector( xbuf, 1, 1, 0 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 1.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-unit stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 4, 2, 0 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 5, -1, 4 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 5.0, 4.0, 3.0, 2.0, 1.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 4, 1, 2 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an input ndarray having a negative stride and non-zero offset', function test( t ) { + var expected; + var actual; + var xbuf; + var x; + + xbuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + x = vector( xbuf, 5, -2, 9 ); + + actual = doneTo( [ x ] ); + t.strictEqual( actual, x, 'returns expected value' ); + + expected = new Float64Array( [ 0.0, 5.0, 0.0, 4.0, 0.0, 3.0, 0.0, 2.0, 0.0, 1.0 ] ); + t.deepEqual( xbuf, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsum/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsum/README.md index 1698c6cd5a94..12ef78da309d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsum/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsum/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2025 The Stdlib Authors. +Copyright (c) 2026 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -95,6 +95,153 @@ console.log( v ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/ext/base/ndarray/dsum.h" +``` + +#### stdlib_blas_ext_dsum( arrays ) + +Computes the sum of all elements in a one-dimensional double-precision floating-point ndarray. + +```c +#include "stdlib/ndarray/ctor.h" +#include "stdlib/ndarray/dtypes.h" +#include "stdlib/ndarray/index_modes.h" +#include "stdlib/ndarray/orders.h" +#include "stdlib/ndarray/base/bytes_per_element.h" +#include + +// Create an ndarray: +const double data[] = { 1.0, 2.0, 3.0, 4.0 }; +int64_t shape[] = { 4 }; +int64_t strides[] = { STDLIB_NDARRAY_FLOAT64_BYTES_PER_ELEMENT }; +int8_t submodes[] = { STDLIB_NDARRAY_INDEX_ERROR }; + +struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT64, (uint8_t *)data, 1, shape, strides, 0, STDLIB_NDARRAY_ROW_MAJOR, STDLIB_NDARRAY_INDEX_ERROR, 1, submodes ); + +// Compute the sum: +const struct ndarray *arrays[] = { x }; +double v = stdlib_blas_ext_dsum( arrays ); +// returns 10.0 + +// Free allocated memory: +stdlib_ndarray_free( x ); +``` + +The function accepts the following arguments: + +- **arrays**: `[in] struct ndarray**` list containing a one-dimensional input ndarray. + +```c +double stdlib_blas_ext_dsum( const struct ndarray *arrays[] ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/ext/base/ndarray/dsum.h" +#include "stdlib/ndarray/ctor.h" +#include "stdlib/ndarray/dtypes.h" +#include "stdlib/ndarray/index_modes.h" +#include "stdlib/ndarray/orders.h" +#include "stdlib/ndarray/base/bytes_per_element.h" +#include +#include +#include + +int main( void ) { + // Create a data buffer: + const double data[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 }; + + // Specify the number of array dimensions: + const int64_t ndims = 1; + + // Specify the array shape: + int64_t shape[] = { 4 }; + + // Specify the array strides: + int64_t strides[] = { 2*STDLIB_NDARRAY_FLOAT64_BYTES_PER_ELEMENT }; + + // Specify the byte offset: + const int64_t offset = 0; + + // Specify the array order: + const enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; + + // Specify the index mode: + const enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; + + // Specify the subscript index modes: + int8_t submodes[] = { STDLIB_NDARRAY_INDEX_ERROR }; + const int64_t nsubmodes = 1; + + // Create an ndarray: + struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT64, (uint8_t *)data, ndims, shape, strides, offset, order, imode, nsubmodes, submodes ); + if ( x == NULL ) { + fprintf( stderr, "Error allocating memory.\n" ); + exit( 1 ); + } + + // Define a list of ndarrays: + const struct ndarray *arrays[] = { x }; + + // Compute the sum: + double v = stdlib_blas_ext_dsum( arrays ); + + // Print the result: + printf( "sum: %lf\n", v ); + + // Free allocated memory: + stdlib_ndarray_free( x ); +} +``` + +
+ + + +
+ + +