Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import ndarraylike2descriptor = require( '@stdlib/ndarray/base/ndarraylike2descr
import ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' );
import ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );
import ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' );
import ndarraylikes2objects = require( '@stdlib/ndarray/base/ndarraylikes2objects' );
import ndims = require( '@stdlib/ndarray/base/ndims' );
import nextCartesianIndex = require( '@stdlib/ndarray/base/next-cartesian-index' );
import nonsingletonDimensions = require( '@stdlib/ndarray/base/nonsingleton-dimensions' );
Expand Down Expand Up @@ -3228,6 +3229,26 @@ interface Namespace {
*/
ndarraylike2scalar: typeof ndarraylike2scalar;

/**
* Converts an array of ndarray-like objects to an array of objects likely to have the same "shape".
*
* ## Notes
*
* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different "hidden" classes. If a function is provided many objects having different "shapes", some JavaScript VMs (e.g., V8) will consider the function "megamorphic" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the "shape" of the object holding ndarray meta data to ensure that internal functions operating on ndarrays are provided consistent argument "shapes".
*
* @param arr - list of ndarrays
* @returns array containing ndarray data
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] );
*
* var out = ns.ndarraylikes2objects( [ x ] );
* // returns [ {...} ]
*/
ndarraylikes2objects: typeof ndarraylikes2objects;

/**
* Returns the number of ndarray dimensions.
*
Expand Down
Loading