Skip to content

Commit

Permalink
JuliaFormatter.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Oct 26, 2023
1 parent 8dffaac commit 2fc434f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
16 changes: 8 additions & 8 deletions test/core/filtering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,16 @@ end
x_next_psd = Gaussian(m_s, PSDMatrix(P_s_R)) |> copy
cache = if !KRONECKER
(x_pred=copy(x_curr_psd),
G1=zeros(_d, _d),
C_DxD=zeros(_d, _d),
C_2DxD=zeros(2_d, _d),
C_3DxD=zeros(3_d, _d))
G1=zeros(_d, _d),
C_DxD=zeros(_d, _d),
C_2DxD=zeros(2_d, _d),
C_3DxD=zeros(3_d, _d))
else
(x_pred=copy(x_curr_psd),
G1=IsometricKroneckerProduct(K, zeros(_d, _d)),
C_DxD=IsometricKroneckerProduct(K, zeros(_d, _d)),
C_2DxD=IsometricKroneckerProduct(K, zeros(2_d, _d)),
C_3DxD=IsometricKroneckerProduct(K, zeros(3_d, _d)))
G1=IsometricKroneckerProduct(K, zeros(_d, _d)),
C_DxD=IsometricKroneckerProduct(K, zeros(_d, _d)),
C_2DxD=IsometricKroneckerProduct(K, zeros(2_d, _d)),
C_3DxD=IsometricKroneckerProduct(K, zeros(3_d, _d)))
end
ProbNumDiffEq.smooth!(
x_curr_psd,
Expand Down
29 changes: 22 additions & 7 deletions test/state_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,32 @@ import ODEProblemLibrary: prob_ode_fitzhughnagumo, prob_ode_pleiades
end

@testset "Low-order exact init via ClassiSolverInit: `initial_update!`" begin
@test_nowarn init(prob, EK0(order=1, initialization=ClassicSolverInit(init_on_ddu=true)))
@test_nowarn init(prob, EK0(order=2, initialization=ClassicSolverInit(init_on_ddu=false)))
@test_broken init(prob, EK0(order=2, initialization=ClassicSolverInit(init_on_ddu=true)))
@test_nowarn init(
prob,
EK0(order=1, initialization=ClassicSolverInit(init_on_ddu=true)),
)
@test_nowarn init(
prob,
EK0(order=2, initialization=ClassicSolverInit(init_on_ddu=false)),
)
@test_broken init(
prob,
EK0(order=2, initialization=ClassicSolverInit(init_on_ddu=true)),
)

@test_nowarn init(prob, EK1(order=1, initialization=ClassicSolverInit(init_on_ddu=true)))
@test_nowarn init(prob, EK1(order=2, initialization=ClassicSolverInit(init_on_ddu=true)))
@test_nowarn init(
prob,
EK1(order=1, initialization=ClassicSolverInit(init_on_ddu=true)),
)
@test_nowarn init(
prob,
EK1(order=2, initialization=ClassicSolverInit(init_on_ddu=true)),
)
integ =
init(prob, EK1(order=2, initialization=ClassicSolverInit(init_on_ddu=true)))
ProbNumDiffEq.initial_update!(integ, integ.cache, integ.alg.initialization)
x = integ.cache.x
@test reshape(x.μ, :, 2)'[:] true_init_states[1:(2+1)*d]

end
end

Expand All @@ -77,7 +91,8 @@ end
Proj1 = integ1.cache.Proj

@testset "Order $o" for o in (1, 2, 3, 4, 5)
integ2 = init(prob, EK1(order=o, initialization=ClassicSolverInit(init_on_ddu=true)))
integ2 =
init(prob, EK1(order=o, initialization=ClassicSolverInit(init_on_ddu=true)))
rk_init = integ2.cache.x.μ
Proj2 = integ2.cache.Proj

Expand Down

0 comments on commit 2fc434f

Please sign in to comment.