Skip to content

Latest commit

 

History

History
90 lines (47 loc) · 1.53 KB

File metadata and controls

90 lines (47 loc) · 1.53 KB

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

MatrixBuilder.toeplitz() method

Constructs a Toeplitz matrix from the specified first column and first row. A Toeplitz matrix has constant diagonals. If firstRow is not given, then the complex conjugate of firstColumn is assumed. The first entry must be real because the first entry of the first column must equal the first entry of the first row.

Signature:

toeplitz(firstColumn: Vector<S>, firstRow?: Vector<S>): M;

Parameters

Parameter

Type

Description

firstColumn

Vector<S>

The first column of the Toeplitz matrix

firstRow

Vector<S>

(Optional) The first row of the Toeplitz matrix

Returns:

M

Example

const toeplitz = matrixBuilder.toeplitz(vectorBuilder.fromArray([1, 2, 3]));

// [ 1 2 3 ]
// [ 2 1 2 ]
// [ 3 2 1 ]

const toeplitzWithSpecifiedRow = matrixBuilder.toeplitz(
  vectorBuilder.fromArray([1, 2, 3]),
  vectorBuilder.fromArray([1, 3, 5, 7])
);

// [ 1 3 5 7 ]
// [ 2 1 3 5 ]
// [ 3 2 1 3 ]