ndarray
Multidimensional arrays.
Usage
var ns = require( '@stdlib/ndarray' );
ns
ndarray namespace.
var o = ns;
// returns {...}
The namespace exports the following functions to create multidimensional arrays:
array( [buffer,] [options] ): create a multidimensional array.ndarray( dtype, buffer, shape, strides, offset, order[, options] ): multidimensional array constructor.
The namespace contains the following sub-namespaces:
In addition, the namespace contains the following multidimensional array utility functions:
at( x[, ...indices] ): return anndarrayelement.broadcastArray( x, shape ): broadcast an ndarray to a specified shape.broadcastArrays( ...arrays ): broadcast ndarrays to a common shape.castingModes(): list of ndarray casting modes.dataBuffer( x ): return the underlying data buffer of a provided ndarray.defaults(): default ndarray settings.dispatch( fcns, types, data, nargs, nin, nout ): create an ndarray function interface which performs multiple dispatch.dtype( x ): return the data type of a provided ndarray.dtypes( [kind] ): list of ndarray data types.emptyLike( x[, options] ): create an uninitialized ndarray having the same shape and data type as a provided ndarray.empty( shape[, options] ): create an uninitialized ndarray having a specified shape and data type.FancyArray( dtype, buffer, shape, strides, offset, order[, options] ): fancy multidimensional array constructor.filterMap( x[, options], fcn[, thisArg] ): filter and map elements in an input ndarray to elements in a new output ndarray according to a callback function.filter( x[, options], predicate[, thisArg] ): return a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.flag( x, name ): return a specified flag for a provided ndarray.flags( x ): return the flags of a provided ndarray.forEach( x, fcn[, thisArg] ): invoke a callback function once for each ndarray element.scalar2ndarray( value[, options] ): convert a scalar value to a zero-dimensional ndarray.ind2sub( shape, idx[, options] ): convert a linear index to an array of subscripts.indexModes(): list of ndarray index modes.ndindex( x[, options] ): ndarray index constructor.map( x[, options], fcn[, thisArg] ): apply a callback function to elements in an input ndarray and assign results to elements in a new output ndarray.maybeBroadcastArray( x, shape ): broadcast an ndarray to a specified shape if and only if the specified shape differs from the provided ndarray's shape.maybeBroadcastArrays( arrays ): broadcast ndarrays to a common shape.minDataType( value ): determine the minimum ndarray data type of the closest "kind" necessary for storing a provided scalar value.mostlySafeCasts( [dtype] ): return a list of ndarray data types to which a provided ndarray data type can be safely cast and, for floating-point data types, can be downcast.ndarraylike2ndarray( x[, options] ): convert an ndarray-like object to anndarray.ndims( x ): return the number of ndarray dimensions.nextDataType( [dtype] ): return the next larger ndarray data type of the same kind.numelDimension( x, dim ): return the size (i.e., number of elements) of a specified dimension for a provided ndarray.numel( x ): return the number of elements in an ndarray.offset( x ): return the index offset specifying the underlying buffer index of the first iterated ndarray element.order( x ): return the layout order of a provided ndarray.orders(): list of ndarray orders.outputDataTypePolicies(): list of output ndarray data type policies.promotionRules( [dtype1, dtype2] ): return the ndarray data type with the smallest size and closest "kind" to which ndarray data types can be safely cast.reject( x[, options], predicate[, thisArg] ): return a shallow copy of an ndarray containing only those elements which fail a test implemented by a predicate function.safeCasts( [dtype] ): return a list of ndarray data types to which a provided ndarray data type can be safely cast.sameKindCasts( [dtype] ): return a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same "kind".shape( x ): return the shape of a provided ndarray.sliceAssign( x, y, ...s[, options] ): assign element values from a broadcasted inputndarrayto corresponding elements in an outputndarrayview.sliceDimensionFrom( x, dim, start[, options] ): return a read-only shifted view of an inputndarrayalong a specified dimension.sliceDimensionTo( x, dim, stop[, options] ): return a read-only truncated view of an inputndarrayalong a specified dimension.sliceDimension( x, dim, slice[, options] ): return a read-only view of an inputndarraywhen sliced along a specified dimension.sliceFrom( x, ...start[, options] ): return a read-only shifted view of an input ndarray.sliceTo( x, ...stop[, options] ): return a read-only truncated view of an input ndarray.slice( x, ...s[, options] ): return a read-only view of an inputndarray.stride( x, dim ): return the stride along a specified dimension for a provided ndarray.strides( x ): return the strides of a provided ndarray.sub2ind( shape, ...subscripts[, options] ): convert subscripts to a linear index.ndarray2array( x ): convert an ndarray to a generic array.ndarray2fancy( x[, options] ): convert an ndarray to an object supporting fancy indexing.ndarray2json( x ): serialize an ndarray as a JSON object.zerosLike( x[, options] ): create a zero-filled ndarray having the same shape and data type as a provided ndarray.zeros( shape[, options] ): create a zero-filled ndarray having a specified shape and data type.
Examples
var objectKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/ndarray' );
console.log( objectKeys( ns ) );