## `linalg::hessenberg` -- Hessenberg matrix

#### Introduction

`linalg::hessenberg``(A)` returns an (upper) Hessenberg matrix H.

#### Call(s)

`linalg::hessenberg(A <, All>)`

#### Parameters

`A` | - | a square matrix of a domain of category `Cat::Matrix`

#### Options

`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).

#### Returns

a matrix of the same domain type as `A`, or the list `[H, P]` when the option All is given.

#### Related Functions

`linalg::charpoly`

#### Details

- `linalg::hessenberg` uses Gaussian elimination without pivoting. There is no special implementation for matrices with floating-point components.
- The component ring of `A` must be a field, i.e., a domain of category `Cat::Field`.

#### Example 1

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  |
                          +-                          -+

#### Background

- An n x n matrix A is called an (upper) Hessenberg matrix, if the following holds: A[i,j] = 0 for all i,j in 1,...,n with i>j.
- For each square matrix A over a field there exists a Hessenberg matrix similar to A. In general, the upper Hessenberg matrix is not unique.
- Reference: K.-H. Kiyek, F. Schwarz: Lineare Algebra. Teubner Studienbücher Mathematik, B.G. Teubner Stuttgart, Leipzig, 1999.

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000