This function computes the Hessenberg matrix of matrix A by repetitive application of Householder similarity transformation
Ai+1 = (I-2*u_i*u_i')*Ai*(I-2*u_i*u_i')
with Householder vector u_i.
The elementary transformations can be subsumed under
A -> Q*A*Q
and Q*A*Q is Hessenberg matrix.
In contrast to function Modelica_LinearSystems2.Math.Matrices.hess, function Modelica_LinearSystems2.Math.Matrices.hess3 does not use any LAPACK routine.
function hessenberg2 extends Modelica.Icons.Function; import Modelica_LinearSystems2.Math.Matrices; import Modelica_LinearSystems2.Math.Vectors; input Real H[:, :]; input String s = "u"; output Real Ht[size(H, 1), size(H, 2)]; end hessenberg2;