# ndarray [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] > Multidimensional arrays.
## Installation ```bash npm install @stdlib/ndarray ```
## Usage ```javascript var ns = require( '@stdlib/ndarray' ); ``` #### ns ndarray namespace. ```javascript var o = ns; // returns {...} ``` The namespace exports the following functions to create multidimensional arrays:
- [`array( [buffer,] [options] )`][@stdlib/ndarray/array]: create a multidimensional array. - [`ndarray( dtype, buffer, shape, strides, offset, order[, options] )`][@stdlib/ndarray/ctor]: multidimensional array constructor.
The namespace contains the following sub-namespaces:
- [`base`][@stdlib/ndarray/base]: base ndarray.
In addition, the namespace contaians the following multidimensional array utility functions:
- [`ndarrayCastingModes()`][@stdlib/ndarray/casting-modes]: list of ndarray casting modes. - [`ndarrayDataTypes()`][@stdlib/ndarray/dtypes]: list of ndarray data types. - [`ind2sub( shape, idx[, options] )`][@stdlib/ndarray/ind2sub]: convert a linear index to an array of subscripts. - [`ndarrayIndexModes()`][@stdlib/ndarray/index-modes]: list of ndarray index modes. - [`ndarrayMinDataType( value )`][@stdlib/ndarray/min-dtype]: determine the minimum ndarray data type of the closest "kind" necessary for storing a provided scalar value. - [`ndarrayNextDataType( [dtype] )`][@stdlib/ndarray/next-dtype]: return the next larger ndarray data type of the same kind. - [`ndarrayOrders()`][@stdlib/ndarray/orders]: list of ndarray orders. - [`ndarrayPromotionRules( [dtype1, dtype2] )`][@stdlib/ndarray/promotion-rules]: return the ndarray data type with the smallest size and closest "kind" to which ndarray data types can be **safely** cast. - [`ndarraySafeCasts( [dtype] )`][@stdlib/ndarray/safe-casts]: return a list of ndarray data types to which a provided ndarray data type can be safely cast. - [`ndarraySameKindCasts( [dtype] )`][@stdlib/ndarray/same-kind-casts]: return a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same "kind". - [`sub2ind( shape, ...subscripts[, options] )`][@stdlib/ndarray/sub2ind]: convert subscripts to a linear index.
## Examples ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var ns = require( '@stdlib/ndarray' ); console.log( objectKeys( ns ) ); ```
* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].