├── NOTICE ├── ctor └── benchmark │ └── julia │ └── REQUIRE ├── index └── lib │ └── kinds.json ├── ind2sub ├── benchmark │ └── julia │ │ └── REQUIRE └── lib │ └── defaults.json ├── sub2ind ├── benchmark │ └── julia │ │ └── REQUIRE └── lib │ └── defaults.json ├── any └── lib │ └── defaults.json ├── base ├── ind2sub │ ├── benchmark │ │ └── julia │ │ │ └── REQUIRE │ └── manifest.json ├── sub2ind │ ├── benchmark │ │ └── julia │ │ │ └── REQUIRE │ └── manifest.json ├── unary-strided1d-dispatch │ └── lib │ │ └── defaults.json ├── nullary-strided1d-dispatch │ └── lib │ │ └── defaults.json ├── binary-reduce-strided1d-dispatch │ └── lib │ │ └── defaults.json ├── unary-reduce-strided1d-dispatch-by │ └── lib │ │ └── defaults.json ├── unary-reduce-strided1d-dispatch │ └── lib │ │ └── defaults.json ├── dtype-objects │ └── docs │ │ └── repl.txt ├── dtype-enums │ └── docs │ │ └── repl.txt ├── dtype-char │ ├── lib │ │ └── types.txt │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── numel │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── ndims │ └── docs │ │ └── repl.txt ├── dtype │ └── docs │ │ └── repl.txt ├── ndarraylike2scalar │ └── docs │ │ └── repl.txt ├── buffer-ctors │ ├── docs │ │ └── repl.txt │ └── examples │ │ └── index.js ├── offset │ └── docs │ │ └── repl.txt ├── bytes-per-element │ ├── lib │ │ └── bytes_per_element.json │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── ndarraylike2ndarray │ └── docs │ │ └── repl.txt ├── nullary-tiling-block-size │ └── docs │ │ └── repl.txt ├── flag │ └── docs │ │ └── repl.txt ├── singleton-dimensions │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── nonsingleton-dimensions │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── buffer │ ├── docs │ │ └── repl.txt │ └── examples │ │ └── index.js ├── data-buffer │ └── docs │ │ └── repl.txt ├── min-unsigned-integer-dtype │ └── docs │ │ └── repl.txt ├── dtype-enum2str │ └── docs │ │ └── repl.txt ├── output-policy-enum2str │ └── docs │ │ └── repl.txt ├── wrap-index │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── clamp-index │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── dtype-resolve-str │ └── docs │ │ ├── repl.txt │ │ └── types │ │ └── test.ts ├── min-signed-integer-dtype │ └── docs │ │ └── repl.txt ├── dtype2c │ ├── docs │ │ └── repl.txt │ └── lib │ │ └── table.json ├── output-policy-resolve-str │ └── docs │ │ ├── repl.txt │ │ └── types │ │ └── test.ts ├── order │ └── docs │ │ └── repl.txt ├── assert │ ├── is-row-major │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-column-major │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-row-major-string │ │ └── docs │ │ │ └── repl.txt │ ├── is-order │ │ └── docs │ │ │ └── repl.txt │ ├── is-column-major-string │ │ └── docs │ │ │ └── repl.txt │ ├── has-equal-shape │ │ └── docs │ │ │ └── repl.txt │ ├── is-data-type-object │ │ └── docs │ │ │ └── repl.txt │ ├── is-index-mode │ │ └── docs │ │ │ └── repl.txt │ ├── is-read-only │ │ └── docs │ │ │ └── repl.txt │ ├── is-scalar-mostly-safe-compatible │ │ └── docs │ │ │ └── repl.txt │ ├── is-buffer-length-compatible-shape │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-input-casting-policy │ │ └── docs │ │ │ └── repl.txt │ ├── is-equal-data-type │ │ └── docs │ │ │ └── repl.txt │ ├── is-output-data-type-policy │ │ └── docs │ │ │ └── repl.txt │ ├── is-safe-data-type-cast │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-mostly-safe-data-type-cast │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-same-kind-data-type-cast │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── examples │ │ └── index.js │ ├── is-casting-mode │ │ └── docs │ │ │ └── repl.txt │ ├── is-contiguous │ │ ├── manifest.json │ │ └── docs │ │ │ └── repl.txt │ ├── is-buffer-length-compatible │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── docs │ │ └── types │ │ │ └── test.ts │ ├── is-single-segment-compatible │ │ ├── docs │ │ │ └── repl.txt │ │ └── manifest.json │ ├── is-row-major-contiguous │ │ ├── manifest.json │ │ └── docs │ │ │ └── repl.txt │ └── is-column-major-contiguous │ │ └── manifest.json ├── complement-shape │ └── docs │ │ └── repl.txt ├── from-array │ └── docs │ │ └── repl.txt ├── unary-tiling-block-size │ └── docs │ │ └── repl.txt ├── unary-output-dtype │ └── docs │ │ └── repl.txt ├── strides2offset │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── normalize-index │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── output-dtype │ └── docs │ │ └── repl.txt ├── buffer-dtype │ └── docs │ │ └── repl.txt ├── dtype-str2enum │ └── docs │ │ └── repl.txt ├── to-normalized-indices │ └── docs │ │ └── repl.txt ├── output-policy-str2enum │ └── docs │ │ └── repl.txt ├── dtypes2enums │ └── docs │ │ └── repl.txt ├── buffer-dtype-enum │ └── docs │ │ └── repl.txt ├── promote-dtypes │ └── docs │ │ └── repl.txt ├── to-unique-normalized-indices │ └── docs │ │ └── repl.txt ├── binary-tiling-block-size │ └── docs │ │ └── repl.txt ├── to-reversed │ └── docs │ │ └── repl.txt ├── numel-dimension │ └── docs │ │ └── repl.txt ├── to-flippedlr │ └── docs │ │ └── repl.txt ├── to-flippedud │ └── docs │ │ └── repl.txt ├── unary-input-casting-dtype │ └── docs │ │ └── repl.txt ├── flatten-shape │ └── manifest.json ├── iteration-order │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── strides2order │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── broadcast-shapes │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── dtype-desc │ └── docs │ │ └── repl.txt ├── flatten-shape-from │ └── manifest.json ├── dtypes2signatures │ └── docs │ │ └── repl.txt ├── max-view-buffer-index │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── min-view-buffer-index │ ├── manifest.json │ └── docs │ │ └── repl.txt ├── minmax-view-buffer-index │ └── manifest.json ├── dtype-resolve-enum │ └── docs │ │ ├── repl.txt │ │ └── types │ │ └── test.ts ├── normalize-indices │ └── docs │ │ └── repl.txt ├── output-policy-resolve-enum │ └── docs │ │ ├── repl.txt │ │ └── types │ │ └── test.ts ├── dtype-alignment │ ├── docs │ │ └── repl.txt │ └── manifest.json ├── shape2strides │ └── manifest.json ├── function-object │ ├── examples │ │ └── index.js │ ├── lib │ │ └── browser.js │ └── docs │ │ └── types │ │ ├── test.ts │ │ └── index.d.ts ├── napi │ ├── addon-arguments │ │ ├── manifest.json │ │ ├── examples │ │ │ └── index.js │ │ ├── lib │ │ │ └── browser.js │ │ └── docs │ │ │ └── types │ │ │ ├── test.ts │ │ │ └── index.d.ts │ ├── dtype-string-to-dtype │ │ ├── manifest.json │ │ ├── lib │ │ │ ├── browser.js │ │ │ └── main.js │ │ └── docs │ │ │ └── types │ │ │ ├── test.ts │ │ │ └── index.d.ts │ ├── examples │ │ └── index.js │ ├── typedarray-type-to-dtype │ │ ├── manifest.json │ │ ├── lib │ │ │ ├── browser.js │ │ │ └── main.js │ │ └── docs │ │ │ └── types │ │ │ ├── test.ts │ │ │ └── index.d.ts │ ├── unary │ │ ├── examples │ │ │ └── index.js │ │ ├── lib │ │ │ └── browser.js │ │ ├── docs │ │ │ └── types │ │ │ │ ├── test.ts │ │ │ │ └── index.d.ts │ │ └── manifest.json │ ├── lib │ │ └── browser.js │ ├── manifest.json │ ├── docs │ │ └── types │ │ │ ├── test.ts │ │ │ └── index.d.ts │ ├── include │ │ └── stdlib │ │ │ └── ndarray │ │ │ └── base │ │ │ └── napi.h │ └── test │ │ └── test.browser.js ├── stride │ └── docs │ │ └── repl.txt ├── zeros │ └── docs │ │ └── repl.txt ├── bind2vind │ └── manifest.json ├── vind2bind │ └── manifest.json ├── examples │ └── index.js ├── char2dtype │ └── docs │ │ └── repl.txt ├── binary-input-casting-dtype │ └── docs │ │ └── repl.txt ├── flags │ └── docs │ │ └── repl.txt ├── shape │ └── docs │ │ └── repl.txt ├── prepend-singleton-dimensions │ └── docs │ │ └── repl.txt ├── strides │ └── docs │ │ └── repl.txt ├── docs │ └── types │ │ └── test.ts ├── every │ └── scripts │ │ └── lib │ │ └── exclude_dtypes.js ├── binary-output-dtype │ └── docs │ │ └── repl.txt ├── count-falsy │ └── scripts │ │ └── lib │ │ └── exclude_dtypes.js ├── count-truthy │ └── scripts │ │ └── lib │ │ └── exclude_dtypes.js ├── ind │ └── manifest.json ├── reverse │ └── docs │ │ └── repl.txt ├── to-reversed-dimension │ └── docs │ │ └── repl.txt ├── unary │ └── scripts │ │ └── lib │ │ └── exclude_dtypes.js ├── from-scalar │ └── docs │ │ └── repl.txt └── remove-singleton-dimensions │ └── docs │ └── repl.txt ├── find └── lib │ └── defaults.json ├── orders ├── lib │ └── orders.json ├── docs │ ├── repl.txt │ └── types │ │ └── test.ts └── manifest.json ├── some └── lib │ └── defaults.json ├── any-by └── lib │ └── defaults.json ├── count-if └── lib │ └── defaults.json ├── every └── lib │ └── defaults.json ├── includes └── lib │ └── defaults.json ├── some-by └── lib │ └── defaults.json ├── count-falsy └── lib │ └── defaults.json ├── count-truthy └── lib │ └── defaults.json ├── index-modes ├── lib │ └── modes.json ├── manifest.json └── docs │ ├── repl.txt │ └── types │ └── test.ts ├── input-casting-policies ├── lib │ └── policies.json ├── manifest.json └── docs │ ├── repl.txt │ └── types │ └── test.ts ├── .eslintrc.js ├── casting-modes ├── lib │ └── modes.json ├── manifest.json └── docs │ ├── repl.txt │ └── types │ └── test.ts ├── SECURITY.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── next-dtype ├── lib │ └── next_dtypes.json ├── manifest.json └── docs │ └── repl.txt ├── flags └── docs │ └── repl.txt ├── ndims └── docs │ └── repl.txt ├── numel └── docs │ └── repl.txt ├── shape └── docs │ └── repl.txt ├── strides └── docs │ └── repl.txt ├── dtype └── docs │ └── repl.txt ├── offset └── docs │ └── repl.txt ├── flag └── docs │ └── repl.txt ├── data-buffer └── docs │ └── repl.txt ├── to-array └── docs │ └── repl.txt ├── order └── docs │ └── repl.txt ├── to-json └── docs │ └── repl.txt ├── CITATION.cff ├── dtypes └── manifest.json ├── with ├── docs │ └── repl.txt └── examples │ └── index.js ├── numel-dimension └── docs │ └── repl.txt ├── output-dtype-policies ├── manifest.json ├── lib │ └── policies.json └── docs │ └── types │ └── test.ts ├── safe-casts ├── docs │ └── repl.txt └── manifest.json ├── promotion-rules ├── manifest.json └── docs │ └── repl.txt ├── same-kind-casts ├── manifest.json └── docs │ └── repl.txt ├── mostly-safe-casts ├── manifest.json └── docs │ └── repl.txt ├── to-reversed └── docs │ └── repl.txt ├── stride └── docs │ └── repl.txt ├── reverse ├── docs │ └── repl.txt └── examples │ └── index.js ├── for-each └── docs │ └── repl.txt ├── fliplr ├── docs │ └── repl.txt └── examples │ └── index.js ├── examples └── index.js ├── flipud ├── docs │ └── repl.txt └── examples │ └── index.js ├── iter ├── examples │ └── index.js └── docs │ └── types │ └── test.ts ├── vector ├── examples │ └── index.js └── docs │ └── types │ └── test.ts ├── at └── docs │ └── repl.txt ├── min-dtype └── docs │ └── repl.txt ├── docs └── types │ └── test.ts ├── .github └── PULL_REQUEST_TEMPLATE.md ├── dispatch-by └── test │ └── fixtures │ └── nullary.js ├── dispatch └── test │ └── fixtures │ └── nullary.js └── .npmrc /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2025 The Stdlib Authors. 2 | -------------------------------------------------------------------------------- /ctor/benchmark/julia/REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.5 2 | BenchmarkTools 0.5.0 3 | -------------------------------------------------------------------------------- /index/lib/kinds.json: -------------------------------------------------------------------------------- 1 | [ 2 | "linear", 3 | "cartesian" 4 | ] 5 | -------------------------------------------------------------------------------- /ind2sub/benchmark/julia/REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.5 2 | BenchmarkTools 0.5.0 3 | -------------------------------------------------------------------------------- /sub2ind/benchmark/julia/REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.5 2 | BenchmarkTools 0.5.0 3 | -------------------------------------------------------------------------------- /any/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /base/ind2sub/benchmark/julia/REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.5 2 | BenchmarkTools 0.5.0 3 | -------------------------------------------------------------------------------- /base/sub2ind/benchmark/julia/REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.5 2 | BenchmarkTools 0.5.0 3 | -------------------------------------------------------------------------------- /base/unary-strided1d-dispatch/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null 3 | } 4 | -------------------------------------------------------------------------------- /find/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /orders/lib/orders.json: -------------------------------------------------------------------------------- 1 | [ 2 | "row-major", 3 | "column-major" 4 | ] 5 | -------------------------------------------------------------------------------- /some/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /any-by/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /base/nullary-strided1d-dispatch/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null 3 | } 4 | -------------------------------------------------------------------------------- /count-if/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /every/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /includes/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /some-by/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /count-falsy/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /count-truthy/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /ind2sub/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "mode": "throw", 3 | "order": "row-major" 4 | } 5 | -------------------------------------------------------------------------------- /sub2ind/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "mode": [ "throw" ], 3 | "order": "row-major" 4 | } 5 | -------------------------------------------------------------------------------- /index-modes/lib/modes.json: -------------------------------------------------------------------------------- 1 | [ 2 | "throw", 3 | "normalize", 4 | "clamp", 5 | "wrap" 6 | ] 7 | -------------------------------------------------------------------------------- /base/binary-reduce-strided1d-dispatch/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /base/unary-reduce-strided1d-dispatch-by/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /base/unary-reduce-strided1d-dispatch/lib/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "dims": null, 3 | "keepdims": false 4 | } 5 | -------------------------------------------------------------------------------- /input-casting-policies/lib/policies.json: -------------------------------------------------------------------------------- 1 | [ 2 | "none", 3 | "promoted", 4 | "accumulation", 5 | "output" 6 | ] 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ 2 | -------------------------------------------------------------------------------- /casting-modes/lib/modes.json: -------------------------------------------------------------------------------- 1 | [ 2 | "none", 3 | "equiv", 4 | "safe", 5 | "mostly-safe", 6 | "same-kind", 7 | "unsafe" 8 | ] 9 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | > Policy for reporting security vulnerabilities. 4 | 5 | See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | stdlib expects community participants to adhere to the project Code of Conduct. The [full text](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md) is available in the main project repository. 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Woot woot! If you are new to stdlib, welcome! And thanks for your interest! Guidelines for how to contribute to the project are [available](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) in the main project repository. 4 | -------------------------------------------------------------------------------- /base/dtype-objects/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns an object mapping supported data type strings to data type objects. 4 | 5 | Returns 6 | ------- 7 | out: Object 8 | Object mapping supported data type strings to data type objects. 9 | 10 | Examples 11 | -------- 12 | > var out = {{alias}}() 13 | {...} 14 | 15 | See Also 16 | -------- 17 | 18 | -------------------------------------------------------------------------------- /base/dtype-enums/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns an object mapping supported data type strings to enumeration 4 | constants. 5 | 6 | Returns 7 | ------- 8 | out: Object 9 | Object mapping supported data type strings to enumeration constants. 10 | 11 | Examples 12 | -------- 13 | > var out = {{alias}}() 14 | {...} 15 | 16 | See Also 17 | -------- 18 | 19 | -------------------------------------------------------------------------------- /base/dtype-char/lib/types.txt: -------------------------------------------------------------------------------- 1 | a: uint8c 2 | b: uint8 3 | c: complex64 (32-bit) 4 | d: float64 5 | e: bfloat16 6 | f: float32 7 | g: float128 8 | h: float16 9 | i: int32 10 | j: complex32 (16-bit) 11 | k: int16 12 | l: int64 13 | m: int128 14 | n: int256 15 | o: generic 16 | p: 17 | q: 18 | r: binary 19 | s: int8 20 | t: uint16 21 | u: uint32 22 | v: uint64 23 | w: uint128 24 | x: bool 25 | y: uint256 26 | z: complex128 (64-bit) 27 | -------------------------------------------------------------------------------- /base/numel/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape ) 3 | Returns the number of elements in an array. 4 | 5 | Parameters 6 | ---------- 7 | shape: Array 8 | Array shape. 9 | 10 | Returns 11 | ------- 12 | n: integer 13 | Number of elements. 14 | 15 | Examples 16 | -------- 17 | > var n = {{alias}}( [ 3, 3, 3 ] ) 18 | 27 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /next-dtype/lib/next_dtypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "float64": -1, 3 | "float32": "float64", 4 | "float16": "float32", 5 | "int32": -1, 6 | "int16": "int32", 7 | "int8": "int16", 8 | "uint32": -1, 9 | "uint16": "uint32", 10 | "uint8": "uint16", 11 | "uint8c": "uint16", 12 | "complex32": "complex64", 13 | "complex64": "complex128", 14 | "complex128": -1, 15 | "generic": -1, 16 | "binary": -1, 17 | "bool": -1 18 | } 19 | -------------------------------------------------------------------------------- /flags/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the flags of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | out: Object 13 | Flags. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | {...} 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /ndims/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the number of ndarray dimensions. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | n: integer 13 | Number of dimensions. 14 | 15 | Examples 16 | -------- 17 | > var n = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | 3 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /base/ndims/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the number of ndarray dimensions. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | n: integer 13 | Number of dimensions. 14 | 15 | Examples 16 | -------- 17 | > var n = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | 3 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /numel/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the number of elements in an ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | n: integer 13 | Number of elements. 14 | 15 | Examples 16 | -------- 17 | > var n = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | 27 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /shape/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the shape of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | out: Array 13 | Shape. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | [ 3, 3, 3 ] 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /strides/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the strides of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | out: Array 13 | Strides. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 18 | [ 9, 3, 1 ] 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the data type of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | dt: string 13 | Data type. 14 | 15 | Examples 16 | -------- 17 | > var opts = { 'dtype': 'float64' }; 18 | > var dt = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 19 | 'float64' 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the data type of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | dt: string 13 | Data type. 14 | 15 | Examples 16 | -------- 17 | > var opts = { 'dtype': 'float64' }; 18 | > var dt = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 19 | 'float64' 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/ndarraylike2scalar/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Converts an ndarray-like object to a scalar value. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarrayLike 8 | Input ndarray-like object. 9 | 10 | Returns 11 | ------- 12 | out: any 13 | Scalar value. 14 | 15 | Examples 16 | -------- 17 | > var arr = {{alias:@stdlib/ndarray/from-scalar}}( 1.0 ); 18 | > var out = {{alias}}( arr ) 19 | 1.0 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/buffer-ctors/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns an ndarray data buffer constructor. 4 | 5 | Parameters 6 | ---------- 7 | dtype: string|DataType 8 | Data type. 9 | 10 | Returns 11 | ------- 12 | out: Function|null 13 | Data buffer constructor. 14 | 15 | Examples 16 | -------- 17 | > var ctor = {{alias}}( 'float64' ) 18 | 19 | > ctor = {{alias}}( 'float' ) 20 | null 21 | 22 | See Also 23 | -------- 24 | 25 | -------------------------------------------------------------------------------- /offset/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the index offset specifying the underlying buffer index of the first 4 | iterated ndarray element. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input ndarray. 10 | 11 | Returns 12 | ------- 13 | n: integer 14 | Index offset. 15 | 16 | Examples 17 | -------- 18 | > var n = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 19 | 0 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/offset/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the index offset specifying the underlying buffer index of the first 4 | iterated ndarray element. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input ndarray. 10 | 11 | Returns 12 | ------- 13 | n: integer 14 | Index offset. 15 | 16 | Examples 17 | -------- 18 | > var n = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ) ) 19 | 0 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /orders/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns a list of ndarray orders. 4 | 5 | The output array contains the following orders: 6 | 7 | - row-major: row-major (C-style) order. 8 | - column-major: column-major (Fortran-style) order. 9 | 10 | Returns 11 | ------- 12 | out: Array 13 | List of ndarray orders. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}() 18 | [ 'row-major', 'column-major' ] 19 | 20 | See Also 21 | -------- 22 | 23 | -------------------------------------------------------------------------------- /base/bytes-per-element/lib/bytes_per_element.json: -------------------------------------------------------------------------------- 1 | { 2 | "binary": 1, 3 | "bool": 1, 4 | "complex64": 8, 5 | "complex128": 16, 6 | "float16": 2, 7 | "bfloat16": 2, 8 | "float32": 4, 9 | "float64": 8, 10 | "float128": 16, 11 | "generic": null, 12 | "int8": 1, 13 | "int16": 2, 14 | "int32": 4, 15 | "int64": 8, 16 | "int128": 16, 17 | "int256": 32, 18 | "uint8": 1, 19 | "uint8c": 1, 20 | "uint16": 2, 21 | "uint32": 4, 22 | "uint64": 8, 23 | "uint128": 16, 24 | "uint256": 32 25 | } 26 | -------------------------------------------------------------------------------- /base/ndarraylike2ndarray/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Converts an ndarray-like object to an ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarrayLike 8 | Input ndarray-like object. 9 | 10 | Returns 11 | ------- 12 | out: ndarray 13 | Output array. 14 | 15 | Examples 16 | -------- 17 | > var arr = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 18 | > var out = {{alias}}( arr ) 19 | 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/nullary-tiling-block-size/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypeX ) 3 | Returns a loop block size for multi-dimensional array tiled loops. 4 | 5 | Parameters 6 | ---------- 7 | dtypeX: string 8 | Array data type. 9 | 10 | Returns 11 | ------- 12 | out: integer 13 | Block size. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}( 'float64' ) 18 | 19 | > out = {{alias}}( 'int32' ) 20 | 21 | 22 | See Also 23 | -------- 24 | 25 | -------------------------------------------------------------------------------- /flag/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, name ) 3 | Returns a specified flag for a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | name: string|symbol 11 | Flag name. 12 | 13 | Returns 14 | ------- 15 | out: any 16 | Flag value. 17 | 18 | Examples 19 | -------- 20 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), 'READONLY' ) 21 | 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /base/flag/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, name ) 3 | Returns a specified flag for a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | name: string|symbol 11 | Flag name. 12 | 13 | Returns 14 | ------- 15 | out: any 16 | Flag value. 17 | 18 | Examples 19 | -------- 20 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), 'READONLY' ) 21 | 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /base/singleton-dimensions/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape ) 3 | Returns the number of singleton dimensions. 4 | 5 | A singleton dimension is a dimension whose size is equal to `1`. 6 | 7 | Parameters 8 | ---------- 9 | shape: Array 10 | Array shape. 11 | 12 | Returns 13 | ------- 14 | n: integer 15 | Number of singleton dimensions. 16 | 17 | Examples 18 | -------- 19 | > var n = {{alias}}( [ 3, 1, 3 ] ) 20 | 1 21 | 22 | See Also 23 | -------- 24 | 25 | -------------------------------------------------------------------------------- /base/nonsingleton-dimensions/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape ) 3 | Returns the number of non-singleton dimensions. 4 | 5 | A singleton dimension is a dimension whose size is equal to `1`. 6 | 7 | Parameters 8 | ---------- 9 | shape: Array 10 | Array shape. 11 | 12 | Returns 13 | ------- 14 | n: integer 15 | Number of non-singleton dimensions. 16 | 17 | Examples 18 | -------- 19 | > var n = {{alias}}( [ 3, 1, 3 ] ) 20 | 2 21 | 22 | See Also 23 | -------- 24 | 25 | -------------------------------------------------------------------------------- /data-buffer/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the underlying data buffer of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | out: ArrayLikeObject 13 | Underlying data buffer. 14 | 15 | Examples 16 | -------- 17 | > var opts = { 'dtype': 'float64' }; 18 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 19 | 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /to-array/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Converts an ndarray to a generic array. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input array. 9 | 10 | Returns 11 | ------- 12 | out: Array|Array 13 | Generic array (which may include nested arrays). 14 | 15 | Examples 16 | -------- 17 | > var arr = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 18 | > var out = {{alias}}( arr ) 19 | [ [ 1, 2 ], [ 3, 4 ] ] 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/buffer/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype, size ) 3 | Returns a contiguous linear ndarray data buffer. 4 | 5 | Parameters 6 | ---------- 7 | dtype: string 8 | Data type. 9 | 10 | size: integer 11 | Buffer size. 12 | 13 | Returns 14 | ------- 15 | out: Array|TypedArray|Buffer 16 | Contiguous ndarray data buffer. 17 | 18 | Examples 19 | -------- 20 | > var buf = {{alias}}( 'float64', 3 ) 21 | [ 0.0, 0.0, 0.0 ] 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /base/data-buffer/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the underlying data buffer of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | out: ArrayLikeObject 13 | Underlying data buffer. 14 | 15 | Examples 16 | -------- 17 | > var opts = { 'dtype': 'float64' }; 18 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 19 | 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/min-unsigned-integer-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Returns the minimum ndarray data type for storing a provided unsigned 4 | integer value. 5 | 6 | Parameters 7 | ---------- 8 | value: number 9 | Unsigned integer value. 10 | 11 | Returns 12 | ------- 13 | dt: string 14 | ndarray data type. 15 | 16 | Examples 17 | -------- 18 | > var dt = {{alias}}( 3 ) 19 | 'uint8' 20 | > dt = {{alias}}( 1280 ) 21 | 'uint16' 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /base/dtype-enum2str/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the data type string associated with an ndarray data type 4 | enumeration constant. 5 | 6 | Parameters 7 | ---------- 8 | dtype: integer 9 | Data type enumeration constant. 10 | 11 | Returns 12 | ------- 13 | out: string|null 14 | Data type string. 15 | 16 | Examples 17 | -------- 18 | > var out = {{alias}}( {{alias:@stdlib/ndarray/base/dtype-str2enum}}( 'float64' ) ) 19 | 'float64' 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/output-policy-enum2str/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( policy ) 3 | Returns the policy string associated with an output ndarray data type policy 4 | enumeration constant. 5 | 6 | Parameters 7 | ---------- 8 | policy: integer 9 | Policy enumeration constant. 10 | 11 | Returns 12 | ------- 13 | out: string|null 14 | Policy string. 15 | 16 | Examples 17 | -------- 18 | > var out = {{alias}}( {{alias:@stdlib/ndarray/base/output-policy-str2enum}}( 'same' ) ) 19 | 'same' 20 | 21 | See Also 22 | -------- 23 | 24 | -------------------------------------------------------------------------------- /base/wrap-index/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( idx, max ) 3 | Wraps an index on the interval `[0,max]`. 4 | 5 | Parameters 6 | ---------- 7 | idx: integer 8 | Index to wrap. 9 | 10 | max: integer 11 | Maximum index value. 12 | 13 | Returns 14 | ------- 15 | out: integer 16 | Wrapped index. 17 | 18 | Examples 19 | -------- 20 | > var idx = {{alias}}( 2, 10 ) 21 | 2 22 | > idx = {{alias}}( -4, 10 ) 23 | 7 24 | > idx = {{alias}}( 13, 10 ) 25 | 2 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/clamp-index/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( idx, max ) 3 | Restricts an index to the interval [0,max]. 4 | 5 | Parameters 6 | ---------- 7 | idx: integer 8 | Index to clamp. 9 | 10 | max: integer 11 | Maximum index value. 12 | 13 | Returns 14 | ------- 15 | out: integer 16 | Clamped index. 17 | 18 | Examples 19 | -------- 20 | > var idx = {{alias}}( 2, 10 ) 21 | 2 22 | > idx = {{alias}}( -5, 10 ) 23 | 0 24 | > idx = {{alias}}( 15, 10 ) 25 | 10 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/dtype-resolve-str/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the data type string associated with a supported data type value. 4 | 5 | Parameters 6 | ---------- 7 | dtype: any 8 | Data type value. 9 | 10 | Returns 11 | ------- 12 | out: string|null 13 | Data type string. 14 | 15 | Examples 16 | -------- 17 | > var out = {{alias}}( 'float64' ) 18 | 'float64' 19 | > out = {{alias}}( {{alias:@stdlib/ndarray/base/dtype-str2enum}}( 'float64' ) ) 20 | 'float64' 21 | 22 | See Also 23 | -------- 24 | 25 | -------------------------------------------------------------------------------- /base/min-signed-integer-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Returns the minimum ndarray data type for storing a provided signed integer 4 | value. 5 | 6 | Parameters 7 | ---------- 8 | value: number 9 | Signed integer value. 10 | 11 | Returns 12 | ------- 13 | dt: string 14 | ndarray data type. 15 | 16 | Examples 17 | -------- 18 | > var dt = {{alias}}( 3 ) 19 | 'int8' 20 | > dt = {{alias}}( -3 ) 21 | 'int8' 22 | > dt = {{alias}}( 1280 ) 23 | 'int16' 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/dtype2c/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the C data type associated with a provided data type value. 4 | 5 | If provided an unknown/unsupported data type, the function returns `null`. 6 | 7 | Parameters 8 | ---------- 9 | dtype: any 10 | Data type value. 11 | 12 | Returns 13 | ------- 14 | out: string|null 15 | C data type. 16 | 17 | Examples 18 | -------- 19 | > var out = {{alias}}( 'float64' ) 20 | 'double' 21 | > out = {{alias}}( 'foobar' ) 22 | null 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/output-policy-resolve-str/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( policy ) 3 | Returns the policy string associated with a supported data type policy 4 | value. 5 | 6 | Parameters 7 | ---------- 8 | policy: any 9 | Policy value. 10 | 11 | Returns 12 | ------- 13 | out: string|null 14 | Policy string. 15 | 16 | Examples 17 | -------- 18 | > var out = {{alias}}( 'same' ) 19 | 'same' 20 | > out = {{alias}}( {{alias:@stdlib/ndarray/base/output-policy-str2enum}}( 'same' ) ) 21 | 'same' 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /order/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the layout order of a provided ndarray. 4 | 5 | If unable to resolve a layout order, the function returns `null`. 6 | 7 | Parameters 8 | ---------- 9 | x: ndarray 10 | Input ndarray. 11 | 12 | Returns 13 | ------- 14 | out: string|null 15 | Layout order. 16 | 17 | Examples 18 | -------- 19 | > var opts = { 'order': 'row-major' }; 20 | > var dt = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 21 | 'row-major' 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /base/order/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns the layout order of a provided ndarray. 4 | 5 | If unable to resolve a layout order, the function returns `null`. 6 | 7 | Parameters 8 | ---------- 9 | x: ndarray 10 | Input ndarray. 11 | 12 | Returns 13 | ------- 14 | out: string|null 15 | Layout order. 16 | 17 | Examples 18 | -------- 19 | > var opts = { 'order': 'row-major' }; 20 | > var dt = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ], opts ) ) 21 | 'row-major' 22 | 23 | See Also 24 | -------- 25 | 26 | -------------------------------------------------------------------------------- /to-json/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Serializes an ndarray as a JSON object. 4 | 5 | This function does *not* serialize data outside of the buffer region defined 6 | by the ndarray view. 7 | 8 | Parameters 9 | ---------- 10 | x: ndarray 11 | Input ndarray. 12 | 13 | Returns 14 | ------- 15 | out: Object 16 | JSON object. 17 | 18 | Examples 19 | -------- 20 | > var arr = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 21 | > var out = {{alias}}( arr ) 22 | {...} 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/assert/is-row-major/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( strides ) 3 | Infers whether an array is row-major based on a provided stride array. 4 | 5 | Parameters 6 | ---------- 7 | strides: ArrayLike 8 | Stride array. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating whether an array is row-major. 14 | 15 | Examples 16 | -------- 17 | > var s = [ 30, -10, 1 ]; 18 | > var bool = {{alias}}( s ) 19 | true 20 | > s = [ 1, 10, 30 ]; 21 | > bool = {{alias}}( s ) 22 | false 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/complement-shape/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, dims ) 3 | Returns the shape defined by the dimensions which are not included in a list 4 | of dimensions. 5 | 6 | Parameters 7 | ---------- 8 | shape: ArrayLike 9 | Array shape. 10 | 11 | dims: ArrayLike 12 | List of dimensions. 13 | 14 | Returns 15 | ------- 16 | out: Array 17 | Output shape. 18 | 19 | Examples 20 | -------- 21 | > var sh = [ 3, 2 ]; 22 | > var out = {{alias}}( sh, [ 1 ] ) 23 | [ 3 ] 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/from-array/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( buf, order ) 3 | Converts an array to a one-dimensional ndarray. 4 | 5 | Parameters 6 | ---------- 7 | buf: ArrayLikeObject 8 | Input array. 9 | 10 | order: string 11 | Memory layout (either 'row-major' or 'column-major'). 12 | 13 | Returns 14 | ------- 15 | out: ndarray 16 | Output array. 17 | 18 | Examples 19 | -------- 20 | > var x = {{alias}}( [ 1, 2, 3 ], 'row-major' ) 21 | 22 | > {{alias:@stdlib/ndarray/shape}}( x ) 23 | [ 3 ] 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/assert/is-column-major/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( strides ) 3 | Infers whether an array is column-major based on a provided stride array. 4 | 5 | Parameters 6 | ---------- 7 | strides: ArrayLike 8 | Stride array. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating whether an array is column-major. 14 | 15 | Examples 16 | -------- 17 | > var s = [ 30, -10, 1 ]; 18 | > var bool = {{alias}}( s ) 19 | false 20 | > s = [ 1, 10, 30 ]; 21 | > bool = {{alias}}( s ) 22 | true 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/unary-tiling-block-size/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypeX, dtypeY ) 3 | Returns a loop block size for multi-dimensional array tiled loops. 4 | 5 | Parameters 6 | ---------- 7 | dtypeX: string 8 | Input array data type. 9 | 10 | dtypeY: string 11 | Output array data type. 12 | 13 | Returns 14 | ------- 15 | out: integer 16 | Block size. 17 | 18 | Examples 19 | -------- 20 | > var out = {{alias}}( 'float64', 'float64' ) 21 | 22 | > out = {{alias}}( 'int32', 'float64' ) 23 | 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/assert/is-row-major-string/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests whether an input value is the string representing row-major order. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean result. 14 | 15 | Examples 16 | -------- 17 | > var bool = {{alias}}( 'row-major' ) 18 | true 19 | > bool = {{alias}}( 'column-major' ) 20 | false 21 | > bool = {{alias}}( '' ) 22 | false 23 | > bool = {{alias}}( 'beep' ) 24 | false 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/assert/is-order/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is an ndarray order. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is an ndarray order. 14 | 15 | Examples 16 | -------- 17 | > var bool = {{alias}}( 'row-major' ) 18 | true 19 | > bool = {{alias}}( 'column-major' ) 20 | true 21 | > bool = {{alias}}( '' ) 22 | false 23 | > bool = {{alias}}( 'beep' ) 24 | false 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/assert/is-column-major-string/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests whether an input value is the string representing column-major order. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean result. 14 | 15 | Examples 16 | -------- 17 | > var bool = {{alias}}( 'column-major' ) 18 | true 19 | > bool = {{alias}}( 'row-major' ) 20 | false 21 | > bool = {{alias}}( '' ) 22 | false 23 | > bool = {{alias}}( 'beep' ) 24 | false 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/unary-output-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype, policy ) 3 | Resolves the output ndarray data type for a unary function. 4 | 5 | Parameters 6 | ---------- 7 | dtype: string 8 | Input ndarray data type. 9 | 10 | policy: string 11 | Output ndarray data type policy. If `policy` is a data type, the 12 | function returns the `policy` value. 13 | 14 | Returns 15 | ------- 16 | out: string 17 | Output ndarray data type. 18 | 19 | Examples 20 | -------- 21 | > var out = {{alias}}( 'float64', 'real' ) 22 | 'float64' 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/strides2offset/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides ) 3 | Returns the index offset which specifies the location of the first indexed 4 | value in a multidimensional array based on a stride array. 5 | 6 | Parameters 7 | ---------- 8 | shape: ArrayLike 9 | Array shape. 10 | 11 | strides: ArrayLike 12 | Stride array. 13 | 14 | Returns 15 | ------- 16 | offset: integer 17 | Index offset. 18 | 19 | Examples 20 | -------- 21 | > var d = [ 2, 3, 10 ]; 22 | > var s = [ 30, -10, 1 ]; 23 | > var out = {{alias}}( d, s ) 24 | 20 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/normalize-index/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( idx, max ) 3 | Normalizes an index to the interval [0,max]. 4 | 5 | If an index exceeds index bounds, the function returns -1. 6 | 7 | Parameters 8 | ---------- 9 | idx: integer 10 | Index to normalize. 11 | 12 | max: integer 13 | Maximum index value. 14 | 15 | Returns 16 | ------- 17 | out: integer 18 | Normalized index. 19 | 20 | Examples 21 | -------- 22 | > var idx = {{alias}}( 2, 10 ) 23 | 2 24 | > idx = {{alias}}( -5, 10 ) 25 | 6 26 | > idx = {{alias}}( 15, 10 ) 27 | -1 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/output-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypes, policy ) 3 | Resolves the output data type from a list of input ndarray data types. 4 | 5 | Parameters 6 | ---------- 7 | dtypes: Array 8 | Input ndarray data types. 9 | 10 | policy: string 11 | Output ndarray data type policy. If `policy` is a data type, the 12 | function returns the `policy` value. 13 | 14 | Returns 15 | ------- 16 | out: string 17 | Output ndarray data type. 18 | 19 | Examples 20 | -------- 21 | > var out = {{alias}}( [ 'float64' ], 'real' ) 22 | 'float64' 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/assert/has-equal-shape/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, y ) 3 | Tests if two ndarrays have the same shape. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | First input ndarray. 9 | 10 | y: ndarray 11 | Second input ndarray. 12 | 13 | Returns 14 | ------- 15 | bool: boolean 16 | Boolean indicating if both ndarrays have the same shape. 17 | 18 | Examples 19 | -------- 20 | > var x = {{alias:@stdlib/ndarray/array}}( [ 1, 2, 3, 4 ] ); 21 | > var y = {{alias:@stdlib/ndarray/array}}( [ 5, 6, 7, 8 ] ); 22 | > var bool = {{alias}}( x, y ) 23 | true 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/assert/is-data-type-object/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is an ndarray data type object. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is an ndarray data type object. 14 | 15 | Examples 16 | -------- 17 | > var dt = new {{alias:@stdlib/ndarray/dtype-ctor}}( 'float64' ); 18 | > var bool = {{alias}}( dt ) 19 | true 20 | > bool = {{alias}}( 'float64' ) 21 | false 22 | > bool = {{alias}}( {} ) 23 | false 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/buffer-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( buffer ) 3 | Returns the data type of an ndarray data buffer. 4 | 5 | If provided a buffer argument having an unknown or unsupported type, the 6 | function returns `null`. 7 | 8 | Parameters 9 | ---------- 10 | buffer: any 11 | ndarray data buffer. 12 | 13 | Returns 14 | ------- 15 | out: string|Function|null 16 | Data type. 17 | 18 | Examples 19 | -------- 20 | > var buf = new {{alias:@stdlib/array/float64}}( 10 ); 21 | > var dt = {{alias}}( buf ) 22 | 'float64' 23 | > dt = {{alias}}( 'beep' ) 24 | null 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/dtype-str2enum/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the enumeration constant associated with an ndarray data type 4 | string. 5 | 6 | Downstream consumers of this function should *not* rely on specific integer 7 | values (e.g., `INT8 == 0`). Instead, the function should be used in an 8 | opaque manner. 9 | 10 | Parameters 11 | ---------- 12 | dtype: string 13 | Data type string. 14 | 15 | Returns 16 | ------- 17 | out: integer|null 18 | Enumeration constant. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float64' ) 23 | 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/dtype2c/lib/table.json: -------------------------------------------------------------------------------- 1 | { 2 | "binary": null, 3 | "bool": "bool", 4 | "complex32": "stdlib_complex32_t", 5 | "complex64": "stdlib_complex64_t", 6 | "complex128": "stdlib_complex128_t", 7 | "float16": "stdlib_float16_t", 8 | "bfloat16": null, 9 | "float32": "float", 10 | "float64": "double", 11 | "float128": null, 12 | "generic": null, 13 | "int8": "int8_t", 14 | "int16": "int16_t", 15 | "int32": "int32_t", 16 | "int64": "int64_t", 17 | "int128": null, 18 | "int256": null, 19 | "uint8": "uint8_t", 20 | "uint8c": null, 21 | "uint16": "uint16_t", 22 | "uint32": "uint32_t", 23 | "uint64": "uint64_t", 24 | "uint128": null, 25 | "uint256": null 26 | } 27 | -------------------------------------------------------------------------------- /base/to-normalized-indices/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( indices, max ) 3 | Normalizes indices to the interval [0,max]. 4 | 5 | If an index exceeds index bounds, the function normalizes the index to -1. 6 | 7 | Parameters 8 | ---------- 9 | indices: Collection 10 | Indices to normalize. 11 | 12 | max: integer 13 | Maximum index value. 14 | 15 | Returns 16 | ------- 17 | out: Collection 18 | Normalized indices. 19 | 20 | Examples 21 | -------- 22 | > var idx = {{alias}}( [ 2, -5 ], 10 ) 23 | [ 2, 6 ] 24 | > idx = {{alias}}( [ 15 ], 10 ) 25 | [ -1 ] 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/output-policy-str2enum/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( policy ) 3 | Returns the enumeration constant associated with an output ndarray data type 4 | policy string. 5 | 6 | Downstream consumers of this function should *not* rely on specific integer 7 | values (e.g., `SAME == 0`). Instead, the function should be used in an 8 | opaque manner. 9 | 10 | Parameters 11 | ---------- 12 | policy: string 13 | Policy string. 14 | 15 | Returns 16 | ------- 17 | out: integer|null 18 | Enumeration constant. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'same' ) 23 | 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/assert/is-index-mode/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is a supported ndarray index mode. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is a supported ndarray index mode. 14 | 15 | Examples 16 | -------- 17 | > var bool = {{alias}}( 'throw' ) 18 | true 19 | > bool = {{alias}}( 'clamp' ) 20 | true 21 | > bool = {{alias}}( 'wrap' ) 22 | true 23 | > bool = {{alias}}( '' ) 24 | false 25 | > bool = {{alias}}( 'beep' ) 26 | false 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/bytes-per-element/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the number of bytes per element for a provided underlying ndarray 4 | data type. 5 | 6 | If provided an unknown/unsupported data type, the function returns `null`. 7 | 8 | Parameters 9 | ---------- 10 | dtype: string|DataType 11 | Data type. 12 | 13 | Returns 14 | ------- 15 | nbytes: integer|null 16 | Number of bytes per element. 17 | 18 | Examples 19 | -------- 20 | > var nbytes = {{alias}}( 'float64' ) 21 | 8 22 | > nbytes = {{alias}}( 'generic' ) 23 | null 24 | > nbytes = {{alias}}( 'foobar' ) 25 | null 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/dtypes2enums/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypes ) 3 | Resolves a list of data type enumeration constants. 4 | 5 | If the function is unable to resolve an enumeration constant for a provided 6 | data type, the corresponding element in the returned array will be `null`. 7 | 8 | Parameters 9 | ---------- 10 | dtypes: Array 11 | List of data types. 12 | 13 | Returns 14 | ------- 15 | out: Array 16 | Results. 17 | 18 | Examples 19 | -------- 20 | > var out = {{alias}}( [ 'float32', 'float64' ] ) 21 | [...] 22 | > out = {{alias}}( [ 'foo', 'bar' ] ) 23 | [ null, null ] 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/buffer-dtype-enum/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( buffer ) 3 | Returns the data type enumeration constant for an ndarray data buffer. 4 | 5 | If provided a buffer argument having an unknown or unsupported type, the 6 | function returns `null`. 7 | 8 | Parameters 9 | ---------- 10 | buffer: any 11 | ndarray data buffer. 12 | 13 | Returns 14 | ------- 15 | out: integer|null 16 | Data type enumeration constant. 17 | 18 | Examples 19 | -------- 20 | > var buf = new {{alias:@stdlib/array/float64}}( 10 ); 21 | > var c = {{alias}}( buf ) 22 | 23 | > c = {{alias}}( 'beep' ) 24 | null 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/promote-dtypes/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypes ) 3 | Returns a data type that results from applying promotion rules to a provided 4 | list of data types. 5 | 6 | The function returns `null` if provided data types which cannot be safely 7 | cast to a promoted data type. 8 | 9 | Parameters 10 | ---------- 11 | dtypes: Array 12 | List of data types. 13 | 14 | Returns 15 | ------- 16 | out: string|null 17 | Result. 18 | 19 | Examples 20 | -------- 21 | > var dt = {{alias}}( [ 'float32', 'float64' ] ) 22 | 'float64' 23 | > dt = {{alias}}( [ 'binary', 'complex128' ] ) 24 | null 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: stdlib 3 | message: >- 4 | If you use this software, please cite it using the 5 | metadata from this file. 6 | 7 | type: software 8 | 9 | authors: 10 | - name: The Stdlib Authors 11 | url: https://github.com/stdlib-js/stdlib/graphs/contributors 12 | 13 | repository-code: https://github.com/stdlib-js/stdlib 14 | url: https://stdlib.io 15 | 16 | abstract: | 17 | Standard library for JavaScript and Node.js. 18 | 19 | keywords: 20 | - JavaScript 21 | - Node.js 22 | - TypeScript 23 | - standard library 24 | - scientific computing 25 | - numerical computing 26 | - statistical computing 27 | 28 | license: Apache-2.0 AND BSL-1.0 29 | 30 | date-released: 2016 31 | -------------------------------------------------------------------------------- /base/assert/is-read-only/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( arr ) 3 | Tests if an ndarray is read-only. 4 | 5 | Parameters 6 | ---------- 7 | arr: ndarray 8 | Input ndarray. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an ndarray is read-only. 14 | 15 | Examples 16 | -------- 17 | > var opts = { 'readonly': true }; 18 | > var x = {{alias:@stdlib/ndarray/array}}( [ 1, 2, 3, 4 ], opts ); 19 | > var bool = {{alias}}( x ) 20 | true 21 | > opts.readonly = false; 22 | > x = {{alias:@stdlib/ndarray/array}}( [ 1, 2, 3, 4 ], opts ); 23 | > bool = {{alias}}( x ) 24 | false 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/to-unique-normalized-indices/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( indices, max ) 3 | Returns a list of unique indices after normalizing to the interval [0,max]. 4 | 5 | If an index exceeds index bounds, the function returns `null`. 6 | 7 | Parameters 8 | ---------- 9 | indices: Collection 10 | Indices to normalize. 11 | 12 | max: integer 13 | Maximum index value. 14 | 15 | Returns 16 | ------- 17 | out: Array|null 18 | Normalized indices. 19 | 20 | Examples 21 | -------- 22 | > var idx = {{alias}}( [ 2, -5 ], 10 ) 23 | [ 2, 6 ] 24 | > idx = {{alias}}( [ 15 ], 10 ) 25 | null 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /dtypes/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /casting-modes/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /index-modes/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /with/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, indices, value ) 3 | Returns a new ndarray with the element at a specified index replaced by a 4 | provided value. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | indices: Array 12 | Indices of the value to replace. 13 | 14 | value: any 15 | Replaced value. 16 | 17 | Returns 18 | ------- 19 | out: ndarray 20 | Output ndarray. 21 | 22 | Examples 23 | -------- 24 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 25 | > var out = {{alias}}( x, [ 0, 0 ], 5 ); 26 | > var v = out.get( 0, 0 ) 27 | 5 28 | 29 | See Also 30 | -------- 31 | -------------------------------------------------------------------------------- /base/binary-tiling-block-size/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypeX, dtypeY, dtypeZ ) 3 | Returns a loop block size for multi-dimensional array tiled loops. 4 | 5 | Parameters 6 | ---------- 7 | dtypeX: string 8 | First input array data type. 9 | 10 | dtypeY: string 11 | Second input array data type. 12 | 13 | dtypeZ: string 14 | Output array data type. 15 | 16 | Returns 17 | ------- 18 | out: integer 19 | Block size. 20 | 21 | Examples 22 | -------- 23 | > var out = {{alias}}( 'float64', 'float64', 'float64' ) 24 | 25 | > out = {{alias}}( 'int32', 'float64', 'float64' ) 26 | 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/to-reversed/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a new ndarray where the order of elements of an input ndarray is 4 | reversed along each dimension. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | Output array. 15 | 16 | Examples 17 | -------- 18 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 19 | 20 | > x.shape 21 | [ 2, 2 ] 22 | > var y = {{alias}}( x ) 23 | 24 | > y.shape 25 | [ 2, 2 ] 26 | > {{alias:@stdlib/ndarray/to-array}}( y ) 27 | [ [ 4, 3 ], [ 2, 1 ] ] 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /numel-dimension/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, dim ) 3 | Returns the size (i.e., number of elements) of a specified dimension for a 4 | provided ndarray. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input ndarray. 10 | 11 | dim: integer 12 | Dimension index. If less than zero, the index is resolved relative to 13 | the last dimension, with the last dimension corresponding to the value 14 | `-1`. 15 | 16 | Returns 17 | ------- 18 | out: integer 19 | Dimension size. 20 | 21 | Examples 22 | -------- 23 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 4, 2, 3 ] ), 0 ) 24 | 4 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/numel-dimension/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, dim ) 3 | Returns the size (i.e., number of elements) of a specified dimension for a 4 | provided ndarray. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input ndarray. 10 | 11 | dim: integer 12 | Dimension index. If less than zero, the index is resolved relative to 13 | the last dimension, with the last dimension corresponding to the value 14 | `-1`. 15 | 16 | Returns 17 | ------- 18 | out: integer 19 | Dimension size. 20 | 21 | Examples 22 | -------- 23 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 4, 2, 3 ] ), 0 ) 24 | 4 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/to-flippedlr/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a new ndarray where the order of elements along the last dimension 4 | of an input ndarray is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | Output array. 15 | 16 | Examples 17 | -------- 18 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 19 | 20 | > x.shape 21 | [ 2, 2 ] 22 | > var y = {{alias}}( x ) 23 | 24 | > y.shape 25 | [ 2, 2 ] 26 | > {{alias:@stdlib/ndarray/to-array}}( y ) 27 | [ [ 2, 1 ], [ 4, 3 ] ] 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /input-casting-policies/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /output-dtype-policies/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /base/assert/is-scalar-mostly-safe-compatible/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value, dtype ) 3 | Returns a boolean indicating whether a scalar value can be safely cast or, 4 | for floating-point data types, downcast to specified ndarray data type. 5 | 6 | Parameters 7 | ---------- 8 | value: any 9 | Input value. 10 | 11 | dtype: string|DataType 12 | Data type. 13 | 14 | Returns 15 | ------- 16 | bool: boolean 17 | Boolean indicating whether a scalar value can be safely cast. 18 | 19 | Examples 20 | -------- 21 | > var bool = {{alias}}( 3.14, 'float64' ) 22 | true 23 | > bool = {{alias}}( 3.14, 'int32' ) 24 | false 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /safe-casts/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns a list of ndarray data types to which a provided ndarray data type 4 | can be safely cast. 5 | 6 | If not provided an ndarray data type, the function returns a casting table. 7 | 8 | If provided an unrecognized ndarray data type, the function returns `null`. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any (optional) 13 | ndarray data type value. 14 | 15 | Returns 16 | ------- 17 | out: Object|Array|null 18 | ndarray data types to which a data type can be safely cast. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float32' ) 23 | 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/assert/is-buffer-length-compatible-shape/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( len, shape ) 3 | Returns a boolean indicating if a buffer length is compatible with a 4 | provided shape array. 5 | 6 | Parameters 7 | ---------- 8 | len: integer 9 | Buffer length (number of elements). 10 | 11 | shape: ArrayLike 12 | Array shape. 13 | 14 | Returns 15 | ------- 16 | bool: boolean 17 | Boolean indicating if a buffer length is compatible with a provided 18 | shape array. 19 | 20 | Examples 21 | -------- 22 | > var d = [ 2, 3, 10 ]; 23 | > var bool = {{alias}}( 60, d ) 24 | true 25 | > bool = {{alias}}( 30, d ) 26 | false 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/assert/is-input-casting-policy/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is a supported input ndarray casting policy. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is a supported input ndarray 14 | casting policy. 15 | 16 | Examples 17 | -------- 18 | > var bool = {{alias}}( 'none' ) 19 | true 20 | > bool = {{alias}}( 'promoted' ) 21 | true 22 | > bool = {{alias}}( 'output' ) 23 | true 24 | > bool = {{alias}}( '' ) 25 | false 26 | > bool = {{alias}}( 'beep' ) 27 | false 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/numel/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/assert/is-equal-data-type/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( v1, v2 ) 3 | Tests whether two values are equal ndarray data types. 4 | 5 | Parameters 6 | ---------- 7 | v1: any 8 | First input value. 9 | 10 | v2: any 11 | Second input value. 12 | 13 | Returns 14 | ------- 15 | bool: boolean 16 | Boolean indicating whether two values are equal ndarray data types. 17 | 18 | Examples 19 | -------- 20 | > var bool = {{alias}}( 'float64', 'float64' ) 21 | true 22 | > var dt = new {{alias:@stdlib/ndarray/dtype-ctor}}( 'float64' ); 23 | > bool = {{alias}}( 'float64', dt ) 24 | true 25 | > bool = {{alias}}( 'int16', 'int32' ) 26 | false 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/assert/is-output-data-type-policy/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is a supported ndarray output data type policy. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is a supported ndarray output data 14 | type policy. 15 | 16 | Examples 17 | -------- 18 | > var bool = {{alias}}( 'boolean' ) 19 | true 20 | > bool = {{alias}}( 'real' ) 21 | true 22 | > bool = {{alias}}( 'numeric' ) 23 | true 24 | > bool = {{alias}}( '' ) 25 | false 26 | > bool = {{alias}}( 'beep' ) 27 | false 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/to-flippedud/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a new ndarray where the order of elements along the second-to-last 4 | dimension of an input ndarray is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | Output array. 15 | 16 | Examples 17 | -------- 18 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ) 19 | 20 | > x.shape 21 | [ 3, 2 ] 22 | > var y = {{alias}}( x ) 23 | 24 | > y.shape 25 | [ 3, 2 ] 26 | > {{alias:@stdlib/ndarray/to-array}}( y ) 27 | [ [ 5, 6 ], [ 3, 4 ], [ 1, 2 ] ] 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/unary-input-casting-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( idtype, odtype, policy ) 3 | Resolves the input ndarray casting data type for a unary function. 4 | 5 | Parameters 6 | ---------- 7 | idtype: string 8 | Input ndarray data type. 9 | 10 | odtype: string 11 | Output ndarray data type. 12 | 13 | policy: string 14 | Input ndarray casting data type policy. If `policy` is a data type, the 15 | function returns the `policy` value. 16 | 17 | Returns 18 | ------- 19 | out: string 20 | Input ndarray casting data type. 21 | 22 | Examples 23 | -------- 24 | > var out = {{alias}}( 'float64', 'float64', 'none' ) 25 | 'float64' 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/wrap-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/clamp-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/flatten-shape/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/iteration-order/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/normalize-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/strides2offset/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/strides2order/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /next-dtype/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/dtypes" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /orders/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/blas/base/layouts" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /safe-casts/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/dtypes" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/assert/is-row-major/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/assert/is-safe-data-type-cast/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( from, to ) 3 | Returns a boolean indicating whether a provided ndarray data type can be 4 | safely cast to another ndarray data type. 5 | 6 | Parameters 7 | ---------- 8 | from: string|DataType 9 | Data type to cast from. 10 | 11 | to: string|DataType 12 | Data type to cast to. 13 | 14 | Returns 15 | ------- 16 | bool: boolean 17 | Boolean indicating whether a provided data type can be safely cast to 18 | another data type. 19 | 20 | Examples 21 | -------- 22 | > var bool = {{alias}}( 'float32', 'float64' ) 23 | true 24 | > bool = {{alias}}( 'float64', 'int32' ) 25 | false 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/broadcast-shapes/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/dtype-desc/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns the description for a specified data type. 4 | 5 | If not provided a data type value, the function returns an object mapping 6 | data type strings to descriptions. 7 | 8 | If provided an unknown/unsupported data type, the function returns `null`. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any (optional) 13 | Data type value. 14 | 15 | Returns 16 | ------- 17 | desc: Object|string|null 18 | Description(s). 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float64' ) 23 | '...' 24 | > out = {{alias}}( 'foobar' ) 25 | null 26 | > out = {{alias}}() 27 | {...} 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/flatten-shape-from/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/singleton-dimensions/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /promotion-rules/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/dtypes" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /same-kind-casts/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/dtypes" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/assert/is-column-major/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/dtypes2signatures/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtypes, nin, nout ) 3 | Transforms a list of array argument data types into a list of signatures. 4 | 5 | Parameters 6 | ---------- 7 | dtypes: ArrayLike 8 | List of array argument data types. 9 | 10 | nin: integer 11 | Number of input array arguments. 12 | 13 | nout: integer 14 | Number of output array arguments. 15 | 16 | Returns 17 | ------- 18 | out: Array 19 | List of signatures. 20 | 21 | Examples 22 | -------- 23 | > var types = [ 'float64', 'float64', 'float32', 'float32' ]; 24 | > var out = {{alias}}( types, 1, 1 ) 25 | [ '(float64) => (float64)', '(float32) => (float32)' ] 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/max-view-buffer-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/min-view-buffer-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/minmax-view-buffer-index/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /base/nonsingleton-dimensions/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /mostly-safe-casts/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/dtypes" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /next-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns the next larger ndarray data type of the same kind. 4 | 5 | If not provided a data type, the function returns a table. 6 | 7 | If a data type does not have a next larger data type or the next larger type 8 | is not supported, the function returns `-1`. 9 | 10 | If provided an unrecognized data type, the function returns `null`. 11 | 12 | Parameters 13 | ---------- 14 | dtype: any (optional) 15 | ndarray data type value. 16 | 17 | Returns 18 | ------- 19 | out: Object|string|integer|null 20 | Next larger type(s). 21 | 22 | Examples 23 | -------- 24 | > var out = {{alias}}( 'float32' ) 25 | 'float64' 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/dtype-resolve-enum/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype ) 3 | Returns the enumeration constant associated with a supported data type 4 | value. 5 | 6 | Downstream consumers of this function should *not* rely on specific integer 7 | values (e.g., `INT8 == 0`). Instead, the function should be used in an 8 | opaque manner. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any 13 | Data type value. 14 | 15 | Returns 16 | ------- 17 | out: integer|null 18 | Enumeration constant. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float64' ) 23 | 24 | > out = {{alias}}( {{alias:@stdlib/ndarray/base/dtype-str2enum}}( 'float64' ) ) 25 | 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /mostly-safe-casts/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns a list of ndarray data types to which a provided ndarray data type 4 | can be safely cast and, for floating-point data types, can be downcast. 5 | 6 | If not provided an ndarray data type, the function returns a casting table. 7 | 8 | If provided an unrecognized ndarray data type, the function returns `null`. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any (optional) 13 | ndarray data type value. 14 | 15 | Returns 16 | ------- 17 | out: Object|Array|null 18 | ndarray data types to which a data type can be cast. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float32' ) 23 | 24 | 25 | See Also 26 | -------- 27 | 28 | -------------------------------------------------------------------------------- /base/normalize-indices/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( indices, max ) 3 | Normalizes indices to the interval [0,max]. 4 | 5 | If an index exceeds index bounds, the function returns `null`. 6 | 7 | The function mutates the input array, even when provided an index which 8 | exceeds index bounds. 9 | 10 | Parameters 11 | ---------- 12 | indices: Collection 13 | Indices to normalize. 14 | 15 | max: integer 16 | Maximum index value. 17 | 18 | Returns 19 | ------- 20 | out: Collection|null 21 | Normalized indices. 22 | 23 | Examples 24 | -------- 25 | > var idx = {{alias}}( [ 2, -5 ], 10 ) 26 | [ 2, 6 ] 27 | > idx = {{alias}}( [ 15 ], 10 ) 28 | null 29 | 30 | See Also 31 | -------- 32 | 33 | -------------------------------------------------------------------------------- /input-casting-policies/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns a list of input ndarray casting policies. 4 | 5 | The output array contains the following policies: 6 | 7 | - none: no guidance on specific casting behavior. An input ndarray may or 8 | may not be cast depending on the needs of an implementation. 9 | - promoted: cast an input ndarray to a promoted data type. 10 | - accumulation: cast an input ndarray to a data type amenable to 11 | accumulation. 12 | - output: cast an input ndarray to the data type of the output ndarray. 13 | 14 | Returns 15 | ------- 16 | out: Array 17 | List of policies. 18 | 19 | Examples 20 | -------- 21 | > var out = {{alias}}() 22 | 23 | 24 | See Also 25 | -------- 26 | 27 | -------------------------------------------------------------------------------- /base/output-policy-resolve-enum/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( policy ) 3 | Returns the enumeration constant associated with a supported data type 4 | policy value. 5 | 6 | Downstream consumers of this function should *not* rely on specific integer 7 | values (e.g., `SAME == 0`). Instead, the function should be used in an 8 | opaque manner. 9 | 10 | Parameters 11 | ---------- 12 | policy: any 13 | Policy value. 14 | 15 | Returns 16 | ------- 17 | out: integer|null 18 | Enumeration constant. 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'same' ) 23 | 24 | > out = {{alias}}( {{alias:@stdlib/ndarray/base/output-policy-str2enum}}( 'same' ) ) 25 | 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /to-reversed/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a new ndarray where the order of elements of an input ndarray is 4 | reversed along each dimension. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | A new ndarray where the order of elements along each dimension is 15 | reversed. 16 | 17 | Examples 18 | -------- 19 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 20 | 21 | > {{alias:@stdlib/ndarray/to-array}}( x ) 22 | [ [ 1, 2 ], [ 3, 4 ] ] 23 | > var y = {{alias}}( x ) 24 | 25 | > {{alias:@stdlib/ndarray/to-array}}( y ) 26 | [ [ 4, 3 ], [ 2, 1 ] ] 27 | 28 | See Also 29 | -------- 30 | -------------------------------------------------------------------------------- /base/dtype-char/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/dtype-alignment/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns the alignment (in bytes) for a specified underlying array data type. 4 | 5 | If not provided a data type value, the function returns an object mapping 6 | data type strings to alignments (in bytes). 7 | 8 | If provided an unknown/unsupported data type, the function returns `null`. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any (optional) 13 | Data type value. 14 | 15 | Returns 16 | ------- 17 | out: Object|number|null 18 | Alignment (in bytes). 19 | 20 | Examples 21 | -------- 22 | > var out = {{alias}}( 'float64' ) 23 | 8 24 | > out = {{alias}}( 'foobar' ) 25 | null 26 | > var obj = {{alias}}() 27 | {...} 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/dtype-alignment/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/shape2strides/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/orders" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/sub2ind/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/index-modes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /stride/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, dim ) 3 | Returns the stride along a specified dimension for a provided ndarray. 4 | 5 | A "stride" is the linear distance (i.e., number of elements) between 6 | adjacent elements along a specified dimension. 7 | 8 | Parameters 9 | ---------- 10 | x: ndarray 11 | Input ndarray. 12 | 13 | dim: integer 14 | Dimension index. If less than zero, the index is resolved relative to 15 | the last dimension, with the last dimension corresponding to the value 16 | `-1`. 17 | 18 | Returns 19 | ------- 20 | out: integer 21 | Stride. 22 | 23 | Examples 24 | -------- 25 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), 0 ) 26 | 9 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/bytes-per-element/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/function-object/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var headerDir = require( './../lib' ); 22 | 23 | console.log( headerDir ); 24 | -------------------------------------------------------------------------------- /base/napi/addon-arguments/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/ctor" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/stride/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, dim ) 3 | Returns the stride along a specified dimension for a provided ndarray. 4 | 5 | A "stride" is the linear distance (i.e., number of elements) between 6 | adjacent elements along a specified dimension. 7 | 8 | Parameters 9 | ---------- 10 | x: ndarray 11 | Input ndarray. 12 | 13 | dim: integer 14 | Dimension index. If less than zero, the index is resolved relative to 15 | the last dimension, with the last dimension corresponding to the value 16 | `-1`. 17 | 18 | Returns 19 | ------- 20 | out: integer 21 | Stride. 22 | 23 | Examples 24 | -------- 25 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), 0 ) 26 | 9 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /output-dtype-policies/lib/policies.json: -------------------------------------------------------------------------------- 1 | [ 2 | "same", 3 | "promoted", 4 | "accumulation", 5 | "boolean", 6 | "boolean_and_generic", 7 | "signed_integer", 8 | "signed_integer_and_generic", 9 | "unsigned_integer", 10 | "unsigned_integer_and_generic", 11 | "integer", 12 | "integer_and_generic", 13 | "floating_point", 14 | "floating_point_and_generic", 15 | "real_floating_point", 16 | "real_floating_point_and_generic", 17 | "complex_floating_point", 18 | "complex_floating_point_and_generic", 19 | "real_and_generic", 20 | "real", 21 | "numeric", 22 | "numeric_and_generic", 23 | "integer_index", 24 | "integer_index_and_generic", 25 | "boolean_index", 26 | "boolean_index_and_generic", 27 | "mask_index", 28 | "mask_index_and_generic", 29 | "default", 30 | "default_index" 31 | ] 32 | -------------------------------------------------------------------------------- /same-kind-casts/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns a list of ndarray data types to which a provided ndarray data type 4 | can be safely cast or cast within the same "kind". 5 | 6 | If not provided an ndarray data type, the function returns a casting table. 7 | 8 | If provided an unrecognized ndarray data type, the function returns `null`. 9 | 10 | Parameters 11 | ---------- 12 | dtype: any (optional) 13 | ndarray data type value. 14 | 15 | Returns 16 | ------- 17 | out: Object|Array|null 18 | ndarray data types to which a data type can be safely cast or cast 19 | within the same "kind". 20 | 21 | Examples 22 | -------- 23 | > var out = {{alias}}( 'float32' ) 24 | 25 | 26 | See Also 27 | -------- 28 | 29 | -------------------------------------------------------------------------------- /base/assert/is-mostly-safe-data-type-cast/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( from, to ) 3 | Returns a boolean indicating whether a provided ndarray data type can be 4 | safely cast or, for floating-point data types, downcast to another ndarray 5 | data type. 6 | 7 | Parameters 8 | ---------- 9 | from: string|DataType 10 | Data type to cast from. 11 | 12 | to: string|DataType 13 | Data type to cast to. 14 | 15 | Returns 16 | ------- 17 | bool: boolean 18 | Boolean indicating whether a provided data type can be cast to another 19 | data type. 20 | 21 | Examples 22 | -------- 23 | > var bool = {{alias}}( 'float32', 'float64' ) 24 | true 25 | > bool = {{alias}}( 'float64', 'int32' ) 26 | false 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /reverse/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a read-only view of an input ndarray in which the order of elements 4 | along each dimension is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | A read-only view of an input ndarray in which the order of elements 15 | along each dimension is reversed. 16 | 17 | Examples 18 | -------- 19 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 20 | 21 | > {{alias:@stdlib/ndarray/to-array}}( x ) 22 | [ [ 1, 2 ], [ 3, 4 ] ] 23 | > var y = {{alias}}( x ) 24 | 25 | > {{alias:@stdlib/ndarray/to-array}}( y ) 26 | [ [ 4, 3 ], [ 2, 1 ] ] 27 | 28 | See Also 29 | -------- 30 | -------------------------------------------------------------------------------- /base/napi/dtype-string-to-dtype/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/napi/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var headerDir = require( './../lib' ); 22 | 23 | console.log( headerDir ); 24 | // => 25 | -------------------------------------------------------------------------------- /base/napi/typedarray-type-to-dtype/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /for-each/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, fcn[, thisArg] ) 3 | Invokes a callback function once for each ndarray element. 4 | 5 | The callback function is provided the following arguments: 6 | 7 | - value: current array element. 8 | - indices: current array element indices. 9 | - arr: the input ndarray. 10 | 11 | Parameters 12 | ---------- 13 | x: ndarray 14 | Input ndarray. 15 | 16 | fcn: Function 17 | Callback function. 18 | 19 | thisArg: any (optional) 20 | Callback function execution context. 21 | 22 | Examples 23 | -------- 24 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ); 25 | > function f( v ) { if ( v !== v ) { throw new Error( '...' ); } }; 26 | > {{alias}}( x, f ); 27 | 28 | See Also 29 | -------- 30 | -------------------------------------------------------------------------------- /base/napi/unary/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var headerDir = require( './../lib' ); 22 | 23 | console.log( headerDir ); 24 | // => 25 | -------------------------------------------------------------------------------- /base/zeros/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( dtype, shape, order ) 3 | Returns a zero-filled ndarray having a specified shape and data type. 4 | 5 | Parameters 6 | ---------- 7 | dtype: string 8 | Underlying data type. Must be a numeric data type or "generic". 9 | 10 | shape: ArrayLikeObject 11 | Array shape. 12 | 13 | order: string 14 | Specifies whether an array is row-major (C-style) or column-major 15 | (Fortran-style). 16 | 17 | Returns 18 | ------- 19 | out: ndarray 20 | Output array. 21 | 22 | Examples 23 | -------- 24 | > var arr = {{alias}}( 'float64', [ 2, 2 ], 'row-major' ) 25 | 26 | > var sh = arr.shape 27 | [ 2, 2 ] 28 | > var dt = arr.dtype 29 | 'float64' 30 | 31 | See Also 32 | -------- 33 | 34 | -------------------------------------------------------------------------------- /fliplr/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a read-only view of an input ndarray in which the order of elements 4 | along the last dimension is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | A read-only view of an input ndarray in which the order of elements 15 | along the last dimension is reversed. 16 | 17 | Examples 18 | -------- 19 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 20 | 21 | > {{alias:@stdlib/ndarray/to-array}}( x ) 22 | [ [ 1, 2 ], [ 3, 4 ] ] 23 | > var y = {{alias}}( x ) 24 | 25 | > {{alias:@stdlib/ndarray/to-array}}( y ) 26 | [ [ 2, 1 ], [ 4, 3 ] ] 27 | 28 | See Also 29 | -------- 30 | -------------------------------------------------------------------------------- /base/iteration-order/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( strides ) 3 | Returns the iteration order, given a stride array. 4 | 5 | Possible return values: 6 | 7 | 0: unordered (strides of varying sign). 8 | 1: left-to-right iteration order (all nonnegative strides). 9 | -1: right-to-left iteration order (all negative strides). 10 | 11 | Parameters 12 | ---------- 13 | strides: ArrayLike 14 | Stride array. 15 | 16 | Returns 17 | ------- 18 | out: integer 19 | Iteration order. 20 | 21 | Examples 22 | -------- 23 | > var s = [ 30, -10, 1 ]; 24 | > var out = {{alias}}( s ) 25 | 0 26 | > s = [ 30, 10, 1 ]; 27 | > out = {{alias}}( s ) 28 | 1 29 | > s = [ -30, -10, -1 ]; 30 | > out = {{alias}}( s ) 31 | -1 32 | 33 | See Also 34 | -------- 35 | 36 | -------------------------------------------------------------------------------- /base/assert/is-buffer-length-compatible-shape/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/numel" 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /base/napi/addon-arguments/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var headerDir = require( './../lib' ); 22 | 23 | console.log( headerDir ); 24 | // => 25 | -------------------------------------------------------------------------------- /base/napi/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var headerDir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = headerDir; 29 | -------------------------------------------------------------------------------- /base/napi/unary/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var headerDir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = headerDir; 29 | -------------------------------------------------------------------------------- /base/bind2vind/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/index-modes", 37 | "@stdlib/ndarray/orders" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /base/function-object/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var headerDir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = headerDir; 29 | -------------------------------------------------------------------------------- /base/ind2sub/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/index-modes", 37 | "@stdlib/ndarray/orders" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /base/napi/dtype-string-to-dtype/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var dir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = dir; 29 | -------------------------------------------------------------------------------- /base/vind2bind/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/index-modes", 37 | "@stdlib/ndarray/orders" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2018 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var objectKeys = require( '@stdlib/utils/keys' ); 22 | var ns = require( './../lib' ); 23 | 24 | console.log( objectKeys( ns ) ); 25 | -------------------------------------------------------------------------------- /flipud/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns a read-only view of an input ndarray in which the order of elements 4 | along the second-to-last dimension is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | Returns 12 | ------- 13 | out: ndarray 14 | A read-only view of an input ndarray in which the order of elements 15 | along the second-to-last dimension is reversed. 16 | 17 | Examples 18 | -------- 19 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 20 | 21 | > {{alias:@stdlib/ndarray/to-array}}( x ) 22 | [ [ 1, 2 ], [ 3, 4 ] ] 23 | > var y = {{alias}}( x ) 24 | 25 | > {{alias:@stdlib/ndarray/to-array}}( y ) 26 | [ [ 3, 4 ], [ 1, 2 ] ] 27 | 28 | See Also 29 | -------- 30 | -------------------------------------------------------------------------------- /base/assert/is-same-kind-data-type-cast/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( from, to ) 3 | Returns a boolean indicating whether a provided ndarray data type can be 4 | safely cast to, or is of the same "kind" as, another ndarray data type. 5 | 6 | Parameters 7 | ---------- 8 | from: string|DataType 9 | Data type to cast from. 10 | 11 | to: string|DataType 12 | Data type to cast to. 13 | 14 | Returns 15 | ------- 16 | bool: boolean 17 | Boolean indicating whether a provided data type can be cast to another 18 | data type. 19 | 20 | Examples 21 | -------- 22 | > var bool = {{alias}}( 'float32', 'float64' ) 23 | true 24 | > bool = {{alias}}( 'uint16', 'int32' ) 25 | true 26 | > bool = {{alias}}( 'uint16', 'int16' ) 27 | false 28 | 29 | See Also 30 | -------- 31 | 32 | -------------------------------------------------------------------------------- /base/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2018 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var objectKeys = require( '@stdlib/utils/keys' ); 22 | var ns = require( './../lib' ); 23 | 24 | console.log( objectKeys( ns ) ); 25 | -------------------------------------------------------------------------------- /base/napi/addon-arguments/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var headerDir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = headerDir; 29 | -------------------------------------------------------------------------------- /base/napi/typedarray-type-to-dtype/lib/browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2020 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | var dir = null; 24 | 25 | 26 | // EXPORTS // 27 | 28 | module.exports = dir; 29 | -------------------------------------------------------------------------------- /iter/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2023 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var objectKeys = require( '@stdlib/utils/keys' ); 22 | var ns = require( './../lib' ); 23 | 24 | console.log( objectKeys( ns ) ); 25 | -------------------------------------------------------------------------------- /vector/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var objectKeys = require( '@stdlib/utils/keys' ); 22 | var ns = require( './../lib' ); 23 | 24 | console.log( objectKeys( ns ) ); 25 | -------------------------------------------------------------------------------- /base/assert/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2018 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var objectKeys = require( '@stdlib/utils/keys' ); 22 | var ns = require( './../lib' ); 23 | 24 | console.log( objectKeys( ns ) ); 25 | -------------------------------------------------------------------------------- /base/dtype-char/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype] ) 3 | Returns the single letter character abbreviation for a specified underlying 4 | array data type. 5 | 6 | If not provided a data type value, the function returns an object mapping 7 | data type strings to single letter character abbreviations. 8 | 9 | If provided an unknown/unsupported data type, the function returns `null`. 10 | 11 | Parameters 12 | ---------- 13 | dtype: any (optional) 14 | Data type value. 15 | 16 | Returns 17 | ------- 18 | ch: Object|string|null 19 | Single letter character abbreviation(s). 20 | 21 | Examples 22 | -------- 23 | > var ch = {{alias}}( 'float64' ) 24 | 'd' 25 | > ch = {{alias}}( 'foobar' ) 26 | null 27 | > var obj = {{alias}}() 28 | {...} 29 | 30 | See Also 31 | -------- 32 | 33 | -------------------------------------------------------------------------------- /base/assert/is-safe-data-type-cast/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes", 37 | "@stdlib/ndarray/safe-casts" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /base/char2dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [ch] ) 3 | Returns the data type string associated with a provided single letter 4 | character abbreviation. 5 | 6 | If not provided an abbreviation, the function returns an object mapping 7 | single letter character abbreviations to data type strings. 8 | 9 | If provided an unknown/unsupported abbreviation, the function returns 10 | `null`. 11 | 12 | Parameters 13 | ---------- 14 | ch: string (optional) 15 | Single letter character abbreviation. 16 | 17 | Returns 18 | ------- 19 | out: Object|string|null 20 | Data type string. 21 | 22 | Examples 23 | -------- 24 | > var out = {{alias}}( 'd' ) 25 | 'float64' 26 | > out = {{alias}}( 'foobar' ) 27 | null 28 | > var obj = {{alias}}() 29 | {...} 30 | 31 | See Also 32 | -------- 33 | 34 | -------------------------------------------------------------------------------- /base/assert/is-same-kind-data-type-cast/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes", 37 | "@stdlib/ndarray/same-kind-casts" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /base/binary-input-casting-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( idtype1, idtype2, odtype, policy ) 3 | Resolves the casting data type for an input ndarray provided to a binary 4 | function. 5 | 6 | Parameters 7 | ---------- 8 | idtype1: string 9 | Input ndarray data type. 10 | 11 | idtype2: string 12 | Additional input ndarray data type. 13 | 14 | odtype: string 15 | Output ndarray data type. 16 | 17 | policy: string 18 | Input ndarray casting data type policy. If `policy` is a data type, the 19 | function returns the `policy` value. 20 | 21 | Returns 22 | ------- 23 | out: string 24 | Input ndarray casting data type. 25 | 26 | Examples 27 | -------- 28 | > var out = {{alias}}( 'float64', 'float64', 'float64', 'none' ) 29 | 'float64' 30 | 31 | See Also 32 | -------- 33 | 34 | -------------------------------------------------------------------------------- /base/assert/is-casting-mode/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Tests if an input value is a supported ndarray casting mode. 4 | 5 | Parameters 6 | ---------- 7 | value: any 8 | Value to test. 9 | 10 | Returns 11 | ------- 12 | bool: boolean 13 | Boolean indicating if an input value is a supported ndarray casting 14 | mode. 15 | 16 | Examples 17 | -------- 18 | > var bool = {{alias}}( 'none' ) 19 | true 20 | > bool = {{alias}}( 'equiv' ) 21 | true 22 | > bool = {{alias}}( 'safe' ) 23 | true 24 | > bool = {{alias}}( 'mostly-safe' ) 25 | true 26 | > bool = {{alias}}( 'same-kind' ) 27 | true 28 | > bool = {{alias}}( 'unsafe' ) 29 | true 30 | > bool = {{alias}}( '' ) 31 | false 32 | > bool = {{alias}}( 'beep' ) 33 | false 34 | 35 | See Also 36 | -------- 37 | 38 | -------------------------------------------------------------------------------- /base/assert/is-mostly-safe-data-type-cast/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/dtypes", 37 | "@stdlib/ndarray/mostly-safe-casts" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /at/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x[, ...indices] ) 3 | Returns an ndarray element. 4 | 5 | Negative indices are resolved relative to the last element along the 6 | respective dimension, with the last element corresponding to `-1`. 7 | 8 | If provided out-of-bounds indices, the function always returns `undefined`. 9 | 10 | Parameters 11 | ---------- 12 | x: ndarray 13 | Input ndarray. 14 | 15 | indices: ...integer (optional) 16 | Index arguments. The number of index arguments must equal the number of 17 | dimensions. 18 | 19 | Returns 20 | ------- 21 | out: any 22 | Element value. 23 | 24 | Examples 25 | -------- 26 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 27 | > {{alias}}( x, 0, 1 ) 28 | 2 29 | > {{alias}}( x, 1, 0 ) 30 | 3 31 | 32 | See Also 33 | -------- 34 | 35 | -------------------------------------------------------------------------------- /min-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value ) 3 | Returns the minimum ndarray data type of the closest "kind" necessary for 4 | storing a provided scalar value. 5 | 6 | The function does *not* provide precision guarantees for non-integer-valued 7 | numbers. In other words, the function returns the smallest possible 8 | floating-point (i.e., inexact) data type for storing numbers having 9 | decimals. 10 | 11 | Parameters 12 | ---------- 13 | value: any 14 | Scalar value. 15 | 16 | Returns 17 | ------- 18 | dt: string 19 | ndarray data type. 20 | 21 | Examples 22 | -------- 23 | > var dt = {{alias}}( 3.141592653589793 ) 24 | 'float32' 25 | > dt = {{alias}}( 3 ) 26 | 'uint8' 27 | > dt = {{alias}}( -3 ) 28 | 'int8' 29 | > dt = {{alias}}( '-3' ) 30 | 'generic' 31 | 32 | See Also 33 | -------- 34 | 35 | -------------------------------------------------------------------------------- /base/napi/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [], 28 | "include": [ 29 | "./include" 30 | ], 31 | "libraries": [], 32 | "libpath": [], 33 | "dependencies": [ 34 | "@stdlib/ndarray/base/function-object", 35 | "@stdlib/ndarray/base/unary", 36 | "@stdlib/ndarray/dtypes", 37 | "@stdlib/ndarray/base/napi/unary" 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /base/flags/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, copy ) 3 | Returns the flags of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | copy: boolean 11 | Boolean indicating whether to explicitly copy the value assigned to the 12 | input ndarray's `flags` property. When `copy` is `false`, changes to the 13 | returned object may mutate the input ndarray strides. If there is a 14 | chance that the returned object will be mutated (either directly or by 15 | downstream consumers), set `copy` to `true` to prevent unintended side 16 | effects. 17 | 18 | Returns 19 | ------- 20 | out: Object 21 | Flags. 22 | 23 | Examples 24 | -------- 25 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), false ) 26 | {...} 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/shape/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, copy ) 3 | Returns the shape of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | copy: boolean 11 | Boolean indicating whether to explicitly copy the value assigned to the 12 | input ndarray's `shape` property. When `copy` is `false`, changes to the 13 | returned shape array may mutate the input ndarray shape. If there is a 14 | chance that the returned shape will be mutated (either directly or by 15 | downstream consumers), set `copy` to `true` to prevent unintended side 16 | effects. 17 | 18 | Returns 19 | ------- 20 | out: Array 21 | Shape. 22 | 23 | Examples 24 | -------- 25 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), false ) 26 | [ 3, 3, 3 ] 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /base/prepend-singleton-dimensions/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, n ) 3 | Returns an array with a specified number of prepended singleton dimensions. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input array. 9 | 10 | n: integer 11 | Number of singleton dimensions to prepend. 12 | 13 | Returns 14 | ------- 15 | out: ndarray 16 | Output array. 17 | 18 | Examples 19 | -------- 20 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 21 | 22 | > var sh = x.shape 23 | [ 2, 2 ] 24 | > var y = {{alias}}( x, 3 ) 25 | 26 | > sh = y.shape 27 | [ 1, 1, 1, 2, 2 ] 28 | > var v = y.get( 0, 0, 0, 0, 0 ) 29 | 1 30 | > v = y.get( 0, 0, 0, 0, 1 ) 31 | 2 32 | > v = y.get( 0, 0, 0, 1, 0 ) 33 | 3 34 | > v = y.get( 0, 0, 0, 1, 1 ) 35 | 4 36 | 37 | See Also 38 | -------- 39 | 40 | -------------------------------------------------------------------------------- /base/strides/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, copy ) 3 | Returns the strides of a provided ndarray. 4 | 5 | Parameters 6 | ---------- 7 | x: ndarray 8 | Input ndarray. 9 | 10 | copy: boolean 11 | Boolean indicating whether to explicitly copy the value assigned to the 12 | input ndarray's `strides` property. When `copy` is `false`, changes to 13 | the returned strides array may mutate the input ndarray strides. If 14 | there is a chance that the returned strides will be mutated (either 15 | directly or by downstream consumers), set `copy` to `true` to prevent 16 | unintended side effects. 17 | 18 | Returns 19 | ------- 20 | out: Array 21 | Strides. 22 | 23 | Examples 24 | -------- 25 | > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 3, 3, 3 ] ), false ) 26 | [ 9, 3, 1 ] 27 | 28 | See Also 29 | -------- 30 | 31 | -------------------------------------------------------------------------------- /docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* eslint-disable @typescript-eslint/no-unused-expressions */ 20 | 21 | import ns = require( './index' ); 22 | 23 | 24 | // TESTS // 25 | 26 | // The exported value is the expected interface... 27 | { 28 | ns; // $ExpectType Namespace 29 | } 30 | -------------------------------------------------------------------------------- /base/assert/is-contiguous/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/assert/is-single-segment-compatible", 37 | "@stdlib/ndarray/base/iteration-order", 38 | "@stdlib/ndarray/dtypes" 39 | ] 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /base/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* eslint-disable @typescript-eslint/no-unused-expressions */ 20 | 21 | import ns = require( './index' ); 22 | 23 | 24 | // TESTS // 25 | 26 | // The exported value is the expected interface... 27 | { 28 | ns; // $ExpectType Namespace 29 | } 30 | -------------------------------------------------------------------------------- /base/napi/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /iter/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2023 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* eslint-disable @typescript-eslint/no-unused-expressions */ 20 | 21 | import ns = require( './index' ); 22 | 23 | 24 | // TESTS // 25 | 26 | // The exported value is the expected interface... 27 | { 28 | ns; // $ExpectType Namespace 29 | } 30 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray) of the main repository where we’ll review and provide feedback. 4 | 5 | If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. 6 | 7 | We look forward to receiving your contribution! :smiley: -------------------------------------------------------------------------------- /base/assert/is-buffer-length-compatible/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( len, shape, strides, offset ) 3 | Returns a boolean indicating if a buffer length is compatible with provided 4 | ndarray meta data. 5 | 6 | Parameters 7 | ---------- 8 | len: integer 9 | Buffer length (number of elements). 10 | 11 | shape: ArrayLike 12 | Array shape. 13 | 14 | strides: ArrayLike 15 | Stride array. 16 | 17 | offset: integer 18 | Location of the first indexed value. 19 | 20 | Returns 21 | ------- 22 | bool: boolean 23 | Boolean indicating if a buffer length is compatible. 24 | 25 | Examples 26 | -------- 27 | > var d = [ 2, 3, 10 ]; 28 | > var s = [ 30, -10, 1 ]; 29 | > var o = 20; 30 | > var bool = {{alias}}( 100, d, s, o ) 31 | true 32 | > o = 80; 33 | > bool = {{alias}}( 100, d, s, o ) 34 | false 35 | 36 | See Also 37 | -------- 38 | 39 | -------------------------------------------------------------------------------- /base/assert/is-buffer-length-compatible/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/bytes-per-element", 37 | "@stdlib/ndarray/base/minmax-view-buffer-index", 38 | "@stdlib/ndarray/dtypes" 39 | ] 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /base/every/scripts/lib/exclude_dtypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | // Data types to exclude when generating loops: 24 | var EXCLUDE_DTYPES = [ 'binary', 'generic', 'uint8c' ]; 25 | 26 | 27 | // EXPORTS // 28 | 29 | module.exports = EXCLUDE_DTYPES; 30 | -------------------------------------------------------------------------------- /base/napi/unary/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /vector/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* eslint-disable @typescript-eslint/no-unused-expressions */ 20 | 21 | import ns = require( './index' ); 22 | 23 | 24 | // TESTS // 25 | 26 | // The exported value is the expected interface... 27 | { 28 | ns; // $ExpectType Namespace 29 | } 30 | -------------------------------------------------------------------------------- /base/assert/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* eslint-disable @typescript-eslint/no-unused-expressions */ 20 | 21 | import ns = require( './index' ); 22 | 23 | 24 | // TESTS // 25 | 26 | // The exported value is the expected interface... 27 | { 28 | ns; // $ExpectType Namespace 29 | } 30 | -------------------------------------------------------------------------------- /base/assert/is-single-segment-compatible/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides, offset ) 3 | Returns a boolean indicating if an array is compatible with a single memory 4 | segment. 5 | 6 | Parameters 7 | ---------- 8 | shape: ArrayLike 9 | Array shape. 10 | 11 | strides: ArrayLike 12 | Stride array. 13 | 14 | offset: integer 15 | Location of the first indexed value based on the stride array. 16 | 17 | Returns 18 | ------- 19 | bool: boolean 20 | Boolean indicating if an array is compatible with a single memory 21 | segment. 22 | 23 | Examples 24 | -------- 25 | > var d = [ 2, 3, 10 ]; 26 | > var s = [ 30, -10, 1 ]; 27 | > var o = 20; 28 | > var bool = {{alias}}( d, s, o ) 29 | true 30 | > d = [ 10 ]; 31 | > s = [ 3 ]; 32 | > o = 0; 33 | > bool = {{alias}}( d, s, o ) 34 | false 35 | 36 | See Also 37 | -------- 38 | 39 | -------------------------------------------------------------------------------- /base/binary-output-dtype/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( xdtype, ydtype, policy ) 3 | Resolves the output ndarray data type for a binary function. 4 | 5 | The function always applies type promotion to the provided data types, 6 | except for the following policies: 7 | 8 | - default 9 | - default_index 10 | - same 11 | - 12 | 13 | Parameters 14 | ---------- 15 | xdtype: string 16 | First input ndarray data type. 17 | 18 | ydtype: string 19 | Second input ndarray data type. 20 | 21 | policy: string 22 | Output ndarray data type policy. If `policy` is a data type, the 23 | function returns the `policy` value. 24 | 25 | Returns 26 | ------- 27 | out: string 28 | Output ndarray data type. 29 | 30 | Examples 31 | -------- 32 | > var out = {{alias}}( 'float64', 'float32', 'real' ) 33 | 'float64' 34 | 35 | See Also 36 | -------- 37 | 38 | -------------------------------------------------------------------------------- /base/count-falsy/scripts/lib/exclude_dtypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | // Data types to exclude when generating loops: 24 | var EXCLUDE_DTYPES = [ 'binary', 'generic', 'uint8c' ]; 25 | 26 | 27 | // EXPORTS // 28 | 29 | module.exports = EXCLUDE_DTYPES; 30 | -------------------------------------------------------------------------------- /base/count-truthy/scripts/lib/exclude_dtypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | // Data types to exclude when generating loops: 24 | var EXCLUDE_DTYPES = [ 'binary', 'generic', 'uint8c' ]; 25 | 26 | 27 | // EXPORTS // 28 | 29 | module.exports = EXCLUDE_DTYPES; 30 | -------------------------------------------------------------------------------- /base/function-object/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /base/ind/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/clamp-index", 37 | "@stdlib/ndarray/base/normalize-index", 38 | "@stdlib/ndarray/base/wrap-index", 39 | "@stdlib/ndarray/index-modes" 40 | ] 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /promotion-rules/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( [dtype1, dtype2] ) 3 | Returns the ndarray data type with the smallest size and closest "kind" to 4 | which ndarray data types can be safely cast. 5 | 6 | If not provided data types, the function returns a type promotion table. 7 | 8 | If a data type to which data types can be safely cast does *not* exist (or 9 | is not supported), the function returns `-1`. 10 | 11 | If provided an unrecognized data type, the function returns `null`. 12 | 13 | Parameters 14 | ---------- 15 | dtype1: any (optional) 16 | ndarray data type value. 17 | 18 | dtype2: any (optional) 19 | ndarray data type value. 20 | 21 | Returns 22 | ------- 23 | out: Object|string|integer|null 24 | Promotion rule(s). 25 | 26 | Examples 27 | -------- 28 | > var out = {{alias}}( 'float32', 'int32' ) 29 | 'float64' 30 | 31 | See Also 32 | -------- 33 | 34 | -------------------------------------------------------------------------------- /base/dtype-resolve-enum/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import resolve = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns a number or null... 25 | { 26 | resolve( 0 ); // $ExpectType number | null 27 | resolve( 'float64' ); // $ExpectType number | null 28 | } 29 | -------------------------------------------------------------------------------- /base/dtype-resolve-str/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import resolve = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns a string or null... 25 | { 26 | resolve( 0 ); // $ExpectType string | null 27 | resolve( 'float64' ); // $ExpectType string | null 28 | } 29 | -------------------------------------------------------------------------------- /base/napi/addon-arguments/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /base/reverse/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, writable ) 3 | Returns a view of an input ndarray in which the order of elements along each 4 | dimension is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | writable: boolean 12 | Boolean indicating whether a returned ndarray should be writable. This 13 | parameter only applies to ndarray constructors which support read-only 14 | instances. 15 | 16 | Returns 17 | ------- 18 | out: ndarray 19 | Output array view. 20 | 21 | Examples 22 | -------- 23 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 24 | 25 | > x.shape 26 | [ 2, 2 ] 27 | > var y = {{alias}}( x, false ) 28 | 29 | > y.shape 30 | [ 2, 2 ] 31 | > {{alias:@stdlib/ndarray/to-array}}( y ) 32 | [ [ 4, 3 ], [ 2, 1 ] ] 33 | 34 | See Also 35 | -------- 36 | 37 | -------------------------------------------------------------------------------- /base/napi/dtype-string-to-dtype/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /base/napi/dtype-string-to-dtype/lib/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MODULES // 22 | 23 | var resolve = require( 'path' ).resolve; 24 | 25 | 26 | // MAIN // 27 | 28 | var dir = resolve( __dirname, '..', 'include' ); 29 | 30 | 31 | // EXPORTS // 32 | 33 | module.exports = dir; 34 | -------------------------------------------------------------------------------- /base/napi/typedarray-type-to-dtype/lib/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2020 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MODULES // 22 | 23 | var resolve = require( 'path' ).resolve; 24 | 25 | 26 | // MAIN // 27 | 28 | var dir = resolve( __dirname, '..', 'include' ); 29 | 30 | 31 | // EXPORTS // 32 | 33 | module.exports = dir; 34 | -------------------------------------------------------------------------------- /base/napi/typedarray-type-to-dtype/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import headerDir = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The variable is a string... 25 | { 26 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 27 | headerDir; // $ExpectType string 28 | } 29 | -------------------------------------------------------------------------------- /base/output-policy-resolve-enum/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2023 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import resolve = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns a number or null... 25 | { 26 | resolve( 0 ); // $ExpectType number | null 27 | resolve( 'float64' ); // $ExpectType number | null 28 | } 29 | -------------------------------------------------------------------------------- /base/output-policy-resolve-str/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2023 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import resolve = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns a string or null... 25 | { 26 | resolve( 0 ); // $ExpectType string | null 27 | resolve( 'float64' ); // $ExpectType string | null 28 | } 29 | -------------------------------------------------------------------------------- /casting-modes/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns a list of ndarray casting modes. 4 | 5 | The output array contains the following modes: 6 | 7 | - 'none': only allow casting between identical types. 8 | - 'equiv': allow casting between identical and byte swapped types. 9 | - 'safe': only allow "safe" casts. 10 | - 'mostly-safe': allow "safe" casts and, for floating-point data types, 11 | downcasts. 12 | - 'same-kind': allow "safe" casts and casts within the same kind (e.g., 13 | between signed integers or between floats). 14 | - 'unsafe': allow casting between all types (including between integers and 15 | floats). 16 | 17 | Returns 18 | ------- 19 | out: Array 20 | List of ndarray casting modes. 21 | 22 | Examples 23 | -------- 24 | > var out = {{alias}}() 25 | [ 'none', 'equiv', 'safe', 'mostly-safe', 'same-kind', 'unsafe' ] 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /dispatch-by/test/fixtures/nullary.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2022 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | /** 24 | * Nullary callback. 25 | * 26 | * @private 27 | * @returns {number} value 28 | */ 29 | function nullary() { 30 | return 3.0; 31 | } 32 | 33 | 34 | // EXPORTS // 35 | 36 | module.exports = nullary; 37 | -------------------------------------------------------------------------------- /dispatch/test/fixtures/nullary.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | /** 24 | * Nullary callback. 25 | * 26 | * @private 27 | * @returns {number} value 28 | */ 29 | function nullary() { 30 | return 3.0; 31 | } 32 | 33 | 34 | // EXPORTS // 35 | 36 | module.exports = nullary; 37 | -------------------------------------------------------------------------------- /base/to-reversed-dimension/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x, dim ) 3 | Returns a new ndarray where the order of elements of an input ndarray along 4 | a specified dimension is reversed. 5 | 6 | Parameters 7 | ---------- 8 | x: ndarray 9 | Input array. 10 | 11 | dim: integer 12 | Index of dimension to reverse. If less than zero, the index is resolved 13 | relative to the last dimension, with the last dimension corresponding to 14 | the value `-1`. 15 | 16 | Returns 17 | ------- 18 | out: ndarray 19 | Output array. 20 | 21 | Examples 22 | -------- 23 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) 24 | 25 | > x.shape 26 | [ 2, 2 ] 27 | > var y = {{alias}}( x, 0 ) 28 | 29 | > y.shape 30 | [ 2, 2 ] 31 | > {{alias:@stdlib/ndarray/to-array}}( y ) 32 | [ [ 3, 4 ], [ 1, 2 ] ] 33 | 34 | See Also 35 | -------- 36 | 37 | -------------------------------------------------------------------------------- /base/buffer-ctors/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2018 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var logEachMap = require( '@stdlib/console/log-each-map' ); 22 | var dtypes = require( './../../../dtypes' ); 23 | var ctors = require( './../lib' ); 24 | 25 | var dts = dtypes( 'integer_and_generic' ); 26 | logEachMap( '%s => %s', dts, ctors ); 27 | -------------------------------------------------------------------------------- /base/assert/is-single-segment-compatible/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/bytes-per-element", 37 | "@stdlib/ndarray/base/minmax-view-buffer-index", 38 | "@stdlib/ndarray/base/numel", 39 | "@stdlib/ndarray/dtypes" 40 | ] 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /base/broadcast-shapes/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shapes ) 3 | Broadcasts array shapes to a single shape. 4 | 5 | Two respective dimensions in two shape arrays are compatible if 6 | 7 | 1. the dimensions are equal. 8 | 2. one dimension is `1`. 9 | 10 | The function returns `null` if provided incompatible shapes (i.e., shapes 11 | which cannot be broadcast with one another). 12 | 13 | Parameters 14 | ---------- 15 | shapes: Array 16 | Array of shape arrays. 17 | 18 | Returns 19 | ------- 20 | out: Array|null 21 | Broadcast shape. 22 | 23 | Examples 24 | -------- 25 | // Compatible shapes: 26 | > var sh1 = [ 8, 1, 6, 1 ]; 27 | > var sh2 = [ 7, 1, 5 ]; 28 | > var sh = {{alias}}( [ sh1, sh2 ] ) 29 | [ 8, 7, 6, 5 ] 30 | 31 | // Incompatible shapes: 32 | > sh1 = [ 3, 2 ]; 33 | > sh1 = [ 2, 3 ]; 34 | > sh = {{alias}}( [ sh1, sh2 ] ) 35 | null 36 | 37 | See Also 38 | -------- 39 | 40 | -------------------------------------------------------------------------------- /base/strides2order/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( strides ) 3 | Returns the order of a multidimensional array based on a provided stride 4 | array. 5 | 6 | The function returns one of the following values: 7 | 8 | - 1: the array is in row-major order. 9 | - 2: the array is in column-major order. 10 | - 3: the array is in both row-major and column-major order. 11 | - 0: the array is in neither row-major nor column-major order. 12 | 13 | Parameters 14 | ---------- 15 | strides: ArrayLike 16 | Stride array. 17 | 18 | Returns 19 | ------- 20 | order: integer 21 | Order. 22 | 23 | Examples 24 | -------- 25 | > var s = [ 30, -10, 1 ]; 26 | > var out = {{alias}}( s ) 27 | 1 28 | > s = [ 1, -10, 30 ]; 29 | > out = {{alias}}( s ) 30 | 2 31 | > s = [ 10 ]; 32 | > out = {{alias}}( s ) 33 | 3 34 | > s = []; 35 | > out = {{alias}}( s ) 36 | 0 37 | 38 | See Also 39 | -------- 40 | 41 | -------------------------------------------------------------------------------- /base/buffer/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2018 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var dtypes = require( './../../../dtypes' ); 22 | var buffer = require( './../lib' ); 23 | 24 | var DTYPES = dtypes(); 25 | 26 | var buf; 27 | var i; 28 | for ( i = 0; i < DTYPES.length; i++ ) { 29 | buf = buffer( DTYPES[ i ], 10 ); 30 | console.log( buf ); 31 | } 32 | -------------------------------------------------------------------------------- /base/napi/unary/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/napi/addon-arguments", 37 | "@stdlib/ndarray/base/function-object", 38 | "@stdlib/ndarray/base/unary", 39 | "@stdlib/ndarray/ctor", 40 | "@stdlib/ndarray/dtypes" 41 | ] 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /index-modes/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}() 3 | Returns a list of ndarray index modes. 4 | 5 | The output array contains the following modes: 6 | 7 | - throw: specifies that a function should throw an error when an index is 8 | outside a restricted interval. 9 | - normalize: specifies that a function should normalize negative indices and 10 | throw an error when an index is outside a restricted interval. 11 | - wrap: specifies that a function should wrap around an index using modulo 12 | arithmetic. 13 | - clamp: specifies that a function should set an index less than zero to 14 | zero (minimum index) and set an index greater than a maximum index value to 15 | the maximum possible index. 16 | 17 | Returns 18 | ------- 19 | out: Array 20 | List of ndarray index modes. 21 | 22 | Examples 23 | -------- 24 | > var out = {{alias}}() 25 | [ 'throw', 'normalize', 'clamp', 'wrap' ] 26 | 27 | See Also 28 | -------- 29 | 30 | -------------------------------------------------------------------------------- /base/assert/is-row-major-contiguous/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/assert/is-row-major", 37 | "@stdlib/ndarray/base/assert/is-single-segment-compatible", 38 | "@stdlib/ndarray/base/iteration-order", 39 | "@stdlib/ndarray/dtypes" 40 | ] 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /base/unary/scripts/lib/exclude_dtypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MAIN // 22 | 23 | // Data types to exclude when generating loops: 24 | var EXCLUDE_DTYPES = [ 25 | 'binary', 26 | 'generic', 27 | 'uint8c', 28 | 'float16', 29 | 'complex32' 30 | ]; 31 | 32 | 33 | // EXPORTS // 34 | 35 | module.exports = EXCLUDE_DTYPES; 36 | -------------------------------------------------------------------------------- /base/assert/is-column-major-contiguous/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": {}, 3 | "fields": [ 4 | { 5 | "field": "src", 6 | "resolve": true, 7 | "relative": true 8 | }, 9 | { 10 | "field": "include", 11 | "resolve": true, 12 | "relative": true 13 | }, 14 | { 15 | "field": "libraries", 16 | "resolve": false, 17 | "relative": false 18 | }, 19 | { 20 | "field": "libpath", 21 | "resolve": true, 22 | "relative": false 23 | } 24 | ], 25 | "confs": [ 26 | { 27 | "src": [ 28 | "./src/main.c" 29 | ], 30 | "include": [ 31 | "./include" 32 | ], 33 | "libraries": [], 34 | "libpath": [], 35 | "dependencies": [ 36 | "@stdlib/ndarray/base/assert/is-column-major", 37 | "@stdlib/ndarray/base/assert/is-single-segment-compatible", 38 | "@stdlib/ndarray/base/iteration-order", 39 | "@stdlib/ndarray/dtypes" 40 | ] 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /base/napi/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /base/assert/is-contiguous/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides, offset ) 3 | Returns a boolean indicating if an array is contiguous. 4 | 5 | An array is considered contiguous if the memory address of each array 6 | element is adjacent to the memory address of the next array element. 7 | 8 | Parameters 9 | ---------- 10 | shape: ArrayLike 11 | Array shape. 12 | 13 | strides: ArrayLike 14 | Stride array. 15 | 16 | offset: integer 17 | Location of the first indexed value based on the stride array. 18 | 19 | Returns 20 | ------- 21 | bool: boolean 22 | Boolean indicating if an array is contiguous. 23 | 24 | Examples 25 | -------- 26 | > var d = [ 2, 3, 10 ]; 27 | > var s = [ 30, 10, 1 ]; 28 | > var o = 0; 29 | > var bool = {{alias}}( d, s, o ) 30 | true 31 | > d = [ 10 ]; 32 | > s = [ 3 ]; 33 | > o = 0; 34 | > bool = {{alias}}( d, s, o ) 35 | false 36 | 37 | See Also 38 | -------- 39 | 40 | -------------------------------------------------------------------------------- /base/napi/unary/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /casting-modes/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import modes = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns an array of strings... 25 | { 26 | modes(); // $ExpectType string[] 27 | } 28 | 29 | // The compiler throws an error if the function is provided any arguments... 30 | { 31 | modes( 9 ); // $ExpectError 32 | } 33 | -------------------------------------------------------------------------------- /index-modes/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import modes = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns an array of strings... 25 | { 26 | modes(); // $ExpectType string[] 27 | } 28 | 29 | // The compiler throws an error if the function is provided any arguments... 30 | { 31 | modes( 9 ); // $ExpectError 32 | } 33 | -------------------------------------------------------------------------------- /orders/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import orders = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns an array of strings... 25 | { 26 | orders(); // $ExpectType string[] 27 | } 28 | 29 | // The compiler throws an error if the function is provided any arguments... 30 | { 31 | orders( 9 ); // $ExpectError 32 | } 33 | -------------------------------------------------------------------------------- /base/from-scalar/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( value, dtype, order ) 3 | Returns a zero-dimensional ndarray containing a provided scalar value. 4 | 5 | If `value` is a number and `dtype` is a complex number data type, the 6 | function returns a zero-dimensional ndarray containing a complex number 7 | whose real component equals the provided scalar value and whose imaginary 8 | component is zero. 9 | 10 | Parameters 11 | ---------- 12 | value: any 13 | Scalar value. 14 | 15 | dtype: string 16 | Data type. 17 | 18 | order: string 19 | Memory layout (either 'row-major' or 'column-major'). 20 | 21 | Returns 22 | ------- 23 | out: ndarray 24 | Output array. 25 | 26 | Examples 27 | -------- 28 | > var x = {{alias}}( 1.0, 'float64', 'row-major' ) 29 | 30 | > var sh = x.shape 31 | [] 32 | > var dt = x.dtype 33 | 'float64' 34 | > var v = x.get() 35 | 1.0 36 | 37 | See Also 38 | -------- 39 | 40 | -------------------------------------------------------------------------------- /base/function-object/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | #/ 2 | # @license Apache-2.0 3 | # 4 | # Copyright (c) 2017 The Stdlib Authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | #/ 18 | 19 | # Configuration for [npm][1]. 20 | # 21 | # [1]: https://docs.npmjs.com/files/npmrc 22 | 23 | # Disable the creation of a lock file: 24 | package-lock = false 25 | shrinkwrap = false 26 | 27 | # Disable automatically "saving" dependencies on install: 28 | save = false 29 | 30 | # Do not generate provenance metadata: 31 | provenance = false 32 | -------------------------------------------------------------------------------- /base/max-view-buffer-index/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides, offset ) 3 | Computes the maximum linear index in an underlying data buffer accessible to 4 | an array view. 5 | 6 | Parameters 7 | ---------- 8 | shape: ArrayLike 9 | Array shape. 10 | 11 | strides: ArrayLike 12 | Stride array. 13 | 14 | offset: integer 15 | Location of the first indexed value based on the stride array. 16 | 17 | Returns 18 | ------- 19 | out: integer 20 | Maximum linear index in an underlying data buffer accessible to an array 21 | view. 22 | 23 | Examples 24 | -------- 25 | > var d = [ 2, 3, 10 ]; 26 | > var s = [ 30, -10, 1 ]; 27 | > var o = 20; 28 | > var out = {{alias}}( d, s, o ) 29 | 59 30 | > s = [ 30, 10, 1 ]; 31 | > o = 0; 32 | > out = {{alias}}( d, s, o ) 33 | 59 34 | > s = [ -30, -10, -1 ]; 35 | > o = 59; 36 | > out = {{alias}}( d, s, o ) 37 | 59 38 | 39 | See Also 40 | -------- 41 | 42 | -------------------------------------------------------------------------------- /base/min-view-buffer-index/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides, offset ) 3 | Computes the minimum linear index in an underlying data buffer accessible to 4 | an array view. 5 | 6 | Parameters 7 | ---------- 8 | shape: ArrayLike 9 | Array shape. 10 | 11 | strides: ArrayLike 12 | Stride array. 13 | 14 | offset: integer 15 | Location of the first indexed value based on the stride array. 16 | 17 | Returns 18 | ------- 19 | out: integer 20 | Minimum linear index in an underlying data buffer accessible to an array 21 | view. 22 | 23 | Examples 24 | -------- 25 | > var d = [ 2, 3, 10 ]; 26 | > var s = [ 30, -10, 1 ]; 27 | > var o = 40; 28 | > var out = {{alias}}( d, s, o ) 29 | 20 30 | > s = [ 30, 10, 1 ]; 31 | > o = 20; 32 | > out = {{alias}}( d, s, o ) 33 | 20 34 | > s = [ -30, -10, -1 ]; 35 | > o = 79; 36 | > out = {{alias}}( d, s, o ) 37 | 20 38 | 39 | See Also 40 | -------- 41 | 42 | -------------------------------------------------------------------------------- /base/napi/addon-arguments/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /base/napi/include/stdlib/ndarray/base/napi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef STDLIB_NDARRAY_BASE_NAPI_H 20 | #define STDLIB_NDARRAY_BASE_NAPI_H 21 | 22 | // Note: keep in alphabetical order... 23 | #include "stdlib/ndarray/base/napi/unary.h" 24 | #include "stdlib/ndarray/base/unary.h" 25 | 26 | #include "stdlib/ndarray/dtypes.h" 27 | 28 | #endif // !STDLIB_NDARRAY_BASE_NAPI_H 29 | -------------------------------------------------------------------------------- /base/napi/dtype-string-to-dtype/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /base/napi/typedarray-type-to-dtype/docs/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // TypeScript Version: 4.1 20 | 21 | /** 22 | * Absolute file path for the directory containing header files for C APIs. 23 | * 24 | * @example 25 | * var dir = headerDir; 26 | * // returns 27 | */ 28 | declare const headerDir: string; 29 | 30 | 31 | // EXPORTS // 32 | 33 | export = headerDir; 34 | -------------------------------------------------------------------------------- /input-casting-policies/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import policies = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns an array of strings... 25 | { 26 | policies(); // $ExpectType Policies 27 | } 28 | 29 | // The compiler throws an error if the function is provided any arguments... 30 | { 31 | policies( 9 ); // $ExpectError 32 | } 33 | -------------------------------------------------------------------------------- /output-dtype-policies/docs/types/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2023 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import policies = require( './index' ); 20 | 21 | 22 | // TESTS // 23 | 24 | // The function returns an array of strings... 25 | { 26 | policies(); // $ExpectType Policies 27 | } 28 | 29 | // The compiler throws an error if the function is provided any arguments... 30 | { 31 | policies( 9 ); // $ExpectError 32 | } 33 | -------------------------------------------------------------------------------- /with/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var zeros = require( './../../zeros' ); 22 | var ndarray2array = require( './../../to-array' ); 23 | var ndarrayWith = require( './../lib' ); 24 | 25 | var x = zeros( [ 1, 3, 3 ], { 26 | 'dtype': 'float64' 27 | }); 28 | 29 | var out = ndarrayWith( x, [ 0, 1, 1 ], 10.0 ); 30 | console.log( ndarray2array( out ) ); 31 | -------------------------------------------------------------------------------- /fliplr/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var uniform = require( '@stdlib/random/uniform' ); 22 | var ndarray2array = require( './../../to-array' ); 23 | var fliplr = require( './../lib' ); 24 | 25 | var x = uniform( [ 3, 3, 3 ], -10.0, 10.0 ); 26 | console.log( ndarray2array( x ) ); 27 | 28 | var y = fliplr( x ); 29 | console.log( ndarray2array( y ) ); 30 | -------------------------------------------------------------------------------- /flipud/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var uniform = require( '@stdlib/random/uniform' ); 22 | var ndarray2array = require( './../../to-array' ); 23 | var flipud = require( './../lib' ); 24 | 25 | var x = uniform( [ 3, 3, 3 ], -10.0, 10.0 ); 26 | console.log( ndarray2array( x ) ); 27 | 28 | var y = flipud( x ); 29 | console.log( ndarray2array( y ) ); 30 | -------------------------------------------------------------------------------- /reverse/examples/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2025 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | var uniform = require( '@stdlib/random/uniform' ); 22 | var ndarray2array = require( './../../to-array' ); 23 | var reverse = require( './../lib' ); 24 | 25 | var x = uniform( [ 3, 3, 3 ], -10.0, 10.0 ); 26 | console.log( ndarray2array( x ) ); 27 | 28 | var y = reverse( x ); 29 | console.log( ndarray2array( y ) ); 30 | -------------------------------------------------------------------------------- /base/assert/is-row-major-contiguous/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( shape, strides, offset ) 3 | Returns a boolean indicating if an array is row-major contiguous. 4 | 5 | An array is considered contiguous if the memory address of each array 6 | element is adjacent to the memory address of the next array element. 7 | 8 | Parameters 9 | ---------- 10 | shape: ArrayLike 11 | Array shape. 12 | 13 | strides: ArrayLike 14 | Stride array. 15 | 16 | offset: integer 17 | Location of the first indexed value based on the stride array. 18 | 19 | Returns 20 | ------- 21 | bool: boolean 22 | Boolean indicating if an array is row-major contiguous. 23 | 24 | Examples 25 | -------- 26 | > var d = [ 2, 3, 10 ]; 27 | > var s = [ 30, 10, 1 ]; 28 | > var o = 0; 29 | > var bool = {{alias}}( d, s, o ) 30 | true 31 | > d = [ 10 ]; 32 | > s = [ 3 ]; 33 | > o = 0; 34 | > bool = {{alias}}( d, s, o ) 35 | false 36 | 37 | See Also 38 | -------- 39 | 40 | -------------------------------------------------------------------------------- /base/napi/test/test.browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Apache-2.0 3 | * 4 | * Copyright (c) 2021 The Stdlib Authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | // MODULES // 22 | 23 | var tape = require( 'tape' ); 24 | var headerDir = require( './../lib/browser.js' ); 25 | 26 | 27 | // TESTS // 28 | 29 | tape( 'main export is null', function test( t ) { 30 | t.ok( true, __filename ); 31 | t.strictEqual( headerDir, null, 'main export is null' ); 32 | t.end(); 33 | }); 34 | -------------------------------------------------------------------------------- /base/remove-singleton-dimensions/docs/repl.txt: -------------------------------------------------------------------------------- 1 | 2 | {{alias}}( x ) 3 | Returns an array without singleton dimensions. 4 | 5 | If a provided ndarray does not have any singleton dimensions, the function 6 | returns the provided ndarray unchanged. 7 | 8 | If a provided ndarray does have singleton dimensions, the function returns a 9 | new ndarray view. 10 | 11 | Parameters 12 | ---------- 13 | x: ndarray 14 | Input array. 15 | 16 | Returns 17 | ------- 18 | out: ndarray 19 | Squeezed array. 20 | 21 | Examples 22 | -------- 23 | > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ], { 'ndmin': 5 } ) 24 | 25 | > var sh = x.shape 26 | [ 1, 1, 1, 2, 2 ] 27 | > var y = {{alias}}( x ) 28 | 29 | > sh = y.shape 30 | [ 2, 2 ] 31 | > var v = y.get( 0, 0 ) 32 | 1 33 | > v = y.get( 0, 1 ) 34 | 2 35 | > v = y.get( 1, 0 ) 36 | 3 37 | > v = y.get( 1, 1 ) 38 | 4 39 | 40 | See Also 41 | -------- 42 | 43 | --------------------------------------------------------------------------------