Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Buffer Constructors

ndarray data buffer constructors.

Usage

var ctors = require( '@stdlib/ndarray/base/buffer-ctors' );

ctors( dtype )

Returns an ndarray data buffer constructor for a specified data type.

var ctor = ctors( 'float64' );
// returns <Function>

If provided an unknown or unsupported data type, the function returns null.

var ctor = ctors( 'float' );
// returns null

Examples

var logEachMap = require( '@stdlib/console/log-each-map' );
var dtypes = require( '@stdlib/ndarray/dtypes' );
var ctors = require( '@stdlib/ndarray/base/buffer-ctors' );

var dts = dtypes( 'integer_and_generic' );
logEachMap( '%s => %s', dts, ctors );