Skip to content

Commit

Permalink
Fix type promote in case b is complex
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-sadeghi committed Oct 23, 2023
1 parent a880003 commit 736675b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ function SciMLBase.init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
args...;
alias_A = default_alias_A(alg, prob.A, prob.b),
alias_b = default_alias_b(alg, prob.A, prob.b),
abstol = default_tol(eltype(prob.b)),
reltol = default_tol(eltype(prob.b)),
abstol = default_tol(real(eltype(prob.b))),
reltol = default_tol(real(eltype(prob.b))),
maxiters::Int = length(prob.b),
verbose::Bool = false,
Pl = IdentityOperator(size(prob.A)[1]),
Expand Down Expand Up @@ -151,8 +151,8 @@ function SciMLBase.init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
end

# Guard against type mismatch for user-specified reltol/abstol
reltol = eltype(prob.b)(reltol)
abstol = eltype(prob.b)(abstol)
reltol = real(eltype(prob.b))(reltol)
abstol = real(eltype(prob.b))(abstol)

Check warning on line 155 in src/common.jl

View check run for this annotation

Codecov / codecov/patch

src/common.jl#L154-L155

Added lines #L154 - L155 were not covered by tests

cacheval = init_cacheval(alg, A, b, u0, Pl, Pr, maxiters, abstol, reltol, verbose,
assumptions)
Expand Down

0 comments on commit 736675b

Please sign in to comment.