Skip to content

Commit

Permalink
Use Real instead of AbstractFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Oct 4, 2022
1 parent 226c507 commit 4329336
Show file tree
Hide file tree
Showing 41 changed files with 186 additions and 186 deletions.
2 changes: 1 addition & 1 deletion docs/src/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```

```@docs
Krylov.FloatOrComplex
Krylov.RealOrComplex
Krylov.niterations
Krylov.Aprod
Krylov.Atprod
Expand Down
10 changes: 5 additions & 5 deletions src/bicgstab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export bicgstab, bicgstab!
itmax::Int=0, verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the square linear system Ax = b using BICGSTAB.
Expand Down Expand Up @@ -58,13 +58,13 @@ and `false` otherwise.
"""
function bicgstab end

function bicgstab(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function bicgstab(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = BicgstabSolver(A, b)
bicgstab!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function bicgstab(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function bicgstab(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = BicgstabSolver(A, b)
bicgstab!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -80,7 +80,7 @@ See [`BicgstabSolver`](@ref) for more details about the `solver`.
"""
function bicgstab! end

function bicgstab!(solver :: BicgstabSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function bicgstab!(solver :: BicgstabSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
bicgstab!(solver, A, b; kwargs...)
return solver
Expand All @@ -89,7 +89,7 @@ end
function bicgstab!(solver :: BicgstabSolver{T,FC,S}, A, b :: AbstractVector{FC}; c :: AbstractVector{FC}=b,
M=I, N=I, atol :: T=eps(T), rtol :: T=eps(T),
itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

n, m = size(A)
m == n || error("System must be square")
Expand Down
10 changes: 5 additions & 5 deletions src/bilq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export bilq, bilq!
itmax::Int=0, verbose::Int=0, history::Bool=false,
callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the square linear system Ax = b using BiLQ.
Expand Down Expand Up @@ -46,13 +46,13 @@ and `false` otherwise.
"""
function bilq end

function bilq(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function bilq(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = BilqSolver(A, b)
bilq!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function bilq(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function bilq(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = BilqSolver(A, b)
bilq!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -68,7 +68,7 @@ See [`BilqSolver`](@ref) for more details about the `solver`.
"""
function bilq! end

function bilq!(solver :: BilqSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function bilq!(solver :: BilqSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
bilq!(solver, A, b; kwargs...)
return solver
Expand All @@ -77,7 +77,7 @@ end
function bilq!(solver :: BilqSolver{T,FC,S}, A, b :: AbstractVector{FC}; c :: AbstractVector{FC}=b,
atol :: T=eps(T), rtol :: T=eps(T), transfer_to_bicg :: Bool=true,
itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

n, m = size(A)
m == n || error("System must be square")
Expand Down
10 changes: 5 additions & 5 deletions src/bilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export bilqr, bilqr!
itmax::Int=0, verbose::Int=0, history::Bool=false,
callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Combine BiLQ and QMR to solve adjoint systems.
Expand Down Expand Up @@ -48,13 +48,13 @@ and `false` otherwise.
"""
function bilqr end

function bilqr(A, b :: AbstractVector{FC}, c :: AbstractVector{FC}, x0 :: AbstractVector, y0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function bilqr(A, b :: AbstractVector{FC}, c :: AbstractVector{FC}, x0 :: AbstractVector, y0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = BilqrSolver(A, b)
bilqr!(solver, A, b, c, x0, y0; kwargs...)
return (solver.x, solver.y, solver.stats)
end

function bilqr(A, b :: AbstractVector{FC}, c :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function bilqr(A, b :: AbstractVector{FC}, c :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = BilqrSolver(A, b)
bilqr!(solver, A, b, c; kwargs...)
return (solver.x, solver.y, solver.stats)
Expand All @@ -71,7 +71,7 @@ See [`BilqrSolver`](@ref) for more details about the `solver`.
function bilqr! end

function bilqr!(solver :: BilqrSolver{T,FC,S}, A, b :: AbstractVector{FC}, c :: AbstractVector{FC},
x0 :: AbstractVector, y0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
x0 :: AbstractVector, y0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0, y0)
bilqr!(solver, A, b, c; kwargs...)
return solver
Expand All @@ -80,7 +80,7 @@ end
function bilqr!(solver :: BilqrSolver{T,FC,S}, A, b :: AbstractVector{FC}, c :: AbstractVector{FC};
atol :: T=eps(T), rtol :: T=eps(T), transfer_to_bicg :: Bool=true,
itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

n, m = size(A)
m == n || error("Systems must be square")
Expand Down
10 changes: 5 additions & 5 deletions src/cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export cg, cg!
verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
The conjugate gradient method to solve the symmetric linear system Ax = b.
Expand Down Expand Up @@ -52,13 +52,13 @@ and `false` otherwise.
"""
function cg end

function cg(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function cg(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = CgSolver(A, b)
cg!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function cg(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cg(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CgSolver(A, b)
cg!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -74,7 +74,7 @@ See [`CgSolver`](@ref) for more details about the `solver`.
"""
function cg! end

function cg!(solver :: CgSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function cg!(solver :: CgSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
cg!(solver, A, b; kwargs...)
return solver
Expand All @@ -84,7 +84,7 @@ function cg!(solver :: CgSolver{T,FC,S}, A, b :: AbstractVector{FC};
M=I, atol :: T=eps(T), rtol :: T=eps(T),
itmax :: Int=0, radius :: T=zero(T), linesearch :: Bool=false,
verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

linesearch && (radius > 0) && error("`linesearch` set to `true` but trust-region radius > 0")

Expand Down
10 changes: 5 additions & 5 deletions src/cg_lanczos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export cg_lanczos, cg_lanczos!
check_curvature::Bool=false, verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
The Lanczos version of the conjugate gradient method to solve the
Expand Down Expand Up @@ -48,13 +48,13 @@ and `false` otherwise.
"""
function cg_lanczos end

function cg_lanczos(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function cg_lanczos(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = CgLanczosSolver(A, b)
cg_lanczos!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function cg_lanczos(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cg_lanczos(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CgLanczosSolver(A, b)
cg_lanczos!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -70,7 +70,7 @@ See [`CgLanczosSolver`](@ref) for more details about the `solver`.
"""
function cg_lanczos! end

function cg_lanczos!(solver :: CgLanczosSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function cg_lanczos!(solver :: CgLanczosSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
cg_lanczos!(solver, A, b; kwargs...)
return solver
Expand All @@ -79,7 +79,7 @@ end
function cg_lanczos!(solver :: CgLanczosSolver{T,FC,S}, A, b :: AbstractVector{FC};
M=I, atol :: T=eps(T), rtol :: T=eps(T), itmax :: Int=0,
check_curvature :: Bool=false, verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

n, m = size(A)
m == n || error("System must be square")
Expand Down
6 changes: 3 additions & 3 deletions src/cg_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export cg_lanczos_shift, cg_lanczos_shift!
verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
The Lanczos version of the conjugate gradient method to solve a family
Expand All @@ -39,7 +39,7 @@ and `false` otherwise.
"""
function cg_lanczos_shift end

function cg_lanczos_shift(A, b :: AbstractVector{FC}, shifts :: AbstractVector{T}; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}}
function cg_lanczos_shift(A, b :: AbstractVector{FC}, shifts :: AbstractVector{T}; kwargs...) where {T <: Real, FC <: RealOrComplex{T}}
nshifts = length(shifts)
solver = CgLanczosShiftSolver(A, b, nshifts)
cg_lanczos_shift!(solver, A, b, shifts; kwargs...)
Expand All @@ -59,7 +59,7 @@ function cg_lanczos_shift!(solver :: CgLanczosShiftSolver{T,FC,S}, A, b :: Abstr
M=I, atol :: T=eps(T), rtol :: T=eps(T),
itmax :: Int=0, check_curvature :: Bool=false,
verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

n, m = size(A)
m == n || error("System must be square")
Expand Down
6 changes: 3 additions & 3 deletions src/cgls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export cgls, cgls!
radius::T=zero(T), itmax::Int=0, verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the regularized linear least-squares problem
Expand Down Expand Up @@ -63,7 +63,7 @@ and `false` otherwise.
"""
function cgls end

function cgls(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cgls(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CglsSolver(A, b)
cgls!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -81,7 +81,7 @@ function cgls! end
function cgls!(solver :: CglsSolver{T,FC,S}, A, b :: AbstractVector{FC};
M=I, λ :: T=zero(T), atol :: T=eps(T), rtol :: T=eps(T),
radius :: T=zero(T), itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

m, n = size(A)
length(b) == m || error("Inconsistent problem size")
Expand Down
6 changes: 3 additions & 3 deletions src/cgne.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export cgne, cgne!
itmax::Int=0, verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the consistent linear system
Expand Down Expand Up @@ -72,7 +72,7 @@ and `false` otherwise.
"""
function cgne end

function cgne(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cgne(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CgneSolver(A, b)
cgne!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -90,7 +90,7 @@ function cgne! end
function cgne!(solver :: CgneSolver{T,FC,S}, A, b :: AbstractVector{FC};
N=I, λ :: T=zero(T), atol :: T=eps(T), rtol :: T=eps(T),
itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

m, n = size(A)
length(b) == m || error("Inconsistent problem size")
Expand Down
10 changes: 5 additions & 5 deletions src/cgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export cgs, cgs!
itmax::Int=0, verbose::Int=0, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the consistent linear system Ax = b using conjugate gradient squared algorithm.
Expand Down Expand Up @@ -55,13 +55,13 @@ and `false` otherwise.
"""
function cgs end

function cgs(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function cgs(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = CgsSolver(A, b)
cgs!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function cgs(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cgs(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CgsSolver(A, b)
cgs!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -77,7 +77,7 @@ See [`CgsSolver`](@ref) for more details about the `solver`.
"""
function cgs! end

function cgs!(solver :: CgsSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function cgs!(solver :: CgsSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
cgs!(solver, A, b; kwargs...)
return solver
Expand All @@ -86,7 +86,7 @@ end
function cgs!(solver :: CgsSolver{T,FC,S}, A, b :: AbstractVector{FC}; c :: AbstractVector{FC}=b,
M=I, N=I, atol :: T=eps(T), rtol :: T=eps(T),
itmax :: Int=0, verbose :: Int=0, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

m, n = size(A)
m == n || error("System must be square")
Expand Down
10 changes: 5 additions & 5 deletions src/cr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export cr, cr!
radius::T=zero(T), verbose::Int=0, linesearch::Bool=false, history::Bool=false,
ldiv::Bool=false, callback=solver->false)
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`T` is a `Real` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
A truncated version of Stiefel’s Conjugate Residual method to solve the symmetric linear system Ax = b or the least-squares problem min ‖b - Ax‖.
Expand Down Expand Up @@ -51,13 +51,13 @@ and `false` otherwise.
"""
function cr end

function cr(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: FloatOrComplex
function cr(A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where FC <: RealOrComplex
solver = CrSolver(A, b)
cr!(solver, A, b, x0; kwargs...)
return (solver.x, solver.stats)
end

function cr(A, b :: AbstractVector{FC}; kwargs...) where FC <: FloatOrComplex
function cr(A, b :: AbstractVector{FC}; kwargs...) where FC <: RealOrComplex
solver = CrSolver(A, b)
cr!(solver, A, b; kwargs...)
return (solver.x, solver.stats)
Expand All @@ -73,7 +73,7 @@ See [`CrSolver`](@ref) for more details about the `solver`.
"""
function cr! end

function cr!(solver :: CrSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
function cr!(solver :: CrSolver{T,FC,S}, A, b :: AbstractVector{FC}, x0 :: AbstractVector; kwargs...) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}
warm_start!(solver, x0)
cr!(solver, A, b; kwargs...)
return solver
Expand All @@ -82,7 +82,7 @@ end
function cr!(solver :: CrSolver{T,FC,S}, A, b :: AbstractVector{FC};
M=I, atol :: T=eps(T), rtol :: T=eps(T), γ :: T=eps(T), itmax :: Int=0,
radius :: T=zero(T), verbose :: Int=0, linesearch :: Bool=false, history :: Bool=false,
ldiv :: Bool=false, callback = solver -> false) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: DenseVector{FC}}
ldiv :: Bool=false, callback = solver -> false) where {T <: Real, FC <: RealOrComplex{T}, S <: DenseVector{FC}}

linesearch && (radius > 0) && error("'linesearch' set to 'true' but radius > 0")
n, m = size(A)
Expand Down
Loading

0 comments on commit 4329336

Please sign in to comment.