matrix/shaping

matrix/shaping

Utilities for re-shaping matrices

Methods

(static) catH() → {matrix}

Source:

Append/concat a matrix horizontally

Example
var M = require('./src/matrix_lib');
var A = M.range(3);
console.log(A.catH(A).value) // Show value
console.log(A.catH(A).size()) // Show size
// Returns 
//[ [ 0, 0 ], [ 1, 1 ], [ 2, 2 ] ]
//[ 3, 2 ]
Returns:
Type
matrix

(static) catV() → {matrix}

Source:

Append/concat a matrix vertically

Example
var M = require('./src/matrix_lib');
var A = M.range(3);
console.log(A.catH(A).value) // Show value
console.log(A.catH(A).size()) // Show size
// Returns 
//[ [ 0 ], [ 1 ], [ 2 ], [ 0 ], [ 1 ], [ 2 ] ]
//[ 6, 1 ]
Returns:
Type
matrix

(static) size() → {matrix}

Source:

Returns the size of a matrix as an array [m,n]

Example
var M = require('./src/matrix_lib');
M.range(3).size()
// returns [ 3, 1 ]
Returns:
Type
matrix