time-to-botec/squiggle/node_modules/@stdlib/ndarray/base/assert/is-column-major
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
include/stdlib/ndarray/base/assert feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
src feat: add the node modules 2022-12-03 12:44:49 +00:00
manifest.json feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isColumnMajor

Given a stride array, determine whether an array is column-major.

Usage

var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' );

isColumnMajor( strides )

Returns a boolean indicating if an array is column-major based on a provided stride array.

var bool = isColumnMajor( [ 1, 2 ] );
// returns true

bool = isColumnMajor( [ 2, 1 ] );
// returns false

Examples

var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major' );

var shape = [ 10, 10, 10 ];

var strides = shape2strides( shape, 'column-major' );
// returns [ 1, 10, 100 ]

var bool = isColumnMajor( strides );
// returns true

strides = shape2strides( shape, 'row-major' );
// returns [ 100, 10, 1 ]

bool = isColumnMajor( strides );
// returns false