From cf2fec9671eebc6f0033f412076f455a1cc012dd Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 21 Nov 2024 02:46:29 -0800 Subject: [PATCH] Update lib/OrdinaryDiffEqLinear/src/linear_caches.jl --- lib/OrdinaryDiffEqLinear/src/linear_caches.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqLinear/src/linear_caches.jl b/lib/OrdinaryDiffEqLinear/src/linear_caches.jl index a89f3288bb..14aaeb0692 100644 --- a/lib/OrdinaryDiffEqLinear/src/linear_caches.jl +++ b/lib/OrdinaryDiffEqLinear/src/linear_caches.jl @@ -571,8 +571,8 @@ function _phiv_timestep_caches(u_prototype, maxiter::Int, p::Int) n = length(u_prototype) T = eltype(u_prototype) u = zero(u_prototype) # stores the current state - W = Matrix{T}(undef, n, p + 1) # stores the w vectors - P = Matrix{T}(undef, n, p + 2) # stores output from phiv! + W = similar(u_prototype, n, p+1) # stores the w vectors + P = similar(u_prototype, n, p+2) # stores output from phiv! Ks = KrylovSubspace{T,T,typeof(similar(u_prototype,size(u_prototype,1),2))}(n, maxiter) # stores output from arnoldi! phiv_cache = PhivCache(u_prototype, maxiter, p + 1) # cache used by phiv! (need +1 for error estimation) return u, W, P, Ks, phiv_cache