From 736675b19822a382e797836baeead60b2e4d99ab Mon Sep 17 00:00:00 2001 From: Amin Sadeghi Date: Mon, 23 Oct 2023 15:00:00 -0400 Subject: [PATCH] Fix type promote in case b is complex --- src/common.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common.jl b/src/common.jl index cccd941f0..f24e228a6 100644 --- a/src/common.jl +++ b/src/common.jl @@ -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]), @@ -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) cacheval = init_cacheval(alg, A, b, u0, Pl, Pr, maxiters, abstol, reltol, verbose, assumptions)