Skip to content

Commit

Permalink
wrap preconditioner in Diagonal
Browse files Browse the repository at this point in the history
  • Loading branch information
filtron committed Oct 18, 2023
1 parent 5ff2c04 commit 3b33542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/iwp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function transition_matrix_1d(ndiff::Integer, dt::T, ::ReverseTaylor) where {T<:
end


precond(ndiff::Integer, dt::Real, ::ReverseTaylor) = @. sqrt(dt) * dt^(0:ndiff) / factorial(0:ndiff)
precond(ndiff::Integer, dt::Real, ::ReverseTaylor) = Diagonal(@. sqrt(dt) * dt^(0:ndiff) / factorial(0:ndiff))

function transition_matrix_precond_1d(ndiff::Integer, T, ::ReverseTaylor)
Φ = zeros(T, ndiff + one(ndiff), ndiff + one(ndiff))
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ using Test
Φbreve = IntegratedWienerProcesses.transition_matrix_precond_1d(ndiff, Float64, ReverseTaylor())
Lbreve = IntegratedWienerProcesses.transition_cov_cholf_precond_1d(ndiff, Float64, ReverseTaylor())

@test Φ Diagonal(prec) * Φbreve / Diagonal(prec)
@test L Diagonal(prec) * Lbreve
@test Φ prec * Φbreve / prec
@test L prec * Lbreve
end
end

Expand Down

0 comments on commit 3b33542

Please sign in to comment.