diff --git a/lib/node_modules/@stdlib/console/docs/types/index.d.ts b/lib/node_modules/@stdlib/console/docs/types/index.d.ts index da913252f872..be0c40e148be 100644 --- a/lib/node_modules/@stdlib/console/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/console/docs/types/index.d.ts @@ -59,6 +59,20 @@ interface Namespace { * * ns.logEach( '%d < %d ', x, y ); * // e.g., => '1 < 4\n2 < 5\n3 < 6\n' + * + * @example + * var x = [ 0.5, 1.0, 1.5 ]; + * var y = [ 0.25, 0.5, 0.75 ]; + * + * ns.logEach( '%0.2f > %0.2f', x, y ); + * // e.g., => '0.50 > 0.25\n1.00 > 0.50\n1.50 > 0.75\n' + * + * @example + * var x = [ 'foo', 'bar' ]; + * var y = [ 'beep', 'boop' ]; + * + * ns.logEach( 'x: %s, y: %s', x, y ); + * // e.g., => 'x: foo, y: beep\nx: bar, y: boop\n' */ logEach: typeof logEach; diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts index 85495feb8817..82fe3a3179b3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts @@ -47,6 +47,7 @@ import isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major import isRowMajorString = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); import isSafeDataTypeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' ); import isSameKindDataTypeCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' ); +import isScalarMostlySafeCompatible = require( '@stdlib/ndarray/base/assert/is-scalar-mostly-safe-compatible' ); import isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' ); import isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' ); import isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' ); @@ -839,6 +840,27 @@ interface Namespace { */ isSameKindDataTypeCast: typeof isSameKindDataTypeCast; + /** + * Returns a boolean indicating whether a scalar value can be safely cast or, for floating-point data types, downcast to specified ndarray data type. + * + * @param value - scalar value + * @param dtype - ndarray data type + * @returns boolean indicating whether a scalar value can be safely cast + * + * @example + * var bool = ns.isScalarMostlySafeCompatible( 3.0, 'float64' ); + * // returns true + * + * @example + * var bool = ns.isScalarMostlySafeCompatible( 3.14, 'int32' ); + * // returns false + * + * @example + * var bool = ns.isScalarMostlySafeCompatible( -1, 'uint32' ); + * // returns false + */ + isScalarMostlySafeCompatible: typeof isScalarMostlySafeCompatible; + /** * Tests whether an input value is a supported ndarray signed integer data type. * diff --git a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts index cc12ca3d4f9b..e5785cd80d46 100644 --- a/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts @@ -952,6 +952,10 @@ interface Namespace { /** * Fills an input ndarray with a specified value. * + * ## Notes + * + * - A `value` must be able to safely cast to the input ndarray data type. Scalar values having floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., a scalar double-precision floating-point number can be used to fill a 'float32' input ndarray). + * * @param x - input ndarray * @param value - scalar value * diff --git a/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts index 92c260889184..1f41bd2bd6e5 100644 --- a/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts @@ -36,6 +36,7 @@ import empty = require( '@stdlib/ndarray/empty' ); import emptyLike = require( '@stdlib/ndarray/empty-like' ); import FancyArray = require( '@stdlib/ndarray/fancy' ); import fill = require( '@stdlib/ndarray/fill' ); +import fillBy = require( '@stdlib/ndarray/fill-by' ); import filter = require( '@stdlib/ndarray/filter' ); import filterMap = require( '@stdlib/ndarray/filter-map' ); import flag = require( '@stdlib/ndarray/flag' ); @@ -574,6 +575,10 @@ interface Namespace { /** * Fills an input ndarray with a specified value. * + * ## Notes + * + * - A `value` must be able to safely cast to the input ndarray data type. Scalar values having floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., a scalar double-precision floating-point number can be used to fill a 'float32' input ndarray). + * * @param x - input ndarray * @param value - scalar value * @returns input ndarray @@ -593,6 +598,33 @@ interface Namespace { */ fill: typeof fill; + /** + * Fills an input ndarray according to a callback function. + * + * @param x - input ndarray + * @param fcn - callback function + * @param thisArg - callback function execution context + * @returns input ndarray + * + * @example + * var zeros = require( '@stdlib/ndarray/zeros' ); + * var getData = require( '@stdlib/ndarray/data-buffer' ); + * + * function fcn() { + * return 10.0; + * } + * + * var x = zeros( [ 3, 1, 2 ], { + * 'dtype': 'float64' + * }); + * + * ns.fillBy( x, fcn ); + * + * console.log( getData( x ) ); + * // => [ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ] + */ + fillBy: typeof fillBy; + /** * Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function. *