Does octave represent/mark symmetric matrices? Observe the result of:
octave:1> hess(rosser())
ans =
6.1100e+02 -4.9693e+02 -6.8294e-15 -6.2369e-15 3.7733e-15
3.1450e-14 -2.2097e-14 -5.0757e-14
-4.9693e+02 4.0434e+02 1.8737e+01 6.7450e-14 2.9311e-15
4.1902e-14 6.3493e-15 1.4161e-14
0.0000e+00 1.8737e+01 3.7049e+01 1.0113e+03 2.4212e-14
7.3035e-14 -1.1387e-13 2.2387e-14
0.0000e+00 0.0000e+00 1.0113e+03 -5.2293e+01 -4.8701e-01
-6.3129e-14 9.4838e-14 9.6069e-15
0.0000e+00 0.0000e+00 0.0000e+00 -4.8701e-01 1.5399e+01
-1.2437e+02 3.4570e-14 -5.4079e-15
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -1.2437e+02
1.0046e+03 -5.0581e-02 2.4911e-13
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
-5.0581e-02 1.0199e+03 -1.4354e-08
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
0.0000e+00 -1.4353e-08 1.0000e+03
The correct result should be symmetric, because rosser() is symmetric.
I implemented myself the orthogonal transformation to upper Hessenberg
form by calling the LAPACK dgehrd (general) and dsytrd (symmetric)
functions and it seems that the result matches what I get with dgehrd.
Therefore, I suspect that the problem lies with hess() not recognizing
(using) the fact that the argument is symmetric.
I do not know how symmetric matrices are handled in Octave. Is it
checked every time? Is there a mark on the matrix for efficiency? It
could also be the case that rosser() does not mark the matrix as
symmetric and so hess() uses the wrong algorithm.
-Matyas