From ab4943c7dac699ceb4c14bf0b856810cf9fd88fd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 21 Feb 2024 23:40:45 +0000 Subject: [PATCH] Auto-generated commit --- base/assert/docs/types/index.d.ts | 467 ++++++++++++++++++++++++++++++ base/docs/types/index.d.ts | 173 ++++++++++- docs/types/index.d.ts | 396 ++++++++++++++++--------- 3 files changed, 897 insertions(+), 139 deletions(-) diff --git a/base/assert/docs/types/index.d.ts b/base/assert/docs/types/index.d.ts index 6a38f909..169f962a 100644 --- a/base/assert/docs/types/index.d.ts +++ b/base/assert/docs/types/index.d.ts @@ -23,8 +23,21 @@ import contains = require( './../../../../base/assert/contains' ); import hasSameValues = require( './../../../../base/assert/has-same-values' ); import isAccessorArray = require( './../../../../base/assert/is-accessor-array' ); +import isComplexFloatingPointDataType = require( './../../../../base/assert/is-complex-floating-point-data-type' ); +import isComplexTypedArray = require( './../../../../base/assert/is-complex-typed-array' ); import isComplex64Array = require( './../../../../base/assert/is-complex64array' ); import isComplex128Array = require( './../../../../base/assert/is-complex128array' ); +import isDataType = require( './../../../../base/assert/is-data-type' ); +import isFloatingPointDataType = require( './../../../../base/assert/is-floating-point-data-type' ); +import isIntegerDataType = require( './../../../../base/assert/is-integer-data-type' ); +import isMostlySafeDataTypeCast = require( './../../../../base/assert/is-mostly-safe-data-type-cast' ); +import isNumericDataType = require( './../../../../base/assert/is-numeric-data-type' ); +import isRealDataType = require( './../../../../base/assert/is-real-data-type' ); +import isRealFloatingPointDataType = require( './../../../../base/assert/is-real-floating-point-data-type' ); +import isSafeDataTypeCast = require( './../../../../base/assert/is-safe-data-type-cast' ); +import isSameKindDataTypeCast = require( './../../../../base/assert/is-same-kind-data-type-cast' ); +import isSignedIntegerDataType = require( './../../../../base/assert/is-signed-integer-data-type' ); +import isUnsignedIntegerDataType = require( './../../../../base/assert/is-unsigned-integer-data-type' ); /** * Interface describing the `assert` namespace. @@ -93,6 +106,73 @@ interface Namespace { */ isAccessorArray: typeof isAccessorArray; + /** + * Tests whether an input value is a supported array complex-valued floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array complex-valued floating-point data type + * + * @example + * var bool = ns.isComplexFloatingPointDataType( 'complex64' ); + * // returns true + * + * bool = ns.isComplexFloatingPointDataType( 'complex128' ); + * // returns true + * + * bool = ns.isComplexFloatingPointDataType( 'float32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'float64' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isComplexFloatingPointDataType( 'foo' ); + * // returns false + */ + isComplexFloatingPointDataType: typeof isComplexFloatingPointDataType; + + /** + * Tests if a value is a complex typed array. + * + * @param value - value to test + * @returns boolean indicating whether a value is complex typed array + * + * @example + * var Complex128Array = require( './../../../../complex128' ); + * + * var arr = new Complex128Array( 10 ); + * var bool = ns.isComplexTypedArray( arr ); + * // returns true + * + * @example + * var bool = ns.isComplexTypedArray( [] ); + * // returns false + */ + isComplexTypedArray: typeof isComplexTypedArray; + /** * Tests if a value is a `Complex64Array`. * @@ -130,6 +210,393 @@ interface Namespace { * // returns false */ isComplex128Array: typeof isComplex128Array; + + /** + * Tests whether an input value is a supported array data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array data type + * + * @example + * var bool = ns.isDataType( 'float32' ); + * // returns true + * + * bool = ns.isDataType( 'float64' ); + * // returns true + * + * bool = ns.isDataType( 'generic' ); + * // returns true + * + * bool = ns.isDataType( 'int16' ); + * // returns true + * + * bool = ns.isDataType( 'int32' ); + * // returns true + * + * bool = ns.isDataType( 'int8' ); + * // returns true + * + * bool = ns.isDataType( 'uint16' ); + * // returns true + * + * bool = ns.isDataType( 'uint32' ); + * // returns true + * + * bool = ns.isDataType( 'uint8' ); + * // returns true + * + * bool = ns.isDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isDataType( 'foo' ); + * // returns false + */ + isDataType: typeof isDataType; + + /** + * Tests whether an input value is a supported array floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array floating-point data type + * + * @example + * var bool = ns.isFloatingPointDataType( 'float32' ); + * // returns true + * + * bool = ns.isFloatingPointDataType( 'float64' ); + * // returns true + * + * bool = ns.isFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isFloatingPointDataType( 'foo' ); + * // returns false + */ + isFloatingPointDataType: typeof isFloatingPointDataType; + + /** + * Tests whether an input value is a supported array integer (i.e., signed or unsigned integer) data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array integer data type + * + * @example + * var bool = ns.isIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isIntegerDataType( 'int16' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'int32' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'int8' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint16' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint32' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint8' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isIntegerDataType( 'foo' ); + * // returns false + */ + isIntegerDataType: typeof isIntegerDataType; + + /** + * Returns a boolean indicating if a provided array data type can be safely cast or, for floating-point data types, downcast to another array data type. + * + * @param from - array data type + * @param to - array data type + * @returns boolean indicating if a data type can be cast to another data type + * + * @example + * var bool = ns.isMostlySafeDataTypeCast( 'float32', 'float64' ); + * // returns true + * + * bool = ns.isMostlySafeDataTypeCast( 'float64', 'int32' ); + * // returns false + */ + isMostlySafeDataTypeCast: typeof isMostlySafeDataTypeCast; + + /** + * Tests whether an input value is a supported array numeric data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array numeric data type + * + * @example + * var bool = ns.isNumericDataType( 'float32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'float64' ); + * // returns true + * + * bool = ns.isNumericDataType( 'generic' ); + * // returns false + * + * bool = ns.isNumericDataType( 'int16' ); + * // returns true + * + * bool = ns.isNumericDataType( 'int32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'int8' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint16' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint32' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint8' ); + * // returns true + * + * bool = ns.isNumericDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isNumericDataType( 'foo' ); + * // returns false + */ + isNumericDataType: typeof isNumericDataType; + + /** + * Tests whether an input value is a supported array real-valued data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array real-valued data type + * + * @example + * var bool = ns.isRealDataType( 'float32' ); + * // returns true + * + * bool = ns.isRealDataType( 'float64' ); + * // returns true + * + * bool = ns.isRealDataType( 'complex128' ); + * // returns false + * + * bool = ns.isRealDataType( 'generic' ); + * // returns false + * + * bool = ns.isRealDataType( 'int16' ); + * // returns true + * + * bool = ns.isRealDataType( 'int32' ); + * // returns true + * + * bool = ns.isRealDataType( 'int8' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint16' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint32' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint8' ); + * // returns true + * + * bool = ns.isRealDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isRealDataType( 'foo' ); + * // returns false + */ + isRealDataType: typeof isRealDataType; + + /** + * Tests whether an input value is a supported array real-valued floating-point data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array real-valued floating-point data type + * + * @example + * var bool = ns.isRealFloatingPointDataType( 'float32' ); + * // returns true + * + * bool = ns.isRealFloatingPointDataType( 'float64' ); + * // returns true + * + * bool = ns.isRealFloatingPointDataType( 'generic' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int16' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int32' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'int8' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint16' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint32' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint8' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isRealFloatingPointDataType( 'foo' ); + * // returns false + */ + isRealFloatingPointDataType: typeof isRealFloatingPointDataType; + + /** + * Returns a boolean indicating if a provided array data type can be safely cast to another array data type. + * + * @param from - array data type + * @param to - array data type + * @returns boolean indicating if a data type can be safely cast to another data type + * + * @example + * var bool = ns.isSafeDataTypeCast( 'float32', 'float64' ); + * // returns true + * + * bool = ns.isSafeDataTypeCast( 'float64', 'int32' ); + * // returns false + */ + isSafeDataTypeCast: typeof isSafeDataTypeCast; + + /** + * Returns a boolean indicating if a provided array data type can be safely cast to, or is of the same "kind" as, another array data type. + * + * @param from - array data type + * @param to - array data type + * @returns boolean indicating if a data type can be cast to another data type + * + * @example + * var bool = ns.isSameKindDataTypeCast( 'float32', 'float64' ); + * // returns true + * + * bool = ns.isSameKindDataTypeCast( 'uint16', 'int16' ); + * // returns false + */ + isSameKindDataTypeCast: typeof isSameKindDataTypeCast; + + /** + * Tests whether an input value is a supported array signed integer data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array signed integer data type + * + * @example + * var bool = ns.isSignedIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'int16' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'int32' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'int8' ); + * // returns true + * + * bool = ns.isSignedIntegerDataType( 'uint16' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint32' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint8' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'uint8c' ); + * // returns false + * + * bool = ns.isSignedIntegerDataType( 'foo' ); + * // returns false + */ + isSignedIntegerDataType: typeof isSignedIntegerDataType; + + /** + * Tests whether an input value is a supported array unsigned integer data type. + * + * @param v - value to test + * @returns boolean indicating whether an input value is a supported array unsigned integer data type + * + * @example + * var bool = ns.isUnsignedIntegerDataType( 'float32' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'float64' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'generic' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int16' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int32' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'int8' ); + * // returns false + * + * bool = ns.isUnsignedIntegerDataType( 'uint16' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint32' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint8' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'uint8c' ); + * // returns true + * + * bool = ns.isUnsignedIntegerDataType( 'foo' ); + * // returns false + */ + isUnsignedIntegerDataType: typeof isUnsignedIntegerDataType; } /** diff --git a/base/docs/types/index.d.ts b/base/docs/types/index.d.ts index a039f072..094c6656 100644 --- a/base/docs/types/index.d.ts +++ b/base/docs/types/index.d.ts @@ -63,10 +63,14 @@ import cartesianProduct = require( './../../../base/cartesian-product' ); import cartesianSquare = require( './../../../base/cartesian-square' ); import copy = require( './../../../base/copy' ); import copyIndexed = require( './../../../base/copy-indexed' ); +import countFalsy = require( './../../../base/count-falsy' ); +import countTruthy = require( './../../../base/count-truthy' ); import dedupe = require( './../../../base/dedupe' ); import every = require( './../../../base/every' ); import everyBy = require( './../../../base/every-by' ); import everyByRight = require( './../../../base/every-by-right' ); +import fancySlice = require( './../../../base/fancy-slice' ); +import fancySliceAssign = require( './../../../base/fancy-slice-assign' ); import filled = require( './../../../base/filled' ); import filledBy = require( './../../../base/filled-by' ); import filled2d = require( './../../../base/filled2d' ); @@ -117,8 +121,11 @@ import map2d = require( './../../../base/map2d' ); import map3d = require( './../../../base/map3d' ); import map4d = require( './../../../base/map4d' ); import map5d = require( './../../../base/map5d' ); +import minSignedIntegerDataType = require( './../../../base/min-signed-integer-dtype' ); +import minUnsignedIntegerDataType = require( './../../../base/min-unsigned-integer-dtype' ); import mskbinary2d = require( './../../../base/mskbinary2d' ); import mskfilter = require( './../../../base/mskfilter' ); +import mskreject = require( './../../../base/mskreject' ); import mskunary2d = require( './../../../base/mskunary2d' ); import mskunary3d = require( './../../../base/mskunary3d' ); import nCartesianProduct = require( './../../../base/n-cartesian-product' ); @@ -140,6 +147,7 @@ import quinary2d = require( './../../../base/quinary2d' ); import quinary3d = require( './../../../base/quinary3d' ); import quinary4d = require( './../../../base/quinary4d' ); import quinary5d = require( './../../../base/quinary5d' ); +import reject = require( './../../../base/reject' ); import resolveGetter = require( './../../../base/resolve-getter' ); import resolveSetter = require( './../../../base/resolve-setter' ); import reverse = require( './../../../base/reverse' ); @@ -1318,6 +1326,34 @@ interface Namespace { */ copyIndexed: typeof copyIndexed; + /** + * Counts the number of falsy values in an array. + * + * @param x - input array + * @returns number of falsy values + * + * @example + * var x = [ 0, 1, 0, 1, 1 ]; + * + * var out = ns.countFalsy( x ); + * // returns 2 + */ + countFalsy: typeof countFalsy; + + /** + * Counts the number of truthy values in an array. + * + * @param x - input array + * @returns number of truthy values + * + * @example + * var x = [ 0, 1, 0, 1, 1 ]; + * + * var out = ns.countTruthy( x ); + * // returns 3 + */ + countTruthy: typeof countTruthy; + /** * Removes consecutive duplicated values. * @@ -1419,6 +1455,55 @@ interface Namespace { */ everyByRight: typeof everyByRight; + /** + * Returns a shallow copy of a portion of an array. + * + * @param x - input array + * @param s - slice object + * @param strict - boolean indicating whether to enforce strict bounds checking + * @returns output array + * + * @example + * var Slice = require( '@stdlib/ns.fancySlice/ctor' ); + * + * var x = [ 1, 2, 3, 4, 5, 6 ]; + * + * var out = ns.fancySlice( x, new Slice( null, null, -1 ), false ); + * // returns [ 6, 5, 4, 3, 2, 1 ] + */ + fancySlice: typeof fancySlice; + + /** + * Assigns element values from a broadcasted input array to corresponding elements in an output array. + * + * ## Notes + * + * - The input array must be broadcast compatible with the output array slice to which elements will be assigned (i.e., contain only one element or the same number of elements as in the slice). + * - The input array must have a data type which can be safely cast to the output array data type. Floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., element values from a `'float64'` input array can be assigned to corresponding elements in a `'float32'` output array). + * + * @param x - input array + * @param y - output array + * @param s - slice object + * @param strict - boolean indicating whether to enforce strict bounds checking + * @returns output array + * + * @example + * var Slice = require( '@stdlib/slice/ctor' ); + * + * var x = [ 1, 2, 3, 4 ]; + * var y = [ 0, 0, 0, 0, 0, 0, 0, 0 ]; + * + * var s = new Slice( null, null, 2 ); + * // returns + * + * var out = ns.fancySliceAssign( x, y, s, false ); + * // returns [ 1, 0, 2, 0, 3, 0, 4, 0 ] + * + * var bool = ( out === y ); + * // returns true + */ + fancySliceAssign: typeof fancySliceAssign; + /** * Returns a filled "generic" array. * @@ -2562,6 +2647,38 @@ interface Namespace { */ map5d: typeof map5d; + /** + * Returns the minimum array data type for storing a provided signed integer value. + * + * @param value - scalar value + * @returns array data type + * + * @example + * var dt = ns.minSignedIntegerDataType( 1280 ); + * // returns 'int16' + * + * @example + * var dt = ns.minSignedIntegerDataType( 3 ); + * // returns 'int8' + */ + minSignedIntegerDataType: typeof minSignedIntegerDataType; + + /** + * Returns the minimum array data type for storing a provided unsigned integer value. + * + * @param value - scalar value + * @returns array data type + * + * @example + * var dt = ns.minUnsignedIntegerDataType( 1280 ); + * // returns 'uint16' + * + * @example + * var dt = ns.minUnsignedIntegerDataType( 3 ); + * // returns 'uint8' + */ + minUnsignedIntegerDataType: typeof minUnsignedIntegerDataType; + /** * Applies a binary callback to elements in two two-dimensional nested input arrays according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array. * @@ -2609,6 +2726,21 @@ interface Namespace { */ mskfilter: typeof mskfilter; + /** + * Returns a new array by applying a mask to a provided input array. + * + * @param x - input array + * @param mask - mask array + * @returns output array + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var y = ns.mskreject( x, [ 0, 1, 0, 1 ] ); + * // returns [ 1, 3 ] + */ + mskreject: typeof mskreject; + /** * Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array. * @@ -3115,6 +3247,22 @@ interface Namespace { */ quinary5d: typeof quinary5d; + /** + * Returns a shallow copy of an array containing only those elements which fail a test implemented by a predicate function. + * + * @param x - input array + * @param predicate - predicate function + * @param thisArg - predicate function execution context + * @returns output array + * + * @example + * var x = [ 1, -2, -3, 4 ]; + * + * var out = ns.reject( x, isPositiveNumber ); + * // returns [ -2, -3 ] + */ + reject: typeof reject; + /** * Returns an accessor function for retrieving an element from an indexed array-like object. * @@ -3192,6 +3340,12 @@ interface Namespace { * @returns output array * * @example + * var x = [ 1, 2, 3 ]; + * + * var out = ns.slice( x, 0, 3 ); + * // returns [ 1, 2, 3 ] + * + * @example * var x = [ 1, 2, 3, 4, 5, 6 ]; * * var out = ns.slice( x, 0, 3 ); @@ -3308,21 +3462,28 @@ interface Namespace { strided2array5d: typeof strided2array5d; /** - * Takes element from an array. - * - * ## Notes - * - * - The function does **not** perform bounds checking. If an index is less than zero or greater than the maximum index of `x`, the value of the corresponding element in the output array is undefined. + * Takes elements from an array. * * @param x - input array * @param indices - list of element indices + * @param mode - index mode * @returns output array * * @example * var x = [ 1, 2, 3, 4 ]; * - * var y = ns.take( x, [ 1, 3 ] ); + * var y = ns.take( x, [ 1, 3 ], 'throw' ); * // returns [ 2, 4 ] + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * var out = [ 0, 0, 0, 0 ]; + * + * var arr = ns.take.assign( x, [ 1, 3 ], 'throw', out, 2, 0 ); + * // returns [ 2, 0, 4, 0 ] + * + * var bool = ( arr === out ); + * // returns true */ take: typeof take; diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 0d55880d..18ee19c7 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -22,51 +22,58 @@ import base = require( './../../base' ); import ArrayBuffer = require( './../../buffer' ); -import acartesianPower = require( './../../cartesian-power' ); -import acartesianProduct = require( './../../cartesian-product' ); -import acartesianSquare = require( './../../cartesian-square' ); +import cartesianPower = require( './../../cartesian-power' ); +import cartesianProduct = require( './../../cartesian-product' ); +import cartesianSquare = require( './../../cartesian-square' ); import Complex64Array = require( './../../complex64' ); import Complex128Array = require( './../../complex128' ); -import convertArray = require( './../../convert' ); -import convertArraySame = require( './../../convert-same' ); -import arrayCtors = require( './../../ctors' ); +import convert = require( './../../convert' ); +import convertSame = require( './../../convert-same' ); +import ctors = require( './../../ctors' ); import DataView = require( './../../dataview' ); import datespace = require( './../../datespace' ); -import arrayDefaults = require( './../../defaults' ); -import arrayDataType = require( './../../dtype' ); -import arrayDataTypes = require( './../../dtypes' ); -import aempty = require( './../../empty' ); -import aemptyLike = require( './../../empty-like' ); -import filledarray = require( './../../filled' ); -import filledarrayBy = require( './../../filled-by' ); +import defaults = require( './../../defaults' ); +import dtype = require( './../../dtype' ); +import dtypes = require( './../../dtypes' ); +import empty = require( './../../empty' ); +import emptyLike = require( './../../empty-like' ); +import filled = require( './../../filled' ); +import filledBy = require( './../../filled-by' ); import Float32Array = require( './../../float32' ); import Float64Array = require( './../../float64' ); import iterator2array = require( './../../from-iterator' ); -import afull = require( './../../full' ); -import afullLike = require( './../../full-like' ); +import scalar2array = require( './../../from-scalar' ); +import full = require( './../../full' ); +import fullLike = require( './../../full-like' ); import incrspace = require( './../../incrspace' ); +import ArrayIndex = require( './../../index' ); import Int8Array = require( './../../int8' ); import Int16Array = require( './../../int16' ); import Int32Array = require( './../../int32' ); import linspace = require( './../../linspace' ); import logspace = require( './../../logspace' ); -import arrayMinDataType = require( './../../min-dtype' ); -import anans = require( './../../nans' ); -import anansLike = require( './../../nans-like' ); -import arrayNextDataType = require( './../../next-dtype' ); -import aoneTo = require( './../../one-to' ); -import aoneToLike = require( './../../one-to-like' ); -import aones = require( './../../ones' ); -import aonesLike = require( './../../ones-like' ); +import minDataType = require( './../../min-dtype' ); +import mostlySafeCasts = require( './../../mostly-safe-casts' ); +import mskfilter = require( './../../mskfilter' ); +import mskreject = require( './../../mskreject' ); +import nans = require( './../../nans' ); +import nansLike = require( './../../nans-like' ); +import nextDataType = require( './../../next-dtype' ); +import oneTo = require( './../../one-to' ); +import oneToLike = require( './../../one-to-like' ); +import ones = require( './../../ones' ); +import onesLike = require( './../../ones-like' ); import typedarraypool = require( './../../pool' ); -import arrayPromotionRules = require( './../../promotion-rules' ); -import reviveTypedArray = require( './../../reviver' ); -import arraySafeCasts = require( './../../safe-casts' ); -import arraySameKindCasts = require( './../../same-kind-casts' ); -import arrayShape = require( './../../shape' ); +import promotionRules = require( './../../promotion-rules' ); +import typedarrayReviver = require( './../../reviver' ); +import safeCasts = require( './../../safe-casts' ); +import sameKindCasts = require( './../../same-kind-casts' ); +import shape = require( './../../shape' ); import SharedArrayBuffer = require( './../../shared-buffer' ); -import aslice = require( './../../slice' ); +import slice = require( './../../slice' ); +import take = require( './../../take' ); import circarray2iterator = require( './../../to-circular-iterator' ); +import array2fancy = require( './../../to-fancy' ); import array2iterator = require( './../../to-iterator' ); import array2iteratorRight = require( './../../to-iterator-right' ); import typedarray2json = require( './../../to-json' ); @@ -98,10 +105,10 @@ import Uint8Array = require( './../../uint8' ); import Uint8ClampedArray = require( './../../uint8c' ); import Uint16Array = require( './../../uint16' ); import Uint32Array = require( './../../uint32' ); -import azeroTo = require( './../../zero-to' ); -import azeroToLike = require( './../../zero-to-like' ); -import azeros = require( './../../zeros' ); -import azerosLike = require( './../../zeros-like' ); +import zeroTo = require( './../../zero-to' ); +import zeroToLike = require( './../../zero-to-like' ); +import zeros = require( './../../zeros' ); +import zerosLike = require( './../../zeros-like' ); import constants = require( '@stdlib/constants/array' ); /** @@ -133,10 +140,10 @@ interface Namespace { * @example * var x = [ 1, 2 ]; * - * var out = ns.acartesianPower( x, 2 ); + * var out = ns.cartesianPower( x, 2 ); * // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] */ - acartesianPower: typeof acartesianPower; + cartesianPower: typeof cartesianPower; /** * Returns the Cartesian product. @@ -153,10 +160,10 @@ interface Namespace { * var x1 = [ 1, 2, 3 ]; * var x2 = [ 4, 5 ]; * - * var out = ns.acartesianProduct( x1, x2 ); + * var out = ns.cartesianProduct( x1, x2 ); * // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ] */ - acartesianProduct: typeof acartesianProduct; + cartesianProduct: typeof cartesianProduct; /** * Returns the Cartesian square. @@ -171,10 +178,10 @@ interface Namespace { * @example * var x = [ 1, 2 ]; * - * var out = ns.acartesianSquare( x ); + * var out = ns.cartesianSquare( x ); * // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ] */ - acartesianSquare: typeof acartesianSquare; + cartesianSquare: typeof cartesianSquare; /** * 64-bit complex number array constructor. @@ -323,10 +330,10 @@ interface Namespace { * * @example * var arr = [ 1.0, 2.0, 3.0, 4.0 ]; - * var out = ns.convertArray( arr, 'float64' ); + * var out = ns.convert( arr, 'float64' ); * // returns [ 1.0, 2.0, 3.0, 4.0 ] */ - convertArray: typeof convertArray; + convert: typeof convert; /** * Converts an array to the same data type as a second input array. @@ -341,10 +348,10 @@ interface Namespace { * var x = [ 1.0, 2.0, 3.0, 4.0 ]; * var y = new Float64Array( 0 ); * - * var out = ns.convertArraySame( x, y ); + * var out = ns.convertSame( x, y ); * // returns [ 1.0, 2.0, 3.0, 4.0 ] */ - convertArraySame: typeof convertArraySame; + convertSame: typeof convertSame; /** * Returns an array constructor. @@ -353,14 +360,14 @@ interface Namespace { * @returns constructor or null * * @example - * var ctor = ns.arrayCtors( 'float64' ); + * var ctor = ns.ctors( 'float64' ); * // returns * * @example - * var ctor = ns.arrayCtors( 'float' ); + * var ctor = ns.ctors( 'float' ); * // returns null */ - arrayCtors: typeof arrayCtors; + ctors: typeof ctors; /** * Constructor which returns a data view representing a provided array buffer. @@ -403,10 +410,10 @@ interface Namespace { * @returns default settings * * @example - * var o = ns.arrayDefaults(); + * var o = ns.defaults(); * // returns {...} */ - arrayDefaults: typeof arrayDefaults; + defaults: typeof defaults; /** * Returns the data type of an array. @@ -419,13 +426,13 @@ interface Namespace { * @returns data type * * @example - * var dt = ns.arrayDataType( [ 1, 2, 3 ] ); + * var dt = ns.dtype( [ 1, 2, 3 ] ); * // returns 'generic' * - * var dt = ns.arrayDataType( 'beep' ); + * var dt = ns.dtype( 'beep' ); * // returns null */ - arrayDataType: typeof arrayDataType; + dtype: typeof dtype; /** * Returns a list of array data types. @@ -434,14 +441,14 @@ interface Namespace { * @returns list of array data types * * @example - * var list = ns.arrayDataTypes(); + * var list = ns.dtypes(); * // e.g., returns [ 'float32', 'float64', ... ] * * @example - * var list = ns.arrayDataTypes( 'floating_point' ); + * var list = ns.dtypes( 'floating_point' ); * // returns [...] */ - arrayDataTypes: typeof arrayDataTypes; + dtypes: typeof dtypes; /** * Creates an uninitialized array having a specified length. @@ -472,14 +479,14 @@ interface Namespace { * @returns empty array * * @example - * var arr = ns.aempty( 2 ); + * var arr = ns.empty( 2 ); * // returns * * @example - * var arr = ns.aempty( 2, 'float32' ); + * var arr = ns.empty( 2, 'float32' ); * // returns */ - aempty: typeof aempty; + empty: typeof empty; /** * Creates an uninitialized array having the same length and data type as a provided input array. @@ -515,7 +522,7 @@ interface Namespace { * var x = zeros( 2, 'float32' ); * // returns [ 0.0, 0.0 ] * - * var arr = ns.aemptyLike( x ); + * var arr = ns.emptyLike( x ); * // returns * * @example @@ -524,10 +531,10 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var arr = ns.aemptyLike( x ); + * var arr = ns.emptyLike( x ); * // returns */ - aemptyLike: typeof aemptyLike; + emptyLike: typeof emptyLike; /** * Returns a filled typed array view of an `ArrayBuffer`. @@ -545,17 +552,17 @@ interface Namespace { * var ArrayBuffer = require( './../../buffer' ); * * var buf = new ArrayBuffer( 32 ); - * var arr = ns.filledarray( 1.0, buf ); + * var arr = ns.filled( 1.0, buf ); * // returns [ 1.0, 1.0, 1.0, 1.0 ] * * @example * var ArrayBuffer = require( './../../buffer' ); * * var buf = new ArrayBuffer( 32 ); - * var arr = ns.filledarray( 1.0, buf, 'float32' ); + * var arr = ns.filled( 1.0, buf, 'float32' ); * // returns [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] */ - filledarray: typeof filledarray; + filled: typeof filled; /** * Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function. @@ -590,10 +597,10 @@ interface Namespace { * var ArrayBuffer = require( './../../buffer' ); * * var buf = new ArrayBuffer( 32 ); - * var arr = ns.filledarrayBy( buf, 'float64', constantFunction( 1.0 ) ); + * var arr = ns.filledBy( buf, 'float64', constantFunction( 1.0 ) ); * // returns [ 1.0, 1.0, 1.0, 1.0 ] */ - filledarrayBy: typeof filledarrayBy; + filledBy: typeof filledBy; /** * Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order. @@ -632,6 +639,28 @@ interface Namespace { */ iterator2array: typeof iterator2array; + /** + * Returns a single-element array containing a provided scalar value. + * + * ## Notes + * + * - If a `dtype` argument is not provided and `value` + * + * - is a `number`, the default data type is the default real-valued floating-point data type. + * - is a complex number object of a known complex data type, the data type is the same as the provided value. + * - is a complex number object of an unknown complex data type, the default data type is the default complex-valued floating-point data type. + * - is any other value type, the default data type is `'generic'`. + * + * @param value - scalar value + * @param dtype - output array data type + * @returns output array + * + * @example + * var x = ns.scalar2array( 1.0, generic' ); + * // returns [ 1.0 ] + */ + scalar2array: typeof scalar2array; + /** * Creates a filled array having a specified length. * @@ -656,14 +685,14 @@ interface Namespace { * @returns filled array * * @example - * var arr = ns.afull( 2, 1.0 ); + * var arr = ns.full( 2, 1.0 ); * // returns [ 1.0, 1.0 ] * * @example - * var arr = ns.afull( 2, 1.0, 'float32' ); + * var arr = ns.full( 2, 1.0, 'float32' ); * // returns [ 1.0, 1.0 ] */ - afull: typeof afull; + full: typeof full; /** * Creates a filled array having the same length and data type as a provided input array. @@ -694,7 +723,7 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.afullLike( x, 1.0 ); + * var y = ns.fullLike( x, 1.0 ); * // returns [ 1.0, 1.0 ] * * @example @@ -703,10 +732,10 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.afullLike( x, 1.0, 'float32' ); + * var y = ns.fullLike( x, 1.0, 'float32' ); * // returns [ 1.0, 1.0 ] */ - afullLike: typeof afullLike; + fullLike: typeof fullLike; /** * Generates a linearly spaced numeric array using a provided increment. @@ -723,6 +752,24 @@ interface Namespace { */ incrspace: typeof incrspace; + /** + * Array index constructor. + * + * @param x - input array + * @param options - function options + * @param options.persist - boolean indicating whether to continue persisting an index object after first usage + * @returns ArrayIndex instance + * + * @example + * var Uint8Array = require( './../../uint8' ); + * + * var x = new Uint8Array( [ 1, 0, 1, 0 ] ); + * + * var idx = new ns.ArrayIndex( x ); + * // returns + */ + ArrayIndex: typeof ArrayIndex; + /** * Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order. */ @@ -791,10 +838,57 @@ interface Namespace { * @returns array data type * * @example - * var dt = ns.arrayMinDataType( 'beep' ); + * var dt = ns.minDataType( 'beep' ); * // returns 'generic' */ - arrayMinDataType: typeof arrayMinDataType; + minDataType: typeof minDataType; + + /** + * Returns a list of array data types to which a provided array data type can be safely cast and, for floating-point data types, can be downcast. + * + * ## Notes + * + * - If not provided an array data type, the function returns a casting table. + * - If provided an unrecognized array data type, the function returns `null`. + * + * @param dtype - array data type value + * @returns list of array data types or null + * + * @example + * var list = ns.mostlySafeCasts( 'float32' ); + * // returns [...] + */ + mostlySafeCasts: typeof mostlySafeCasts; + + /** + * Returns a new array by applying a mask to a provided input array. + * + * @param x - input array + * @param mask - mask array + * @returns output array + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var y = ns.mskfilter( x, [ 0, 1, 0, 1 ] ); + * // returns [ 2, 4 ] + */ + mskfilter: typeof mskfilter; + + /** + * Returns a new array by applying a mask to a provided input array. + * + * @param x - input array + * @param mask - mask array + * @returns output array + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var y = ns.mskreject( x, [ 0, 1, 0, 1 ] ); + * // returns [ 1, 3 ] + */ + mskreject: typeof mskreject; /** * Creates an array filled with NaNs and having a specified length. @@ -812,14 +906,14 @@ interface Namespace { * @returns filled array * * @example - * var arr = ns.anans( 2 ); + * var arr = ns.nans( 2 ); * // returns [ NaN, NaN ] * * @example - * var arr = ns.anans( 2, 'float32' ); + * var arr = ns.nans( 2, 'float32' ); * // returns [ NaN, NaN ] */ - anans: typeof anans; + nans: typeof nans; /** * Creates an array filled with NaNs and having the same length and data type as a provided input array. @@ -842,7 +936,7 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.anansLike( x ); + * var y = ns.nansLike( x ); * // returns [ NaN, NaN ] * * @example @@ -851,10 +945,10 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.anansLike( x, 'float32' ); + * var y = ns.nansLike( x, 'float32' ); * // returns [ NaN, NaN ] */ - anansLike: typeof anansLike; + nansLike: typeof nansLike; /** * Returns the next larger array data type of the same kind. @@ -869,14 +963,14 @@ interface Namespace { * @returns next larger data type(s) or null * * @example - * var table = ns.arrayNextDataType(); + * var table = ns.nextDataType(); * // returns {...} * * @example - * var dt = ns.arrayNextDataType( 'float32' ); + * var dt = ns.nextDataType( 'float32' ); * // returns 'float64' */ - arrayNextDataType: typeof arrayNextDataType; + nextDataType: typeof nextDataType; /** * Generates a linearly spaced numeric array whose elements increment by 1 starting from one. @@ -886,14 +980,14 @@ interface Namespace { * @returns linearly spaced numeric array * * @example - * var arr = ns.aoneTo( 2 ); + * var arr = ns.oneTo( 2 ); * // returns [ 1.0, 2.0 ] * * @example - * var arr = ns.aoneTo( 2, 'float32' ); + * var arr = ns.oneTo( 2, 'float32' ); * // returns [ 1.0, 2.0 ] */ - aoneTo: typeof aoneTo; + oneTo: typeof oneTo; /** * Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length and data type as a provided input array. @@ -908,10 +1002,10 @@ interface Namespace { * var x = zeros( 2, 'float32' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.aoneToLike( x ); + * var y = ns.oneToLike( x ); * // returns [ 1.0, 2.0 ] */ - aoneToLike: typeof aoneToLike; + oneToLike: typeof oneToLike; /** * Creates an array filled with ones and having a specified length. @@ -936,14 +1030,14 @@ interface Namespace { * @returns filled array * * @example - * var arr = ns.aones( 2 ); + * var arr = ns.ones( 2 ); * // returns [ 1.0, 1.0 ] * * @example - * var arr = ns.aones( 2, 'float32' ); + * var arr = ns.ones( 2, 'float32' ); * // returns [ 1.0, 1.0 ] */ - aones: typeof aones; + ones: typeof ones; /** * Creates an array filled with ones and having the same length and data type as a provided input array. @@ -973,7 +1067,7 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.aonesLike( x ); + * var y = ns.onesLike( x ); * // returns [ 1.0, 1.0 ] * * @example @@ -982,10 +1076,10 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.aonesLike( x, 'float32' ); + * var y = ns.onesLike( x, 'float32' ); * // returns [ 1.0, 1.0 ] */ - aonesLike: typeof aonesLike; + onesLike: typeof onesLike; /** * Returns an uninitialized typed array. @@ -1023,10 +1117,10 @@ interface Namespace { * @returns promotion rule table * * @example - * var table = ns.arrayPromotionRules(); + * var table = ns.promotionRules(); * // returns {...} */ - arrayPromotionRules: typeof arrayPromotionRules; + promotionRules: typeof promotionRules; /** * Revives a JSON-serialized typed array. @@ -1040,10 +1134,10 @@ interface Namespace { * * var str = '{"type":"Float64Array","data":[5,3]}'; * - * var arr = parseJSON( str, ns.reviveTypedArray ); + * var arr = parseJSON( str, ns.typedarrayReviver ); * // returns [ 5.0, 3.0 ] */ - reviveTypedArray: typeof reviveTypedArray; + typedarrayReviver: typeof typedarrayReviver; /** * Returns a list of array data types to which a provided array data type can be safely cast. @@ -1057,18 +1151,18 @@ interface Namespace { * @returns a casting table, a list of array data types, or null * * @example - * var table = ns.arraySafeCasts(); + * var table = ns.safeCasts(); * // returns {...} * * @example - * var list = ns.arraySafeCasts( 'float32' ); + * var list = ns.safeCasts( 'float32' ); * // returns [...] * * @example - * var list = ns.arraySafeCasts( 'float' ); + * var list = ns.safeCasts( 'float' ); * // returns null */ - arraySafeCasts: typeof arraySafeCasts; + safeCasts: typeof safeCasts; /** * Returns a list of array data types to which a provided array data type can be safely cast or cast within the same "kind". @@ -1082,18 +1176,18 @@ interface Namespace { * @returns a table, a list of array data types, or null * * @example - * var table = ns.arraySameKindCasts(); + * var table = ns.sameKindCasts(); * // returns {...} * * @example - * var list = ns.arraySameKindCasts( 'float32' ); + * var list = ns.sameKindCasts( 'float32' ); * // returns [...] * * @example - * var list = ns.arraySameKindCasts( 'float' ); + * var list = ns.sameKindCasts( 'float' ); * // returns null */ - arraySameKindCasts: typeof arraySameKindCasts; + sameKindCasts: typeof sameKindCasts; /** * Determines (nested) array dimensions. @@ -1104,22 +1198,22 @@ interface Namespace { * @example * var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]; * - * var shape = ns.arrayShape( arr ); + * var ns.shape = ns.shape( arr ); * // returns [ 3, 3 ] * * @example * var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ] ]; * - * var shape = ns.arrayShape( arr ); + * var ns.shape = ns.shape( arr ); * // returns [ 3 ] * * @example * var arr = [ [ 1, 2, 3 ], [ 4, 5, 6 ], null ]; * - * var shape = ns.arrayShape( arr ); + * var ns.shape = ns.shape( arr ); * // returns [ 3 ] */ - arrayShape: typeof arrayShape; + shape: typeof shape; /** * Constructor returning an object used to represent a generic, fixed-length raw binary data buffer which can be used to create views of shared memory. @@ -1135,18 +1229,34 @@ interface Namespace { * @returns output array * * @example - * var x = [ 1, 2, 3, 4, 5, 6 ]; + * var x = [ 1, 2, 3 ]; * - * var out = ns.aslice( x ); + * var out = ns.slice( x ); * // returns [ 1, 2, 3 ] * * @example * var x = [ 1, 2, 3, 4, 5, 6 ]; * - * var out = ns.aslice( x, 0, 2 ); + * var out = ns.slice( x, 0, 2 ); * // returns [ 1, 2 ] */ - aslice: typeof aslice; + slice: typeof slice; + + /** + * Takes elements from an array. + * + * @param x - input array + * @param indices - list of element indices + * @param options - function options + * @returns output array + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var y = ns.take( x, [ 1, 3 ] ); + * // returns [ 2, 4 ] + */ + take: typeof take; /** * Returns an iterator which repeatedly iterates over each element in an array-like object. @@ -1178,6 +1288,26 @@ interface Namespace { */ circarray2iterator: typeof circarray2iterator; + /** + * Converts an array to an object supporting fancy indexing. + * + * @param x - input array + * @param options - function options + * @param options.strict - boolean indicating whether to enforce strict bounds checking + * @param options.cache - cache for resolving array index objects + * @returns fancy array + * + * @example + * var x = [ 1, 2, 3, 4 ]; + * + * var y = ns.array2fancy( x ); + * // returns + * + * var v = y[ ':' ]; + * // returns [ 1, 2, 3, 4 ] + */ + array2fancy: typeof array2fancy; + /** * Returns an iterator which iterates over each element in an array-like object. * @@ -1456,7 +1586,7 @@ interface Namespace { * * @example * var list = ns.complexarrayDataTypes(); - * // returns [ 'complex64', 'complex128' ] + * // e.g., returns [ 'complex64', ... ] */ complexarrayDataTypes: typeof complexarrayDataTypes; @@ -1483,7 +1613,7 @@ interface Namespace { * * @example * var list = ns.typedarrayDataTypes(); - * // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ] + * // e.g., returns [ 'float32', ... ] */ typedarrayDataTypes: typeof typedarrayDataTypes; @@ -1510,7 +1640,7 @@ interface Namespace { * * @example * var list = ns.floatarrayDataTypes(); - * // e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ] + * // e.g., returns [ 'float32', ... ] */ floatarrayDataTypes: typeof floatarrayDataTypes; @@ -1537,7 +1667,7 @@ interface Namespace { * * @example * var list = ns.intarrayDataTypes(); - * // e.g., returns [ 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c' ] + * // e.g., returns [ 'int16', ... ] */ intarrayDataTypes: typeof intarrayDataTypes; @@ -1583,13 +1713,13 @@ interface Namespace { realarrayCtors: typeof realarrayCtors; /** - * Returns a list of typed array data types. + * Returns a list of typed array real-valued data types. * * @returns list of typed array data types * * @example * var list = ns.realarrayDataTypes(); - * // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c' ] + * // e.g., returns [ 'float32', ... ] */ realarrayDataTypes: typeof realarrayDataTypes; @@ -1616,7 +1746,7 @@ interface Namespace { * * @example * var list = ns.realarrayFloatDataTypes(); - * // e.g., returns [ 'float32', 'float64' ] + * // e.g., returns [ 'float32', ... ] */ realarrayFloatDataTypes: typeof realarrayFloatDataTypes; @@ -1643,7 +1773,7 @@ interface Namespace { * * @example * var list = ns.intarraySignedDataTypes(); - * // e.g., returns [ 'int16', 'int32', 'int8' ] + * // e.g., returns [ 'int16', ... ] */ intarraySignedDataTypes: typeof intarraySignedDataTypes; @@ -1670,7 +1800,7 @@ interface Namespace { * * @example * var list = ns.intarrayUnsignedDataTypes(); - * // e.g., returns [ 'uint16', 'uint32', 'uint8', 'uint8c' ] + * // e.g., returns [ 'uint16', ... ] */ intarrayUnsignedDataTypes: typeof intarrayUnsignedDataTypes; @@ -1702,14 +1832,14 @@ interface Namespace { * @returns linearly spaced numeric array * * @example - * var arr = ns.azeroTo( 2 ); + * var arr = ns.zeroTo( 2 ); * // returns [ 0.0, 1.0 ] * * @example - * var arr = ns.azeroTo( 2, 'float32' ); + * var arr = ns.zeroTo( 2, 'float32' ); * // returns [ 0.0, 1.0 ] */ - azeroTo: typeof azeroTo; + zeroTo: typeof zeroTo; /** * Generates a linearly spaced numeric array whose elements increment by 1 starting from zero and having the same length and data type as a provided input array. @@ -1724,10 +1854,10 @@ interface Namespace { * var x = zeros( 2, 'float32' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.azeroToLike( x ); + * var y = ns.zeroToLike( x ); * // returns [ 0.0, 1.0 ] */ - azeroToLike: typeof azeroToLike; + zeroToLike: typeof zeroToLike; /** * Creates a zero-filled array having a specified length. @@ -1752,14 +1882,14 @@ interface Namespace { * @returns zero-filled array * * @example - * var arr = ns.azeros( 2 ); + * var arr = ns.zeros( 2 ); * // returns [ 0.0, 0.0 ] * * @example - * var arr = ns.azeros( 2, 'float32' ); + * var arr = ns.zeros( 2, 'float32' ); * // returns [ 0.0, 0.0 ] */ - azeros: typeof azeros; + zeros: typeof zeros; /** * Creates a zero-filled array having the same length and data type as a provided input array. @@ -1789,7 +1919,7 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.azerosLike( x ); + * var y = ns.zerosLike( x ); * // returns [ 0.0, 0.0 ] * * @example @@ -1798,10 +1928,10 @@ interface Namespace { * var x = zeros( 2, 'float64' ); * // returns [ 0.0, 0.0 ] * - * var y = ns.azerosLike( x, 'float32' ); + * var y = ns.zerosLike( x, 'float32' ); * // returns [ 0.0, 0.0 ] */ - azerosLike: typeof azerosLike; + zerosLike: typeof zerosLike; /** * Array constants.