Multidimensional arrays.
var ns = require( '@stdlib/ndarray' );
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:
broadcastArray( x, shape )
: broadcast an ndarray to a specified shape.ndarrayCastingModes()
: list of ndarray casting modes.ndarrayDataBuffer( 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.ndarrayDataType( x )
: return the data type of a provided ndarray.ndarrayDataTypes( [kind] )
: list of ndarray data types.ndemptyLike( x[, options] )
: create an uninitialized ndarray having the same shape and data type as a provided ndarray.ndempty( 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.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.ndarrayIndexModes()
: list of ndarray index modes.maybeBroadcastArray( x, shape )
: broadcast an ndarray to a specified shape if and only if the specified shape differs from the provided ndarray's shape.ndarrayMinDataType( value )
: determine the minimum ndarray data type of the closest "kind" necessary for storing a provided scalar value.ndarrayMostlySafeCasts( [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.ndims( x )
: return the number of ndarray dimensions.ndarrayNextDataType( [dtype] )
: return the next larger ndarray data type of the same kind.numel( x )
: return the number of elements in an ndarray.ndarrayOffset( x )
: return the index offset specifying the underlying buffer index of the first iterated ndarray element.ndarrayOrder( x )
: return the layout order of a provided ndarray.ndarrayOrders()
: list of ndarray orders.ndarrayOutputDataTypePolicies()
: list of output ndarray data type policies.ndarrayPromotionRules( [dtype1, dtype2] )
: return the ndarray data type with the smallest size and closest "kind" to which ndarray data types can be safely cast.ndarraySafeCasts( [dtype] )
: return a list of ndarray data types to which a provided ndarray data type can be safely cast.ndarraySameKindCasts( [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".ndarrayShape( x )
: return the shape of a provided ndarray.ndsliceAssign( x, y, ...s[, options] )
: assign element values from a broadcasted inputndarray
to corresponding elements in an outputndarray
view.ndsliceDimensionFrom( x, dim, start[, options] )
: return a read-only shifted view of an inputndarray
along a specified dimension.ndsliceDimensionTo( x, dim, stop[, options] )
: return a read-only truncated view of an inputndarray
along a specified dimension.ndsliceDimension( x, dim, slice[, options] )
: return a read-only view of an inputndarray
when sliced along a specified dimension.ndslice( x, ...s[, options] )
: return a read-only view of an inputndarray
.ndarrayStrides( 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.ndzerosLike( x[, options] )
: create a zero-filled ndarray having the same shape and data type as a provided ndarray.ndzeros( shape[, options] )
: create a zero-filled ndarray having a specified shape and data type.
var objectKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/ndarray' );
console.log( objectKeys( ns ) );