Skip to content

Latest commit

 

History

History
99 lines (48 loc) · 1.18 KB

File metadata and controls

99 lines (48 loc) · 1.18 KB

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

MatrixBuilder.repeat() method

Constructs a new matrix consisted of repetitions of a smaller matrix.

Signature:

repeat(matrix: Matrix<S>, rows: number, columns: number): M;

Parameters

Parameter

Type

Description

matrix

Matrix<S>

The matrix to be repeated

rows

number

The number of times to repeat the matrix vertically

columns

number

The number of times to repeat the matrix horizontally

Returns:

M

The new matrix

Example

const I = matrixBuilder.identity(2);
const repeated = matrixBuilder.repeat(I, 1, 2);

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