Handbook
Glossary
<toeplitz-matrix> ( n -- matrix )
Extra matrix operations
Prev:
<hilbert-matrix> ( m n -- matrix )
Next:
<vandermonde-matrix> ( u n -- matrix )
Vocabulary
math
.
matrices
.
extras
Inputs
n
an
integer
Outputs
matrix
a
matrix
Word description
A Toeplitz matrix is an upside-down
<hankel-matrix>
. Unlike the Hankel matrix, a Toeplitz matrix can be non-square. See
hankel matrix
.
Examples
USING: math.matrices.extras prettyprint ; 4 <toeplitz-matrix> .
{ { 1 2 3 4 } { 2 1 2 3 } { 3 2 1 2 } { 4 3 2 1 } }
Definition
USING:
kernel
math
sequences
;
IN:
math.matrices.extras
:
<toeplitz-matrix>
( n -- matrix )
<iota>
dup
[
-
abs
1
+
]
cartesian-map
;