Algosim documentation: IsUpperHessenberg

IsUpperHessenberg

Tests if a matrix is upper Hessenberg.

Syntax

Description

If A is a matrix, not necessarily square, then IsUpperHessenberg(A, ε) is true iff i > j + 1 implies A[i, j] = 0 (with epsilon ε).

Examples

A ≔ ❨❨5, 6, 3, 1, 2❩, ❨4, 5, 6, 0, 1❩, ❨0, 2, 3, 5, 1❩, ❨0, 0, 4, 5, 0❩, ❨0, 0, 0, 4, 5❩❩
⎛5  6  3  1  2⎞
⎜4  5  6  0  1⎟
⎜0  2  3  5  1⎟
⎜0  0  4  5  0⎟
⎝0  0  0  4  5⎠
IsUpperHessenberg(A)
true

See also