Home > @josh-brown/vector > MatrixBuilder > toeplitz
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;|
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
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 ]