Skip to content

hessenberg(A).H should return a LinearAlgebra.UpperHessenberg object #168

@stevengj

Description

@stevengj

Currently this returns a GenericLinearAlgebra.HessenbergMatrix object:

julia> H = hessenberg(randn(BigFloat, 5,5)).H
5×5 GenericLinearAlgebra.HessenbergMatrix{BigFloat, Matrix{BigFloat}}:
  1.29656  -0.865514  -0.443783   0.0642842  -0.377115
 -2.28794   0.992292  -0.498822   0.34119    -0.163957
  0.0      -1.0606     1.45299   -0.364921   -0.46364
  0.0       0.0       -0.240289  -0.414416    0.762457
  0.0       0.0        0.0       -0.988815   -1.90171

which doesn't support some of the fast algorithms implemented for LinearAlgebra.UpperHessenberg, e.g. ldiv! or det:

julia> H = hessenberg(randn(BigFloat, 100,100)).H;

julia> @btime det(H);
  9.150 ms (671784 allocations: 61.60 MiB)

julia> @btime det(UpperHessenberg(H.data));
  548.583 μs (15153 allocations: 1.39 MiB)

Is there any reason we're still returning HessenbergMatrix? I'm guessing it is just a historical artifact that preceded the implementation of UpperHessenberg?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions