linalg::hessenberg
--
Hessenberg matrixlinalg::hessenberg
(A)
returns an (upper)
Hessenberg matrix H.
linalg::hessenberg(A <, All>)
A |
- | a square matrix of a domain of category Cat::Matrix |
All |
- | returns the list [H, P] with a Hessenberg
matrix H similar to A and the corresponding
nonsingular transformation matrix P such that H = P * A
* P^(-1). |
a matrix of the same domain type as A
, or the list
[H, P]
when the option All is
given.
linalg::hessenberg
uses Gaussian elimination without
pivoting. There is no special implementation for matrices with
floating-point components.A
must be a field, i.e., a
domain of category Cat::Field
.Consider the matrix:
>> A := Dom::Matrix(Dom::Rational)( [[0, 1, 0, -1], [-4/3, 2/3, 5/3, -1/3], [-1, 2, 0, 0], [-5/3, 4/3, 1/3, 1/3]] )
+- -+ | 0, 1, 0, -1 | | | | -4/3, 2/3, 5/3, -1/3 | | | | -1, 2, 0, 0 | | | | -5/3, 4/3, 1/3, 1/3 | +- -+
The following Hessenberg matrix is similar to A:
>> H := linalg::hessenberg(A)
+- -+ | 0, -1/4, -1/7, -1 | | | | -4/3, 3/2, 34/21, -1/3 | | | | 0, 7/8, -17/14, 1/4 | | | | 0, 0, -72/49, 5/7 | +- -+
If the corresponding transformation matrix is needed as
well, call linalg::hessenberg
with option All:
>> [H, P] := linalg::hessenberg(A, All)
-- +- -+ +- -+ -- | | 0, -1/4, -1/7, -1 | | 1, 0, 0, 0 | | | | | | | | | | -4/3, 3/2, 34/21, -1/3 | | 0, 1, 0, 0 | | | | |, | | | | | 0, 7/8, -17/14, 1/4 | | 0, -3/4, 1, 0 | | | | | | | | | | 0, 0, -72/49, 5/7 | | 0, -8/7, -1/7, 1 | | -- +- -+ +- -+ --
Then P is a nonsingular matrix such that the product P * A * P^(-1) is equal to H:
>> P * A * P^(-1)
+- -+ | 0, -1/4, -1/7, -1 | | | | -4/3, 3/2, 34/21, -1/3 | | | | 0, 7/8, -17/14, 1/4 | | | | 0, 0, -72/49, 5/7 | +- -+