diff --git a/src/caches.jl b/src/caches.jl index b3e76862c..a3cefa111 100644 --- a/src/caches.jl +++ b/src/caches.jl @@ -92,8 +92,8 @@ function OrdinaryDiffEq.alg_cache( d = is_secondorder_ode ? length(u[1, :]) : length(u) D = d * (q + 1) - FAC = get_covariance_factorization(alg) - if FAC isa KroneckerCovariance && !(f.mass_matrix isa UniformScaling) + FAC = get_covariance_structure(alg) + if FAC isa IsometricKroneckerCovariance && !(f.mass_matrix isa UniformScaling) error( "The selected algorithm uses an efficient Kronecker-factorized implementation which is incompatible with the provided mass matrix. Try using the `EK1` instead.", ) diff --git a/src/covariance_structure.jl b/src/covariance_structure.jl index f55135ff0..424888c91 100644 --- a/src/covariance_structure.jl +++ b/src/covariance_structure.jl @@ -11,7 +11,7 @@ function get_covariance_structure(alg) ) && alg.prior isa IWP ) - return IsometrciKroneckerCovariance() + return IsometricKroneckerCovariance() else return DenseCovariance() end diff --git a/src/kronecker.jl b/src/kronecker.jl index bab3ba7b6..31b1e75d4 100644 --- a/src/kronecker.jl +++ b/src/kronecker.jl @@ -1,4 +1,4 @@ -""" +@doc raw""" IsometricKroneckerProduct(left_factor_dim::Int64, right_factor::AbstractMatrix) Kronecker product of an identity and a generic matrix: diff --git a/src/priors/common.jl b/src/priors/common.jl index e684ced81..7db3a6b52 100644 --- a/src/priors/common.jl +++ b/src/priors/common.jl @@ -45,7 +45,7 @@ function initialize_transition_matrices( return A, Q, Ah, Qh, P, PI end function initialize_transition_matrices( - fac::CovarianceFactorization, + fac::CovarianceStructure, p::AbstractODEFilterPrior, dt, ) diff --git a/src/priors/iwp.jl b/src/priors/iwp.jl index 34ef04457..6103e79a9 100644 --- a/src/priors/iwp.jl +++ b/src/priors/iwp.jl @@ -105,7 +105,11 @@ function discretize(p::IWP, dt::Real) return A, Q end -function initialize_transition_matrices(::KroneckerCovariance, p::IWP{T}, dt) where {T} +function initialize_transition_matrices( + ::IsometricKroneckerCovariance, + p::IWP{T}, + dt, +) where {T} A, Q = preconditioned_discretize(p) P, PI = initialize_preconditioner(p, dt) Ah = PI * A * P @@ -113,7 +117,8 @@ function initialize_transition_matrices(::KroneckerCovariance, p::IWP{T}, dt) wh return A, Q, Ah, Qh, P, PI end function initialize_transition_matrices(::DenseCovariance, p::IWP{T}, dt) where {T} - A, Q, Ah, Qh, P, PI = initialize_transition_matrices(KroneckerCovariance(), p, dt) + A, Q, Ah, Qh, P, PI = + initialize_transition_matrices(IsometricKroneckerCovariance(), p, dt) P, PI = Diagonal(P), Diagonal(PI) A, Q, Ah, Qh = Matrix(A), PSDMatrix(Matrix(Q.R)), Matrix(Ah), PSDMatrix(Matrix(Qh.R)) return A, Q, Ah, Qh, P, PI diff --git a/src/projection.jl b/src/projection.jl index 688c8b41e..03e92ba34 100644 --- a/src/projection.jl +++ b/src/projection.jl @@ -23,7 +23,7 @@ function projection( end function projection( - ::KroneckerCovariance, + ::IsometricKroneckerCovariance, d::Integer, q::Integer, ::Type{elType}=typeof(1.0),