Skip to content

Commit 231424c

Browse files
committed
Resolve conflicting name Hessenberg
1 parent b8056b2 commit 231424c

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/gmres.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function solve_least_squares!(arnoldi::ArnoldiDecomp{T}, β, k::Int) where {T}
242242
rhs = zeros(T, k)
243243
rhs[1] = β
244244

245-
H = Hessenberg(view(arnoldi.H, 1 : k, 1 : k - 1))
245+
H = FastHessenberg(view(arnoldi.H, 1 : k, 1 : k - 1))
246246
A_ldiv_B!(H, rhs)
247247

248248
rhs

src/hessenberg.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import Base.LinAlg: Givens, givensAlgorithm
22
import Base.A_ldiv_B!
33

4-
struct Hessenberg{T<:AbstractMatrix}
4+
struct FastHessenberg{T<:AbstractMatrix}
55
H::T # H is assumed to be Hessenberg of size (m + 1) × m
66
end
77

8-
@inline Base.size(H::Hessenberg, args...) = size(H.H, args...)
8+
@inline Base.size(H::FastHessenberg, args...) = size(H.H, args...)
99

1010
"""
1111
Solve Hy = rhs for a non-square Hessenberg matrix.
1212
Note that `H` is also modified as is it converted
1313
to an upper triangular matrix via Given's rotations
1414
"""
15-
function A_ldiv_B!(H::Hessenberg, rhs)
15+
function A_ldiv_B!(H::FastHessenberg, rhs)
1616
# Implicitly computes H = QR via Given's rotations
1717
# and then computes the least-squares solution y to
1818
# |Hy - rhs| = |QRy - rhs| = |Ry - Q'rhs|

test/hessenberg.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using IterativeSolvers
22
using Base.Test
33

4-
import IterativeSolvers: Hessenberg
5-
64
@testset "Hessenberg" begin
75

86
# Some well-conditioned Hessenberg matrix
@@ -24,15 +22,15 @@ import IterativeSolvers: Hessenberg
2422
0.0+0.0im 0.0+0.0im 0.0+0.0im 1.42175+0.0im
2523
]
2624

27-
for H = [H1, H2]
25+
for H = (H1, H2)
2826
T = eltype(H)
2927

3028
# Fist standard basis vector as rhs
3129
rhs = [i == 1 ? one(T) : zero(T) for i = 1 : size(H, 1)]
3230

3331
# Compare \ against the optimized version.
3432
solution_with_residual = copy(rhs)
35-
A_ldiv_B!(IterativeSolvers.Hessenberg(copy(H)), solution_with_residual)
33+
A_ldiv_B!(IterativeSolvers.FastHessenberg(copy(H)), solution_with_residual)
3634
solution = H \ rhs
3735

3836
# First part is the solution

0 commit comments

Comments
 (0)