From 3d0c8b37eb3c1c1762c6a0daf0455f821a8d89d1 Mon Sep 17 00:00:00 2001 From: Matthieu Gomez Date: Wed, 19 Jun 2024 10:37:35 -0400 Subject: [PATCH] Update MarkovProcess.jl --- src/MarkovProcess.jl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/MarkovProcess.jl b/src/MarkovProcess.jl index 2900211..f126d93 100644 --- a/src/MarkovProcess.jl +++ b/src/MarkovProcess.jl @@ -60,19 +60,13 @@ state_space(X::DiffusionProcess) = X.x at the border of state space """ function generator(X::DiffusionProcess) - n = length(X.x) - 𝕋 = Tridiagonal(zeros(n-1), zeros(n), zeros(n-1)) - generator!(𝕋, X.x, X.μx, X.σx) + generator(X.x, X.μx, X.σx) end function generator(x::AbstractVector, μx::AbstractVector, σx::AbstractVector) - generator!(T, x, μx, σx) -end - -function generator!(𝕋, x::AbstractVector, μx::AbstractVector, σx::AbstractVector) # if you use this form, make sure that 𝕋 only has zero n = length(x) - fill!(𝕋, 0) + 𝕋 = Tridiagonal(zeros(n-1), zeros(n), zeros(n-1)) @inbounds for i in 1:n Δxp = x[min(i, n-1)+1] - x[min(i, n-1)] Δxm = x[max(i-1, 1) + 1] - x[max(i-1, 1)]