From 6c9cbc8f7f04b684a2923cd7f12f8a0debf23639 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Sat, 29 Jan 2022 08:43:53 -0500 Subject: [PATCH 1/3] Set size of zero vector to be size(A, 2) --- src/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.jl b/src/common.jl index ec4e0406f..654c016b9 100644 --- a/src/common.jl +++ b/src/common.jl @@ -87,7 +87,7 @@ function SciMLBase.init(prob::LinearProblem, alg::Union{SciMLLinearSolveAlgorith ) @unpack A, b, u0, p = prob - u0 = (u0 !== nothing) ? u0 : zero(b) + u0 = (u0 !== nothing) ? u0 : zeros(size(A, 2)) cacheval = init_cacheval(alg, A, b, u0, Pl, Pr, maxiters, abstol, reltol, verbose) isfresh = true From 81841c8d72cf0f0bca8cb5ad1212529825891773 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Sat, 29 Jan 2022 08:49:20 -0500 Subject: [PATCH 2/3] ensure proper type --- src/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.jl b/src/common.jl index 654c016b9..a900a5205 100644 --- a/src/common.jl +++ b/src/common.jl @@ -87,7 +87,7 @@ function SciMLBase.init(prob::LinearProblem, alg::Union{SciMLLinearSolveAlgorith ) @unpack A, b, u0, p = prob - u0 = (u0 !== nothing) ? u0 : zeros(size(A, 2)) + u0 = (u0 !== nothing) ? u0 : zero.(similar(b, size(A, 2))) cacheval = init_cacheval(alg, A, b, u0, Pl, Pr, maxiters, abstol, reltol, verbose) isfresh = true From e4d13cebf804bd1f65c9774c81b0d4d1b7ee51b2 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 29 Jan 2022 12:28:33 -0500 Subject: [PATCH 3/3] Update src/common.jl --- src/common.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common.jl b/src/common.jl index a900a5205..2f329f621 100644 --- a/src/common.jl +++ b/src/common.jl @@ -87,7 +87,12 @@ function SciMLBase.init(prob::LinearProblem, alg::Union{SciMLLinearSolveAlgorith ) @unpack A, b, u0, p = prob - u0 = (u0 !== nothing) ? u0 : zero.(similar(b, size(A, 2))) + u0 = if u0 !== nothing + u0 + else + u0 = similar(b, size(A, 2)) + fill!(u0,false) + end cacheval = init_cacheval(alg, A, b, u0, Pl, Pr, maxiters, abstol, reltol, verbose) isfresh = true