Skip to content

Latest commit

 

History

History
85 lines (42 loc) · 1.25 KB

File metadata and controls

85 lines (42 loc) · 1.25 KB

Home > @josh-brown/vector > MatrixBuilder > augment

MatrixBuilder.augment() method

Constructs a new matrix consisting of left and right next to one another. Throws an error of left and right do not have the same number of rows.

Signature:

augment(left: Matrix<S>, right: Matrix<S>): M;

Parameters

Parameter

Type

Description

left

Matrix<S>

The matrix that will form the left-side of the augmented matrix

right

Matrix<S>

The matrix that will form the right-side of the augmented matrix

Returns:

M

The new augmented matrix

Example

const left = matrixBuilder.ones(2);
const right = matrixBuilder.zeros(2, 3);

matrixBuilder.augment(left, right);

// [ 1 1 0 0 0 ]
// [ 1 1 0 0 0 ]