diff --git a/etc/npm/deps.txt b/etc/npm/deps.txt index 362ab03036e2..3b15f28af5c0 100644 --- a/etc/npm/deps.txt +++ b/etc/npm/deps.txt @@ -1 +1 @@ -acorn@"^8.1.0" acorn-loose@"^8.0.2" acorn-walk@"^8.0.2" d3-format@"^1.0.0" d3-scale@"^1.0.0" d3-shape@"^1.0.0" d3-time-format@"^2.0.0" debug@"^2.6.9" glob@"^7.0.5" minimist@"^1.2.0" readable-stream@"^2.1.4" resolve@"^1.1.7" vdom-to-html@"^2.3.0" virtual-dom@"^2.1.1" 0x@"^4.10.2" @commitlint/cli@"^17.4.4" @commitlint/cz-commitlint@"^17.4.4" @kaciras/deasync@"^1.0.1" @types/node@"^13.9.0" ajv@"^5.2.2" browser-pack-flat@"^3.0.0" browserify@"^17.0.0" bundle-collapser@"^1.3.0" c8@"^7.12.0" chai@"^3.5.0" cheerio@"^1.0.0-rc.12" commitizen@"^4.3.0" common-shakeify@"^0.6.0" conventional-changelog-conventionalcommits@"^5.0.0" doctrine@"^3.0.0" dtslint@"^3.3.0" envify@"^4.0.0" eslint@"^8.0.1" eslint-plugin-node@"^11.1.0" factor-bundle@"^2.5.0" gh-pages@"git+https://github.com/Planeshifter/gh-pages.git#main" inquirer@"^8.0.0" jsdoc@"^3.4.0" lunr@"^2.3.9" mathjax-node@"^2.0.1" mathjax-node-sre@"^3.0.0" mkdirp@"^0.5.1" mustache@"^4.0.0" parse-link-header@"^1.0.1" plato@"^1.5.0" process@"^0.11.10" proxyquire@"^2.0.0" proxyquire-universal@"^2.0.0" proxyquireify@"^3.1.1" read-installed@"^4.0.3" rehype@"^9.0.0" rehype-highlight@"^3.0.0" remark@"^11.0.1" remark-cli@"^7.0.0" remark-frontmatter@"^1.2.0" remark-html@"^10.0.0" remark-lint@"^6.0.0" remark-lint-blockquote-indentation@"^1.0.0" remark-lint-checkbox-character-style@"^1.0.0" remark-lint-checkbox-content-indent@"^1.0.0" remark-lint-code-block-style@"^1.0.0" remark-lint-definition-case@"^1.0.0" remark-lint-definition-spacing@"^1.0.0" remark-lint-emphasis-marker@"^1.0.0" remark-lint-fenced-code-flag@"^1.0.0" remark-lint-fenced-code-marker@"^1.0.0" remark-lint-file-extension@"^1.0.0" remark-lint-final-definition@"^1.0.0" remark-lint-final-newline@"^1.0.0" remark-lint-first-heading-level@"^1.1.0" remark-lint-hard-break-spaces@"^1.0.1" remark-lint-heading-increment@"^1.0.0" remark-lint-heading-style@"^1.0.0" remark-lint-linebreak-style@"^1.0.0" remark-lint-link-title-style@"^1.0.0" remark-lint-list-item-bullet-indent@"^1.0.0" remark-lint-list-item-content-indent@"^1.0.0" remark-lint-list-item-indent@"^1.0.0" remark-lint-list-item-spacing@"^1.1.0" remark-lint-maximum-heading-length@"^1.0.0" remark-lint-maximum-line-length@"^1.0.0" remark-lint-no-auto-link-without-protocol@"^1.0.0" remark-lint-no-blockquote-without-marker@"^2.0.0" remark-lint-no-consecutive-blank-lines@"^1.0.0" remark-lint-no-duplicate-definitions@"^1.0.0" remark-lint-no-duplicate-headings@"^1.0.0" remark-lint-no-duplicate-headings-in-section@"^1.0.0" remark-lint-no-emphasis-as-heading@"^1.0.0" remark-lint-no-empty-url@"^1.0.1" remark-lint-no-file-name-articles@"^1.0.0" remark-lint-no-file-name-consecutive-dashes@"^1.0.0" remark-lint-no-file-name-irregular-characters@"^1.0.0" remark-lint-no-file-name-mixed-case@"^1.0.0" remark-lint-no-file-name-outer-dashes@"^1.0.1" remark-lint-no-heading-content-indent@"^1.0.0" remark-lint-no-heading-indent@"^1.0.0" remark-lint-no-heading-like-paragraph@"^1.0.0" remark-lint-no-heading-punctuation@"^1.0.0" remark-lint-no-html@"^1.0.0" remark-lint-no-inline-padding@"^1.0.0" remark-lint-no-literal-urls@"^1.0.0" remark-lint-no-missing-blank-lines@"^1.0.0" remark-lint-no-multiple-toplevel-headings@"^1.0.0" remark-lint-no-paragraph-content-indent@"^1.0.1" remark-lint-no-reference-like-url@"^1.0.0" remark-lint-no-shell-dollars@"^1.0.0" remark-lint-no-shortcut-reference-image@"^1.0.0" remark-lint-no-shortcut-reference-link@"^1.0.1" remark-lint-no-table-indentation@"^1.0.0" remark-lint-no-tabs@"^1.0.0" remark-lint-no-undefined-references@"^1.0.0" remark-lint-no-unused-definitions@"^1.0.0" remark-lint-ordered-list-marker-style@"^1.0.0" remark-lint-ordered-list-marker-value@"^1.0.0" remark-lint-rule-style@"^1.0.0" remark-lint-strong-marker@"^1.0.0" remark-lint-table-cell-padding@"^1.0.0" remark-lint-table-pipe-alignment@"^1.0.0" remark-lint-table-pipes@"^1.0.0" remark-lint-unordered-list-marker-style@"^1.0.0" remark-slug@"^5.0.0" remark-unlink@"^2.0.0" remark-validate-links@"^9.0.1" remark-vdom@"^8.0.0" semver@"^6.0.0" spdx-license-ids@"^3.0.0" tap-min@"git+https://github.com/Planeshifter/tap-min.git" tap-spec@"5.x.x" tap-summary@"^4.0.0" tap-xunit@"^2.2.0" tape@"git+https://github.com/kgryte/tape.git#fix/globby" to-vfile@"^6.0.0" typedoc@"^0.16.11" uglify-es@"^3.1.1" uglifyify@"^5.0.0" unified-lint-rule@"^1.0.1" unist-util-visit@"^2.0.0" yaml@"^1.0.0" +acorn@"^8.1.0" acorn-loose@"^8.0.2" acorn-walk@"^8.0.2" d3-format@"^1.0.0" d3-scale@"^1.0.0" d3-shape@"^1.0.0" d3-time-format@"^2.0.0" debug@"^2.6.9" glob@"^7.0.5" minimist@"^1.2.0" readable-stream@"^2.1.4" resolve@"^1.1.7" vdom-to-html@"^2.3.0" virtual-dom@"^2.1.1" 0x@"^4.10.2" @commitlint/cli@"^17.4.4" @commitlint/cz-commitlint@"^17.4.4" @kaciras/deasync@"^1.0.1" @types/node@"^13.9.0" ajv@"^5.2.2" browser-pack-flat@"^3.0.0" browserify@"^17.0.0" bundle-collapser@"^1.3.0" c8@"^7.12.0" chai@"^3.5.0" cheerio@"^1.0.0-rc.12" commitizen@"^4.3.0" common-shakeify@"^0.6.0" conventional-changelog-conventionalcommits@"^5.0.0" doctrine@"^3.0.0" dtslint@"^3.3.0" envify@"^4.0.0" eslint@"^8.0.1" eslint-plugin-node@"^11.1.0" factor-bundle@"^2.5.0" gh-pages@"git+https://github.com/Planeshifter/gh-pages.git#main" inquirer@"^8.0.0" jsdoc@"^3.4.0" lunr@"^2.3.9" mathjax-node@"^2.0.1" mathjax-node-sre@"^3.0.0" mkdirp@"^0.5.1" mustache@"^4.0.0" parse-link-header@"^1.0.1" plato@"^1.5.0" process@"^0.11.10" proxyquire@"^2.0.0" proxyquire-universal@"^2.0.0" proxyquireify@"^3.1.1" read-installed@"^4.0.3" rehype@"^9.0.0" rehype-highlight@"^3.0.0" remark@"^11.0.1" remark-cli@"^7.0.0" remark-frontmatter@"^1.2.0" remark-html@"^10.0.0" remark-lint@"^6.0.0" remark-lint-blockquote-indentation@"^1.0.0" remark-lint-checkbox-character-style@"^1.0.0" remark-lint-checkbox-content-indent@"^1.0.0" remark-lint-code-block-style@"^1.0.0" remark-lint-definition-case@"^1.0.0" remark-lint-definition-spacing@"^1.0.0" remark-lint-emphasis-marker@"^1.0.0" remark-lint-fenced-code-flag@"^1.0.0" remark-lint-fenced-code-marker@"^1.0.0" remark-lint-file-extension@"^1.0.0" remark-lint-final-definition@"^1.0.0" remark-lint-final-newline@"^1.0.0" remark-lint-first-heading-level@"^1.1.0" remark-lint-hard-break-spaces@"^1.0.1" remark-lint-heading-increment@"^1.0.0" remark-lint-heading-style@"^1.0.0" remark-lint-linebreak-style@"^1.0.0" remark-lint-link-title-style@"^1.0.0" remark-lint-list-item-bullet-indent@"^1.0.0" remark-lint-list-item-content-indent@"^1.0.0" remark-lint-list-item-indent@"^1.0.0" remark-lint-list-item-spacing@"^1.1.0" remark-lint-maximum-heading-length@"^1.0.0" remark-lint-maximum-line-length@"^1.0.0" remark-lint-no-auto-link-without-protocol@"^1.0.0" remark-lint-no-blockquote-without-marker@"^2.0.0" remark-lint-no-consecutive-blank-lines@"^1.0.0" remark-lint-no-duplicate-definitions@"^1.0.0" remark-lint-no-duplicate-headings@"^1.0.0" remark-lint-no-duplicate-headings-in-section@"^1.0.0" remark-lint-no-emphasis-as-heading@"^1.0.0" remark-lint-no-empty-url@"^1.0.1" remark-lint-no-file-name-articles@"^1.0.0" remark-lint-no-file-name-consecutive-dashes@"^1.0.0" remark-lint-no-file-name-irregular-characters@"^1.0.0" remark-lint-no-file-name-mixed-case@"^1.0.0" remark-lint-no-file-name-outer-dashes@"^1.0.1" remark-lint-no-heading-content-indent@"^1.0.0" remark-lint-no-heading-indent@"^1.0.0" remark-lint-no-heading-like-paragraph@"^1.0.0" remark-lint-no-heading-punctuation@"^1.0.0" remark-lint-no-html@"^1.0.0" remark-lint-no-inline-padding@"^1.0.0" remark-lint-no-literal-urls@"^1.0.0" remark-lint-no-missing-blank-lines@"^1.0.0" remark-lint-no-multiple-toplevel-headings@"^1.0.0" remark-lint-no-paragraph-content-indent@"^1.0.1" remark-lint-no-reference-like-url@"^1.0.0" remark-lint-no-shell-dollars@"^1.0.0" remark-lint-no-shortcut-reference-image@"^1.0.0" remark-lint-no-shortcut-reference-link@"^1.0.1" remark-lint-no-table-indentation@"^1.0.0" remark-lint-no-tabs@"^1.0.0" remark-lint-no-undefined-references@"^1.0.0" remark-lint-no-unused-definitions@"^1.0.0" remark-lint-ordered-list-marker-style@"^1.0.0" remark-lint-ordered-list-marker-value@"^1.0.0" remark-lint-rule-style@"^1.0.0" remark-lint-strong-marker@"^1.0.0" remark-lint-table-cell-padding@"^1.0.0" remark-lint-table-pipe-alignment@"^1.0.0" remark-lint-table-pipes@"^1.0.0" remark-lint-unordered-list-marker-style@"^1.0.0" remark-slug@"^5.0.0" remark-unlink@"^2.0.0" remark-validate-links@"^9.0.1" remark-vdom@"^8.0.0" semver@"^6.0.0" spdx-license-ids@"^3.0.0" tap-min@"git+https://github.com/Planeshifter/tap-min.git" tap-spec@"5.x.x" tap-summary@"^4.0.0" tap-xunit@"^2.2.0" tape@"git+https://github.com/kgryte/tape.git#fix/globby" to-vfile@"^6.0.0" typedoc@"^0.16.11" uglify-es@"^3.1.1" uglifyify@"^5.0.0" unified-lint-rule@"^1.0.1" unist-util-visit@"^2.0.0" yaml@"^1.0.0" node-gyp@"^9.3.1" diff --git a/lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts index c16caaf55f70..b4dc5bae656e 100644 --- a/lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts @@ -21,12 +21,37 @@ /* tslint:disable:max-line-length */ /* tslint:disable:max-file-line-count */ +import contains = require( '@stdlib/array/base/assert/contains' ); import isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' ); /** * Interface describing the `assert` namespace. */ interface Namespace { + /** + * Tests if an array contains a provided search value. + * + * @param x - input array + * @param value - search value + * @returns boolean indicating if an array contains a search value + * + * @example + * var x = [ 1, 2, 3 ]; + * + * var out = ns.contains( x, 2 ); + * // returns true + * + * @example + * var x = [ 1, 2, 3 ]; + * + * var fcn = ns.contains.factory( x ); + * // returns + * + * var out = fcn( 2 ); + * // returns true + */ + contains: typeof contains; + /** * Tests if an array-like object supports the accessor (get/set) protocol. * 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 48f71add56cd..06c339bd4e0f 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 @@ -250,7 +250,7 @@ interface Namespace { /** * Copies the elements of an array-like object to a new "generic" array. * - * @param x - array length + * @param x - input array * @returns output array * * @example 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 11a27199339d..608bfbf15198 100644 --- a/lib/node_modules/@stdlib/array/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/docs/types/index.d.ts @@ -32,6 +32,7 @@ import DataView = require( '@stdlib/array/dataview' ); import datespace = require( '@stdlib/array/datespace' ); import arrayDataType = require( '@stdlib/array/dtype' ); import arrayDataTypes = require( '@stdlib/array/dtypes' ); +import aempty = require( '@stdlib/array/empty' ); import filledarray = require( '@stdlib/array/filled' ); import filledarrayBy = require( '@stdlib/array/filled-by' ); import Float32Array = require( '@stdlib/array/float32' ); @@ -359,6 +360,44 @@ interface Namespace { */ arrayDataTypes: typeof arrayDataTypes; + /** + * Creates an uninitialized array having a specified length. + * + * ## Notes + * + * - In browser environments, the function always returns zero-filled arrays. + * - If `dtype` is `'generic'`, the function always returns a zero-filled array. + * - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data. + * + * The function recognizes the following data types: + * + * - `float64`: double-precision floating-point numbers (IEEE 754) + * - `float32`: single-precision floating-point numbers (IEEE 754) + * - `complex128`: double-precision complex floating-point numbers + * - `complex64`: single-precision complex floating-point numbers + * - `int32`: 32-bit two's complement signed integers + * - `uint32`: 32-bit unsigned integers + * - `int16`: 16-bit two's complement signed integers + * - `uint16`: 16-bit unsigned integers + * - `int8`: 8-bit two's complement signed integers + * - `uint8`: 8-bit unsigned integers + * - `uint8c`: 8-bit unsigned integers clamped to `0-255` + * - `generic`: generic JavaScript values + * + * @param length - array length + * @param dtype - data type (default: 'float64') + * @returns empty array + * + * @example + * var arr = ns.aempty( 2 ); + * // returns + * + * @example + * var arr = ns.aempty( 2, 'float32' ); + * // returns + */ + aempty: typeof aempty; + /** * Returns a filled typed array view of an `ArrayBuffer`. * diff --git a/lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts index 1991236d56d7..d07fb6c1c1c0 100644 --- a/lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts @@ -1848,15 +1848,24 @@ interface Namespace { cflipsignf: typeof cflipsignf; /** - * Rounds a complex number toward negative infinity. + * Rounds a double-precision complex floating-point number toward negative infinity. * - * @param re - real component - * @param im - imaginary component - * @returns real and imaginary components + * @param z - input value + * @returns result * * @example - * var out = ns.cfloor( 5.5, 3.3 ); - * // returns [ 5.0, 3.0 ] + * var Complex128 = require( `@stdlib/complex/float64` ); + * var real = require( `@stdlib/complex/real` ); + * var imag = require( `@stdlib/complex/imag` ); + * + * var v = ns.cfloor( new Complex128( 5.5, 3.3 ) ); + * // returns + * + * var re = real( v ); + * // returns 5.0 + * + * var im = imag( v ); + * // returns 3.0 */ cfloor: typeof cfloor; diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts index 3878d41335bd..d49371f051c1 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts @@ -27,16 +27,24 @@ import isBufferLengthCompatibleShape = require( '@stdlib/ndarray/base/assert/is- import isCastingMode = require( '@stdlib/ndarray/base/assert/is-casting-mode' ); import isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); import isColumnMajorContiguous = require( '@stdlib/ndarray/base/assert/is-column-major-contiguous' ); +import isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-complex-floating-point-data-type' ); import isContiguous = require( '@stdlib/ndarray/base/assert/is-contiguous' ); import isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); +import isFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-floating-point-data-type' ); import isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); +import isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' ); +import isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' ); import isOrder = require( '@stdlib/ndarray/base/assert/is-order' ); import isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' ); +import isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' ); +import isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' ); import isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); import isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major-contiguous' ); import isSafeDataTypeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); import isSameKindDataTypeCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); +import isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); import isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); +import isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); /** * Interface describing the `assert` namespace. @@ -183,6 +191,57 @@ interface Namespace { */ isColumnMajorContiguous: typeof isColumnMajorContiguous; + /** + * Tests whether an input value is a supported ndarray complex-valued floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray complex-valued floating-point data type + * + * @example + * var bool = ns.isComplexFloatingPointDataType( 'binary' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'complex64' ); + * // returns true + * + * bool = ns.isComplexFloatingPointDataType( 'complex128' ); + * // returns true + * + * bool = ns.isComplexFloatingPointDataType( 'float32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'float64' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'foo' ); + * // returns false + */ + isComplexFloatingPointDataType: typeof isComplexFloatingPointDataType; + /** * Returns a boolean indicating if an array is contiguous. * @@ -262,6 +321,51 @@ interface Namespace { */ isDataType: typeof isDataType; + /** + * Tests whether an input value is a supported ndarray floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray floating-point data type + * + * @example + * var bool = ns.isFloatingPointDataType( 'binary' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'float32' ); + * // returns true + * + * bool = ns.isFloatingPointDataType( 'float64' ); + * // returns true + * + * bool = ns.isFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'foo' ); + * // returns false + */ + isFloatingPointDataType: typeof isFloatingPointDataType; + /** * Tests whether an input value is a supported ndarray index mode. * @@ -283,6 +387,96 @@ interface Namespace { */ isIndexMode: typeof isIndexMode; + /** + * Tests whether an input value is a supported ndarray integer (i.e., signed or unsigned integer) data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray integer data type + * + * @example + * var bool = ns.isIntegerDataType( 'binary' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'int16' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'int32' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'int8' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint16' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint32' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint8' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'foo' ); + * // returns false + */ + isIntegerDataType: typeof isIntegerDataType; + + /** + * Tests whether an input value is a supported ndarray numeric data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray numeric data type + * + * @example + * var bool = ns.isNumericDataType( 'binary' ); + * // returns false + * + * bool = ns.isNumericDataType( 'float32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'float64' ); + * // returns true + * + * bool = ns.isNumericDataType( 'generic' ); + * // returns false + * + * bool = ns.isNumericDataType( 'int16' ); + * // returns true + * + * bool = ns.isNumericDataType( 'int32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'int8' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint16' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint8' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isNumericDataType( 'foo' ); + * // returns false + */ + isNumericDataType: typeof isNumericDataType; + /** * Tests whether an input value is an ndarray order. * @@ -324,6 +518,99 @@ interface Namespace { */ isReadOnly: typeof isReadOnly; + /** + * Tests whether an input value is a supported ndarray real-valued data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray real-valued data type + * + * @example + * var bool = ns.isRealDataType( 'binary' ); + * // returns false + * + * bool = ns.isRealDataType( 'float32' ); + * // returns true + * + * bool = ns.isRealDataType( 'float64' ); + * // returns true + * + * bool = ns.isRealDataType( 'complex128' ); + * // returns false + * + * bool = ns.isRealDataType( 'generic' ); + * // returns false + * + * bool = ns.isRealDataType( 'int16' ); + * // returns true + * + * bool = ns.isRealDataType( 'int32' ); + * // returns true + * + * bool = ns.isRealDataType( 'int8' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint16' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint32' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint8' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isRealDataType( 'foo' ); + * // returns false + */ + isRealDataType: typeof isRealDataType; + + /** + * Tests whether an input value is a supported ndarray real-valued floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray real-valued floating-point data type + * + * @example + * var bool = ns.isRealFloatingPointDataType( 'binary' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'float32' ); + * // returns true + * + * bool = ns.isRealFloatingPointDataType( 'float64' ); + * // returns true + * + * bool = ns.isRealFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'foo' ); + * // returns false + */ + isRealFloatingPointDataType: typeof isRealFloatingPointDataType; + /** * Returns a boolean indicating if an array is row-major based on a provided stride array. * @@ -405,6 +692,51 @@ interface Namespace { */ isSameKindDataTypeCast: typeof isSameKindDataTypeCast; + /** + * Tests whether an input value is a supported ndarray signed integer data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray signed integer data type + * + * @example + * var bool = ns.isSignedIntegerDataType( 'binary' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'int16' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'int32' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'int8' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'uint16' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint32' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint8' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'foo' ); + * // returns false + */ + isSignedIntegerDataType: typeof isSignedIntegerDataType; + /** * Returns a boolean indicating if an array is compatible with a single memory segment. * @@ -430,6 +762,51 @@ interface Namespace { * // returns false */ isSingleSegmentCompatible: typeof isSingleSegmentCompatible; + + /** + * Tests whether an input value is a supported ndarray unsigned integer data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported ndarray unsigned integer data type + * + * @example + * var bool = ns.isUnsignedIntegerDataType( 'binary' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int16' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int32' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int8' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'uint16' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint32' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint8' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'foo' ); + * // returns false + */ + isUnsignedIntegerDataType: typeof isUnsignedIntegerDataType; } /** diff --git a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts index 20d24a0cd259..7a5767458780 100644 --- a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts @@ -44,6 +44,8 @@ import dtypeResolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' ); import dtypeStr2Enum = require( '@stdlib/ndarray/base/dtype-str2enum' ); import dtype2c = require( '@stdlib/ndarray/base/dtype2c' ); import dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' ); +import empty = require( '@stdlib/ndarray/base/empty' ); +import emptyLike = require( '@stdlib/ndarray/base/empty-like' ); import expandDimensions = require( '@stdlib/ndarray/base/expand-dimensions' ); import scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ); import ind = require( '@stdlib/ndarray/base/ind' ); @@ -60,6 +62,10 @@ import nullary = require( '@stdlib/ndarray/base/nullary' ); import nullaryLoopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); import nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); import numel = require( '@stdlib/ndarray/base/numel' ); +import outputPolicyEnum2Str = require( '@stdlib/ndarray/base/output-policy-enum2str' ); +import outputPolicyResolveEnum = require( '@stdlib/ndarray/base/output-policy-resolve-enum' ); +import outputPolicyResolveStr = require( '@stdlib/ndarray/base/output-policy-resolve-str' ); +import outputPolicyStr2Enum = require( '@stdlib/ndarray/base/output-policy-str2enum' ); import prependSingletonDimensions = require( '@stdlib/ndarray/base/prepend-singleton-dimensions' ); import removeSingletonDimensions = require( '@stdlib/ndarray/base/remove-singleton-dimensions' ); import serializeMetaData = require( '@stdlib/ndarray/base/serialize-meta-data' ); @@ -73,6 +79,7 @@ import transpose = require( '@stdlib/ndarray/base/transpose' ); import unary = require( '@stdlib/ndarray/base/unary' ); import unaryBy = require( '@stdlib/ndarray/base/unary-by' ); import unaryLoopOrder = require( '@stdlib/ndarray/base/unary-loop-interchange-order' ); +import unaryOutputDataType = require( '@stdlib/ndarray/base/unary-output-dtype' ); import unaryBlockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); import vind2bind = require( '@stdlib/ndarray/base/vind2bind' ); import wrapIndex = require( '@stdlib/ndarray/base/wrap-index' ); @@ -663,6 +670,55 @@ interface Namespace { */ dtypes2signatures: typeof dtypes2signatures; + /** + * Creates an uninitialized array having a specified shape and data type. + * + * @param dtype - underlying data type + * @param shape - array shape + * @param order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) + * @returns output array + * + * @example + * var arr = ns.empty( 'float32', [ 2, 2 ], 'row-major' ); + * // returns + * + * var sh = arr.shape; + * // returns [ 2, 2 ] + * + * var dt = arr.dtype; + * // returns 'float32' + */ + empty: typeof empty; + + /** + * Creates an uninitialized array having the same shape and data type as a provided input ndarray. + * + * @param x - input array + * @returns output array + * + * @example + * var zeros = require( `@stdlib/ndarray/base/zeros` ); + * + * var x = zeros( 'generic', [ 2, 2 ], 'row-major' ); + * // returns + * + * var sh = x.shape; + * // returns [ 2, 2 ] + * + * var dt = x.dtype; + * // returns 'generic' + * + * var y = ns.emptyLike( x ); + * // returns + * + * sh = y.shape; + * // returns [ 2, 2 ] + * + * dt = y.dtype; + * // returns 'generic' + */ + emptyLike: typeof emptyLike; + /** * Expands the shape of an array by inserting a new dimension of size one at a specified axis. * @@ -708,10 +764,11 @@ interface Namespace { * * @param value - scalar value * @param dtype - array data type + * @param order - memory layout (row-major or column-major) * @returns zero-dimensional ndarray * * @example - * var x = ns.scalar2ndarray( 1.0, 'generic' ); + * var x = ns.scalar2ndarray( 1.0, 'generic', 'row-major' ); * // returns * * var sh = x.shape; @@ -1241,6 +1298,69 @@ interface Namespace { */ numel: typeof numel; + /** + * Returns the policy string associated with an output ndarray data type policy enumeration constant. + * + * @param policy - policy enumeration constant + * @returns policy string + * + * @example + * var str2enum = require( `@stdlib/ndarray/base/output-policy-str2enum` ); + * + * var v = str2enum( 'same' ); + * // returns + * + * var policy = ns.outputPolicyEnum2Str( v ); + * // returns 'same' + */ + outputPolicyEnum2Str: typeof outputPolicyEnum2Str; + + /** + * Returns the enumeration constant associated with an ndarray data type policy value. + * + * ## Notes + * + * - Downstream consumers of this function should **not** rely on specific integer values (e.g., `SAME == 0`). Instead, the function should be used in an opaque manner. + * + * @param policy - policy value + * @returns enumeration constant + * + * @example + * var v = ns.outputPolicyResolveEnum( 'same' ); + * // returns + */ + outputPolicyResolveEnum: typeof outputPolicyResolveEnum; + + /** + * Returns the policy string associated with an output ndarray data type policy value. + * + * @param policy - policy value + * @returns policy string + * + * @example + * var str2enum = require( `@stdlib/ndarray/base/output-policy-str2enum` ); + * + * var v = ns.outputPolicyResolveStr( str2enum( 'same' ) ); + * // returns 'same' + */ + outputPolicyResolveStr: typeof outputPolicyResolveStr; + + /** + * Returns the enumeration constant associated with an output ndarray data type policy string. + * + * ## Notes + * + * - Downstream consumers of this function should **not** rely on specific integer values (e.g., `SAME == 0`). Instead, the function should be used in an opaque manner. + * + * @param policy - policy string + * @returns enumeration constant + * + * @example + * var v = ns.outputPolicyStr2Enum( 'same' ); + * // returns + */ + outputPolicyStr2Enum: typeof outputPolicyStr2Enum; + /** * Returns an array with a specified number of prepended singleton dimensions. * @@ -1757,6 +1877,19 @@ interface Namespace { */ unaryLoopOrder: typeof unaryLoopOrder; + /** + * Resolves the output ndarray data type for a unary function. + * + * @param dtype - input ndarray data type + * @param policy - output ndarray data type policy + * @returns output ndarray data type + * + * @example + * var dt = ns.unaryOutputDataType( 'float64', 'complex_floating_point' ); + * // returns + */ + unaryOutputDataType: typeof unaryOutputDataType; + /** * Returns a loop block size for multi-dimensional array tiled loops. * diff --git a/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts index fba98efcf092..b4ad6ea45923 100644 --- a/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts @@ -25,14 +25,18 @@ import array = require( '@stdlib/ndarray/array' ); import base = require( '@stdlib/ndarray/base' ); import ndarrayCastingModes = require( '@stdlib/ndarray/casting-modes' ); import ndarray = require( '@stdlib/ndarray/ctor' ); +import defaults = require( '@stdlib/ndarray/defaults' ); import dispatch = require( '@stdlib/ndarray/dispatch' ); import ndarrayDataTypes = require( '@stdlib/ndarray/dtypes' ); +import ndempty = require( '@stdlib/ndarray/empty' ); +import ndemptyLike = require( '@stdlib/ndarray/empty-like' ); import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); import ind2sub = require( '@stdlib/ndarray/ind2sub' ); import ndarrayIndexModes = require( '@stdlib/ndarray/index-modes' ); import ndarrayMinDataType = require( '@stdlib/ndarray/min-dtype' ); import ndarrayNextDataType = require( '@stdlib/ndarray/next-dtype' ); import ndarrayOrders = require( '@stdlib/ndarray/orders' ); +import ndarrayOutputDataTypePolicies = require( '@stdlib/ndarray/output-dtype-policies' ); import ndarrayPromotionRules = require( '@stdlib/ndarray/promotion-rules' ); import ndarraySafeCasts = require( '@stdlib/ndarray/safe-casts' ); import ndarraySameKindCasts = require( '@stdlib/ndarray/same-kind-casts' ); @@ -164,6 +168,21 @@ interface Namespace { */ ndarray: typeof ndarray; + /** + * Returns default ndarray settings. + * + * @returns default settings + * + * @example + * var o = ns.defaults(); + * // returns {...} + * + * @example + * var v = ns.defaults.get( 'order' ); + * // returns + */ + defaults: typeof defaults; + /** * Returns an ndarray function interface which performs multiple dispatch. * @@ -219,7 +238,7 @@ interface Namespace { * * ## Notes * - * - The output array contains the following data types: + * - When not provided a data type "kind", the function returns an array containing the following data types: * * - `binary`: binary. * - `complex64`: single-precision complex floating-point numbers. @@ -235,31 +254,98 @@ interface Namespace { * - `uint8`: unsigned 8-bit integers. * - `uint8c`: unsigned clamped 8-bit integers. * + * @param kind - data type kind * @returns list of ndarray data types * * @example * var list = ns.ndarrayDataTypes(); * // returns [...] + * + * @example + * var list = ns.ndarrayDataTypes( 'floating_point' ); + * // returns [...] */ ndarrayDataTypes: typeof ndarrayDataTypes; + /** + * Creates an uninitialized array having a specified shape and data type. + * + * @param shape - array shape + * @param options - options + * @param options.dtype - underlying data type (default: 'float64') + * @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major') + * @param options.mode - specifies how to handle a linear index which exceeds array dimensions + * @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis + * @returns zero-filled array + * + * @example + * var arr = ns.ndempty( [ 2, 2 ] ); + * // returns + * + * var sh = arr.shape; + * // returns [ 2, 2 ] + * + * var dt = arr.dtype; + * // returns 'float64' + */ + ndempty: typeof ndempty; + + /** + * Creates an uninitialized array having the same shape and data type as a provided input ndarray. + * + * @param x - input array + * @param options - options + * @param options.dtype - output array data type + * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style) + * @param options.shape - output array shape + * @param options.mode - specifies how to handle a linear index which exceeds array dimensions + * @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis + * @returns output array + * + * @example + * var zeros = require( `@stdlib/ndarray/zeros` ); + * + * var x = zeros( [ 2, 2 ], { + * 'dtype': 'float64' + * }); + * // returns + * + * var sh = x.shape; + * // returns [ 2, 2 ] + * + * var dt = x.dtype; + * // returns 'generic' + * + * var y = ns.ndemptyLike( x ); + * // returns + * + * sh = y.shape; + * // returns [ 2, 2 ] + * + * dt = y.dtype; + * // returns 'generic' + */ + ndemptyLike: typeof ndemptyLike; + /** * Returns a zero-dimensional ndarray containing a provided scalar value. * * ## Notes * - * - If `dtype` is not provided and `value` + * - If a `dtype` option is not provided and `value` * * - is a `number`, the default data type is `'float64'`. * - is a complex number object, the default data type is `'complex128'`. * - is any other value type, the default data type is `'generic'`. * * @param value - scalar value - * @param dtype - array data type + * @param options - options * @returns zero-dimensional ndarray * * @example - * var x = ns.scalar2ndarray( 1.0, 'generic' ); + * var x = ns.scalar2ndarray( 1.0, { + * 'dtype': generic' + * }); * // returns * * var sh = x.shape; @@ -386,6 +472,34 @@ interface Namespace { */ ndarrayOrders: typeof ndarrayOrders; + /** + * Returns a list of output ndarray data type policies. + * + * ## Notes + * + * - The output array contains the following data type policies: + * + * - `same`: return the same data type. + * - `promoted`: return a promoted data type. + * - `bool`: return a boolean data type. + * - `numeric`: return a numeric data type. + * - `real`: return a real-valued data type. + * - `signed_integer`: return a signed integer data type. + * - `unsigned_integer`: return an unsigned integer data type. + * - `integer`: return an integer data type (i.e., either signed or unsigned). + * - `floating_point`: return a floating-point data type (i.e., either real-valued or complex-valued). + * - `real_floating_point`: return a real-valued floating-point data type. + * - `complex_floating_point`: return a complex-valued floating-point data type. + * - `default`: return the default data type. + * + * @returns list of data type policies + * + * @example + * var list = ns.ndarrayOutputDataTypePolicies(); + * // returns [...] + */ + ndarrayOutputDataTypePolicies: typeof ndarrayOutputDataTypePolicies; + /** * Returns a type promotion table displaying the ndarray data types with the smallest size and closest "kind" to which ndarray data types can be safely cast. * @@ -482,6 +596,9 @@ interface Namespace { * @param options - options * @param options.dtype - underlying data type (default: 'float64') * @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major') + * @param options.mode - specifies how to handle a linear index which exceeds array dimensions + * @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis + * @param options.readonly - boolean indicating whether an array should be read-only * @returns zero-filled array * * @example @@ -504,6 +621,9 @@ interface Namespace { * @param options.dtype - output array data type * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style) * @param options.shape - output array shape + * @param options.mode - specifies how to handle a linear index which exceeds array dimensions + * @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis + * @param options.readonly - boolean indicating whether an array should be read-only * @returns zero-filled array * * @example