IsTridiagonal
Tests if a matrix is tridiagonal.
Syntax
-
IsTridiagonal(A[, ε])
-
A
is a matrix -
ε
is a positive number
-
Description
If A
is a matrix then IsTridiagonal(A, ε)
is true
iff A
is square and abs(i, j) > 1
implies A[i, j] = 0
(with epsilon ε
).
Examples
❨❨3, 0, 0, 0❩, ❨1, 2, 1, 0❩, ❨0, 4, 1, 3❩, ❨0, 0, 0, 1❩❩
⎛3 0 0 0⎞ ⎜1 2 1 0⎟ ⎜0 4 1 3⎟ ⎝0 0 0 1⎠
IsTridiagonal(ans)
true