diff --git a/src/krylov_solvers.jl b/src/krylov_solvers.jl index 398e61114..d78604d3d 100644 --- a/src/krylov_solvers.jl +++ b/src/krylov_solvers.jl @@ -73,11 +73,6 @@ mutable struct MinresSolver{T,FC,S} <: KrylovSolver{T,FC,S} err_vec :: Vector{T} warm_start :: Bool stats :: SimpleStats{T} - - function MinresSolver{T,FC,S}(Δx, x, r1, r2, w1, w2, y, v, err_vec, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, r1, r2, w1, w2, y, v, err_vec, warm_start, stats) - end end function MinresSolver(m, n, S; window :: Int=5) @@ -92,7 +87,6 @@ function MinresSolver(m, n, S; window :: Int=5) y = S(undef, n) v = S(undef, 0) err_vec = zeros(T, window) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = MinresSolver{T,FC,S}(m, n, Δx, x, r1, r2, w1, w2, y, v, err_vec, false, stats) return solver @@ -125,11 +119,6 @@ mutable struct CgSolver{T,FC,S} <: KrylovSolver{T,FC,S} z :: S warm_start :: Bool stats :: SimpleStats{T} - - function CgSolver{T,FC,S}(Δx, x, r, p, Ap, z, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, r, p, Ap, z, warm_start, stats) - end end function CgSolver(m, n, S) @@ -141,7 +130,6 @@ function CgSolver(m, n, S) p = S(undef, n) Ap = S(undef, n) z = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = CgSolver{T,FC,S}(m, n, Δx, x, r, p, Ap, z, false, stats) return solver @@ -175,11 +163,6 @@ mutable struct CrSolver{T,FC,S} <: KrylovSolver{T,FC,S} Mq :: S warm_start :: Bool stats :: SimpleStats{T} - - function CrSolver{T,FC,S}(Δx, x, r, p, q, Ar, Mq, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, r, p, q, Ar, Mq, warm_start, stats) - end end function CrSolver(m, n, S) @@ -192,7 +175,6 @@ function CrSolver(m, n, S) q = S(undef, n) Ar = S(undef, n) Mq = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = CrSolver{T,FC,S}(m, n, Δx, x, r, p, q, Ar, Mq, false, stats) return solver @@ -229,11 +211,6 @@ mutable struct SymmlqSolver{T,FC,S} <: KrylovSolver{T,FC,S} sprod :: Vector{T} warm_start :: Bool stats :: SymmlqStats{T} - - function SymmlqSolver{T,FC,S}(Δx, x, Mvold, Mv, Mv_next, w̅, v, clist, zlist, sprod, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, Mvold, Mv, Mv_next, w̅, v, clist, zlist, sprod, warm_start, stats) - end end function SymmlqSolver(m, n, S; window :: Int=5) @@ -249,7 +226,6 @@ function SymmlqSolver(m, n, S; window :: Int=5) clist = zeros(T, window) zlist = zeros(T, window) sprod = ones(T, window) - warm_start = false stats = SymmlqStats(0, false, T[], Union{T, Missing}[], T[], Union{T, Missing}[], T(NaN), T(NaN), "unknown") solver = SymmlqSolver{T,FC,S}(m, n, Δx, x, Mvold, Mv, Mv_next, w̅, v, clist, zlist, sprod, false, stats) return solver @@ -283,11 +259,6 @@ mutable struct CgLanczosSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S warm_start :: Bool stats :: LanczosStats{T} - - function CgLanczosSolver{T,FC,S}(Δx, x, Mv, Mv_prev, p, Mv_next, v, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, Mv, Mv_prev, p, Mv_next, v, warm_start, stats) - end end function CgLanczosSolver(m, n, S) @@ -300,7 +271,6 @@ function CgLanczosSolver(m, n, S) p = S(undef, n) Mv_next = S(undef, n) v = S(undef, 0) - warm_start = false stats = LanczosStats(0, false, T[], false, T(NaN), T(NaN), "unknown") solver = CgLanczosSolver{T,FC,S}(m, n, Δx, x, Mv, Mv_prev, p, Mv_next, v, false, stats) return solver @@ -339,11 +309,6 @@ mutable struct CgLanczosShiftSolver{T,FC,S} <: KrylovSolver{T,FC,S} converged :: BitVector not_cv :: BitVector stats :: LanczosShiftStats{T} - - function CgLanczosShiftSolver{T,FC,S}(Mv, Mv_prev, Mv_next, v, x, p, σ, δhat, ω, γ, rNorms, converged, not_cv, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Mv, Mv_prev, Mv_next, v, x, p, σ, δhat, ω, γ, rNorms, converged, not_cv, stats) - end end function CgLanczosShiftSolver(m, n, nshifts, S) @@ -397,11 +362,6 @@ mutable struct MinresQlpSolver{T,FC,S} <: KrylovSolver{T,FC,S} vₖ :: S warm_start :: Bool stats :: SimpleStats{T} - - function MinresQlpSolver{T,FC,S}(Δx, wₖ₋₁, wₖ, M⁻¹vₖ₋₁, M⁻¹vₖ, x, p, vₖ, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, wₖ₋₁, wₖ, M⁻¹vₖ₋₁, M⁻¹vₖ, x, p, vₖ, warm_start, stats) - end end function MinresQlpSolver(m, n, S) @@ -415,7 +375,6 @@ function MinresQlpSolver(m, n, S) x = S(undef, n) p = S(undef, n) vₖ = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = MinresQlpSolver{T,FC,S}(m, n, Δx, wₖ₋₁, wₖ, M⁻¹vₖ₋₁, M⁻¹vₖ, x, p, vₖ, false, stats) return solver @@ -453,11 +412,6 @@ mutable struct DqgmresSolver{T,FC,S} <: KrylovSolver{T,FC,S} H :: Vector{FC} warm_start :: Bool stats :: SimpleStats{T} - - function DqgmresSolver{T,FC,S}(Δx, x, t, z, w, P, V, c, s, H, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, t, z, w, P, V, c, s, H, warm_start, stats) - end end function DqgmresSolver(m, n, memory, S) @@ -474,7 +428,6 @@ function DqgmresSolver(m, n, memory, S) c = Vector{T}(undef, memory) s = Vector{FC}(undef, memory) H = Vector{FC}(undef, memory+1) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = DqgmresSolver{T,FC,S}(m, n, Δx, x, t, z, w, P, V, c, s, H, false, stats) return solver @@ -511,11 +464,6 @@ mutable struct DiomSolver{T,FC,S} <: KrylovSolver{T,FC,S} H :: Vector{FC} warm_start :: Bool stats :: SimpleStats{T} - - function DiomSolver{T,FC,S}(Δx, x, t, z, w, P, V, L, H, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, t, z, w, P, V, L, H, warm_start, stats) - end end function DiomSolver(m, n, memory, S) @@ -531,7 +479,6 @@ function DiomSolver(m, n, memory, S) V = S[S(undef, n) for i = 1 : memory] L = Vector{FC}(undef, memory-1) H = Vector{FC}(undef, memory) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = DiomSolver{T,FC,S}(m, n, Δx, x, t, z, w, P, V, L, H, false, stats) return solver @@ -567,11 +514,6 @@ mutable struct UsymlqSolver{T,FC,S} <: KrylovSolver{T,FC,S} q :: S warm_start :: Bool stats :: SimpleStats{T} - - function UsymlqSolver{T,FC,S}(uₖ₋₁, uₖ, p, Δx, x, d̅, vₖ₋₁, vₖ, q, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(uₖ₋₁, uₖ, p, Δx, x, d̅, vₖ₋₁, vₖ, q, warm_start, stats) - end end function UsymlqSolver(m, n, S) @@ -622,11 +564,6 @@ mutable struct UsymqrSolver{T,FC,S} <: KrylovSolver{T,FC,S} p :: S warm_start :: Bool stats :: SimpleStats{T} - - function UsymqrSolver{T,FC,S}(vₖ₋₁, vₖ, q, Δx, x, wₖ₋₂, wₖ₋₁, uₖ₋₁, uₖ, p, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(vₖ₋₁, vₖ, q, Δx, x, wₖ₋₂, wₖ₋₁, uₖ₋₁, uₖ, p, warm_start, stats) - end end function UsymqrSolver(m, n, S) @@ -684,11 +621,6 @@ mutable struct TricgSolver{T,FC,S} <: KrylovSolver{T,FC,S} vₖ :: S warm_start :: Bool stats :: SimpleStats{T} - - function TricgSolver{T,FC,S}(y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, warm_start, stats) - end end function TricgSolver(m, n, S) @@ -710,7 +642,6 @@ function TricgSolver(m, n, S) Δy = S(undef, 0) uₖ = S(undef, 0) vₖ = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = TricgSolver{T,FC,S}(m, n, y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, false, stats) return solver @@ -757,11 +688,6 @@ mutable struct TrimrSolver{T,FC,S} <: KrylovSolver{T,FC,S} vₖ :: S warm_start :: Bool stats :: SimpleStats{T} - - function TrimrSolver{T,FC,S}(y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₃, gy₂ₖ₋₂, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₃, gx₂ₖ₋₂, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₃, gy₂ₖ₋₂, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₃, gx₂ₖ₋₂, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, warm_start, stats) - end end function TrimrSolver(m, n, S) @@ -787,7 +713,6 @@ function TrimrSolver(m, n, S) Δy = S(undef, 0) uₖ = S(undef, 0) vₖ = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = TrimrSolver{T,FC,S}(m, n, y, N⁻¹uₖ₋₁, N⁻¹uₖ, p, gy₂ₖ₋₃, gy₂ₖ₋₂, gy₂ₖ₋₁, gy₂ₖ, x, M⁻¹vₖ₋₁, M⁻¹vₖ, q, gx₂ₖ₋₃, gx₂ₖ₋₂, gx₂ₖ₋₁, gx₂ₖ, Δx, Δy, uₖ, vₖ, false, stats) return solver @@ -827,11 +752,6 @@ mutable struct TrilqrSolver{T,FC,S} <: KrylovSolver{T,FC,S} wₖ₋₂ :: S warm_start :: Bool stats :: AdjointStats{T} - - function TrilqrSolver{T,FC,S}(uₖ₋₁, uₖ, p, d̅, Δx, x, vₖ₋₁, vₖ, q, Δy, y, wₖ₋₃, wₖ₋₂, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(uₖ₋₁, uₖ, p, d̅, Δx, x, vₖ₋₁, vₖ, q, Δy, y, wₖ₋₃, wₖ₋₂, warm_start, stats) - end end function TrilqrSolver(m, n, S) @@ -885,11 +805,6 @@ mutable struct CgsSolver{T,FC,S} <: KrylovSolver{T,FC,S} vw :: S warm_start :: Bool stats :: SimpleStats{T} - - function CgsSolver{T,FC,S}(Δx, x, r, u, p, q, ts, yz, vw, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, r, u, p, q, ts, yz, vw, warm_start, stats) - end end function CgsSolver(m, n, S) @@ -904,7 +819,7 @@ function CgsSolver(m, n, S) ts = S(undef, n) yz = S(undef, 0) vw = S(undef, 0) - warm_start = false + stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = CgsSolver{T,FC,S}(m, n, Δx, x, r, u, p, q, ts, yz, vw, false, stats) return solver @@ -940,11 +855,6 @@ mutable struct BicgstabSolver{T,FC,S} <: KrylovSolver{T,FC,S} t :: S warm_start :: Bool stats :: SimpleStats{T} - - function BicgstabSolver{T,FC,S}(Δx, x, r, p, v, s, qd, yz, t, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, r, p, v, s, qd, yz, t, warm_start, stats) - end end function BicgstabSolver(m, n, S) @@ -959,7 +869,6 @@ function BicgstabSolver(m, n, S) qd = S(undef, n) yz = S(undef, 0) t = S(undef, 0) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = BicgstabSolver{T,FC,S}(m, n, Δx, x, r, p, v, s, qd, yz, t, false, stats) return solver @@ -995,11 +904,6 @@ mutable struct BilqSolver{T,FC,S} <: KrylovSolver{T,FC,S} d̅ :: S warm_start :: Bool stats :: SimpleStats{T} - - function BilqSolver{T,FC,S}(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, d̅, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, d̅, warm_start, stats) - end end function BilqSolver(m, n, S) @@ -1014,7 +918,6 @@ function BilqSolver(m, n, S) Δx = S(undef, 0) x = S(undef, n) d̅ = S(undef, n) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = BilqSolver{T,FC,S}(m, n, uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, d̅, false, stats) return solver @@ -1051,11 +954,6 @@ mutable struct QmrSolver{T,FC,S} <: KrylovSolver{T,FC,S} wₖ₋₁ :: S warm_start :: Bool stats :: SimpleStats{T} - - function QmrSolver{T,FC,S}(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, wₖ₋₂, wₖ₋₁, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, wₖ₋₂, wₖ₋₁, warm_start, stats) - end end function QmrSolver(m, n, S) @@ -1071,7 +969,6 @@ function QmrSolver(m, n, S) x = S(undef, n) wₖ₋₂ = S(undef, n) wₖ₋₁ = S(undef, n) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = QmrSolver{T,FC,S}(m, n, uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, wₖ₋₂, wₖ₋₁, false, stats) return solver @@ -1111,11 +1008,6 @@ mutable struct BilqrSolver{T,FC,S} <: KrylovSolver{T,FC,S} wₖ₋₂ :: S warm_start :: Bool stats :: AdjointStats{T} - - function BilqrSolver{T,FC,S}(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, Δy, y, d̅, wₖ₋₃, wₖ₋₂, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, Δy, y, d̅, wₖ₋₃, wₖ₋₂, warm_start, stats) - end end function BilqrSolver(m, n, S) @@ -1134,7 +1026,6 @@ function BilqrSolver(m, n, S) d̅ = S(undef, n) wₖ₋₃ = S(undef, n) wₖ₋₂ = S(undef, n) - warm_start = false stats = AdjointStats(0, false, false, T[], T[], "unknown") solver = BilqrSolver{T,FC,S}(m, n, uₖ₋₁, uₖ, q, vₖ₋₁, vₖ, p, Δx, x, Δy, y, d̅, wₖ₋₃, wₖ₋₂, false, stats) return solver @@ -1166,11 +1057,6 @@ mutable struct CglsSolver{T,FC,S} <: KrylovSolver{T,FC,S} q :: S Mr :: S stats :: SimpleStats{T} - - function CglsSolver{T,FC,S}(x, p, s, r, q, Mr, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, p, s, r, q, Mr, stats) - end end function CglsSolver(m, n, S) @@ -1215,11 +1101,6 @@ mutable struct CrlsSolver{T,FC,S} <: KrylovSolver{T,FC,S} s :: S Ms :: S stats :: SimpleStats{T} - - function CrlsSolver{T,FC,S}(x, p, Ar, q, r, Ap, s, Ms, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, p, Ar, q, r, Ap, s, Ms, stats) - end end function CrlsSolver(m, n, S) @@ -1265,11 +1146,6 @@ mutable struct CgneSolver{T,FC,S} <: KrylovSolver{T,FC,S} s :: S z :: S stats :: SimpleStats{T} - - function CgneSolver{T,FC,S}(x, p, Aᴴz, r, q, s, z, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, p, Aᴴz, r, q, s, z, stats) - end end function CgneSolver(m, n, S) @@ -1314,11 +1190,6 @@ mutable struct CrmrSolver{T,FC,S} <: KrylovSolver{T,FC,S} Nq :: S s :: S stats :: SimpleStats{T} - - function CrmrSolver{T,FC,S}(x, p, Aᴴr, r, q, Nq, s, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, p, Aᴴr, r, q, Nq, s, stats) - end end function CrmrSolver(m, n, S) @@ -1365,11 +1236,6 @@ mutable struct LslqSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S err_vec :: Vector{T} stats :: LSLQStats{T} - - function LslqSolver{T,FC,S}(x, Nv, Aᴴu, w̄, Mu, Av, u, v, err_vec, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, w̄, Mu, Av, u, v, err_vec, stats) - end end function LslqSolver(m, n, S; window :: Int=5) @@ -1418,11 +1284,6 @@ mutable struct LsqrSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S err_vec :: Vector{T} stats :: SimpleStats{T} - - function LsqrSolver{T,FC,S}(x, Nv, Aᴴu, w, Mu, Av, u, v, err_vec, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, w, Mu, Av, u, v, err_vec, stats) - end end function LsqrSolver(m, n, S; window :: Int=5) @@ -1472,11 +1333,6 @@ mutable struct LsmrSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S err_vec :: Vector{T} stats :: LsmrStats{T} - - function LsmrSolver{T,FC,S}(x, Nv, Aᴴu, h, hbar, Mu, Av, u, v, err_vec, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, h, hbar, Mu, Av, u, v, err_vec, stats) - end end function LsmrSolver(m, n, S; window :: Int=5) @@ -1527,11 +1383,6 @@ mutable struct LnlqSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S q :: S stats :: LNLQStats{T} - - function LnlqSolver{T,FC,S}(x, Nv, Aᴴu, y, w̄, Mu, Av, u, v, q, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, y, w̄, Mu, Av, u, v, q, stats) - end end function LnlqSolver(m, n, S) @@ -1582,11 +1433,6 @@ mutable struct CraigSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S w2 :: S stats :: SimpleStats{T} - - function CraigSolver{T,FC,S}(x, Nv, Aᴴu, y, w, Mu, Av, u, v, w2, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, y, w, Mu, Av, u, v, w2, stats) - end end function CraigSolver(m, n, S) @@ -1639,11 +1485,6 @@ mutable struct CraigmrSolver{T,FC,S} <: KrylovSolver{T,FC,S} v :: S q :: S stats :: SimpleStats{T} - - function CraigmrSolver{T,FC,S}(x, Nv, Aᴴu, d, y, Mu, w, wbar, Av, u, v, q, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(x, Nv, Aᴴu, d, y, Mu, w, wbar, Av, u, v, q, stats) - end end function CraigmrSolver(m, n, S) @@ -1699,11 +1540,6 @@ mutable struct GmresSolver{T,FC,S} <: KrylovSolver{T,FC,S} inner_iter :: Int warm_start :: Bool stats :: SimpleStats{T} - - function GmresSolver{T,FC,S}(Δx, x, w, p, q, V, c, s, z, R, inner_iter, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, w, p, q, V, c, s, z, R, inner_iter, warm_start, stats) - end end function GmresSolver(m, n, memory, S) @@ -1721,7 +1557,6 @@ function GmresSolver(m, n, memory, S) z = Vector{FC}(undef, memory) R = Vector{FC}(undef, div(memory * (memory+1), 2)) inner_iter = 0 - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = GmresSolver{T,FC,S}(m, n, Δx, x, w, p, q, V, c, s, z, R, false, 0, stats) return solver @@ -1760,11 +1595,6 @@ mutable struct FgmresSolver{T,FC,S} <: KrylovSolver{T,FC,S} inner_iter :: Int warm_start :: Bool stats :: SimpleStats{T} - - function FgmresSolver{T,FC,S}(Δx, x, w, q, V, Z, c, s, z, R, inner_iter, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, w, q, V, Z, c, s, z, R, inner_iter, warm_start, stats) - end end function FgmresSolver(m, n, memory, S) @@ -1782,7 +1612,6 @@ function FgmresSolver(m, n, memory, S) z = Vector{FC}(undef, memory) R = Vector{FC}(undef, div(memory * (memory+1), 2)) inner_iter = 0 - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = FgmresSolver{T,FC,S}(m, n, Δx, x, w, q, V, Z, c, s, z, R, false, 0, stats) return solver @@ -1819,11 +1648,6 @@ mutable struct FomSolver{T,FC,S} <: KrylovSolver{T,FC,S} U :: Vector{FC} warm_start :: Bool stats :: SimpleStats{T} - - function FomSolver{T,FC,S}(Δx, x, w, p, q, V, l, z, U, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(Δx, x, w, p, q, V, l, z, U, warm_start, stats) - end end function FomSolver(m, n, memory, S) @@ -1839,7 +1663,6 @@ function FomSolver(m, n, memory, S) l = Vector{FC}(undef, memory) z = Vector{FC}(undef, memory) U = Vector{FC}(undef, div(memory * (memory+1), 2)) - warm_start = false stats = SimpleStats(0, false, false, T[], T[], T[], "unknown") solver = FomSolver{T,FC,S}(m, n, Δx, x, w, p, q, V, l, z, U, false, stats) return solver @@ -1883,11 +1706,6 @@ mutable struct GpmrSolver{T,FC,S} <: KrylovSolver{T,FC,S} R :: Vector{FC} warm_start :: Bool stats :: SimpleStats{T} - - function GpmrSolver{T,FC,S}(wA, wB, dA, dB, Δx, Δy, x, y, q, p, V, U, gs, gc, zt, R, warm_start, stats) where {T,FC,S} - T <: Integer && error("Krylov methods cannot solve linear systems over the integers") - return new(wA, wB, dA, dB, Δx, Δy, x, y, q, p, V, U, gs, gc, zt, R, warm_start, stats) - end end function GpmrSolver(m, n, memory, S) diff --git a/src/krylov_utils.jl b/src/krylov_utils.jl index 23dac6290..6049f9c28 100644 --- a/src/krylov_utils.jl +++ b/src/krylov_utils.jl @@ -164,7 +164,7 @@ Display an array in the form with (ndisp - 1)/2 elements on each side. """ -function vec2str(x :: AbstractVector{T}; ndisp :: Int=7) where T <: Union{Real, Missing} +function vec2str(x :: AbstractVector{T}; ndisp :: Int=7) where T <: Union{AbstractFloat, Missing} n = length(x) if n ≤ ndisp ndisp = n