functiontoUpperHessenberg

Transform a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H

Information

Syntax

                H = Matrices.toUpperHessenberg(A);
(H, V, tau, info) = Matrices.toUpperHessenberg(A,ilo, ihi);

Description

Function toUpperHessenberg computes a upper Hessenberg form H of a matrix A by orthogonal similarity transformation: Q' * A * Q = H. It calls LAPACK function DGEHRD. See Matrices.LAPACK.dgehrd for more information about the additional outputs V, tau, info and inputs ilo, ihi for more information.

Example

  A  = [1, 2,  3;
        6, 5,  4;
        1, 0,  0];

  H = toUpperHessenberg(A);

  results in:

  H = [1.0,  -2.466,  2.630;
      -6.083, 5.514, -3.081;
       0.0,   0.919, -0.514]

Inputs

TypeNameDefaultDescription
Real[:,size(A, 1)]ASquare matrix A
Integerilo1Lowest index where the original matrix had been Hessenbergform
Integerihisize(A, 1)Highest index where the original matrix had been Hessenbergform

Outputs

TypeNameDefaultDescription
Real[size(A, 1),size(A, 2)]HUpper Hessenberg form
Real[size(A, 1),size(A, 2)]VV=[v1,v2,..vn-1,0] with vi are vectors which define the elementary reflectors
Real[max(0, size(A, 1) - 1)]tauScalar factors of the elementary reflectors
Integerinfo