Skip to content

Commit 736675b

Browse files
committed
Fix type promote in case b is complex
1 parent a880003 commit 736675b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/common.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ function SciMLBase.init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
115115
args...;
116116
alias_A = default_alias_A(alg, prob.A, prob.b),
117117
alias_b = default_alias_b(alg, prob.A, prob.b),
118-
abstol = default_tol(eltype(prob.b)),
119-
reltol = default_tol(eltype(prob.b)),
118+
abstol = default_tol(real(eltype(prob.b))),
119+
reltol = default_tol(real(eltype(prob.b))),
120120
maxiters::Int = length(prob.b),
121121
verbose::Bool = false,
122122
Pl = IdentityOperator(size(prob.A)[1]),
@@ -151,8 +151,8 @@ function SciMLBase.init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
151151
end
152152

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

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

0 commit comments

Comments
 (0)