Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

outputOrder

Resolves the order (i.e. memory layout) of an output ndarray according to a list of input ndarrays.

Usage

var outputOrder = require( '@stdlib/ndarray/base/output-order' );

outputOrder( arrays )

Resolves the order (i.e. memory layout) of an output ndarray according to a list of input ndarrays.

var zeros = require( '@stdlib/ndarray/zeros' );

var x = zeros( [ 2, 2 ] );
var y = zeros( [ 2, 2 ] );

var o = outputOrder( [ x, y ] );
// returns <string>

The function accepts the following arguments:

  • arrays: list of input ndarrays.

Notes

  • When the layout differs among input ndarrays, the function returns the default layout.

Examples

var array = require( '@stdlib/ndarray/array' );
var outputOrder = require( '@stdlib/ndarray/base/output-order' );

// Create ndarrays:
var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
var y = array( [ [ 5, 6 ], [ 7, 8 ] ] );
var z = array( [ [ 0, 0 ], [ 0, 0 ] ] );

// Resolve a storage layout:
var o = outputOrder( [ x, y, z ] );
// returns <string>

console.log( o );