Skip to content

Latest commit

 

History

History
83 lines (41 loc) · 1.03 KB

File metadata and controls

83 lines (41 loc) · 1.03 KB

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

MatrixBuilder.fill() method

Constructs a matrix of the specified dimension, whose entries are all the specified value

Signature:

fill(value: S, shape: MatrixShape): M;

Parameters

Parameter

Type

Description

value

S

The value that should be used for every entry in the new matrix

shape

MatrixShape

The shape of the matrix as a tuple [m, n]

Returns:

M

The new matrix

Example

const allTwos = matrixBuilder.fill(2, 3, 4)

// [ 2 2 2 2 ]
// [ 2 2 2 2 ]
// [ 2 2 2 2 ]