Skip to content

Commit

Permalink
Update MarkovProcess.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugomez committed Jun 19, 2024
1 parent f36bad5 commit 3d0c8b3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/MarkovProcess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

2 comments on commit 3d0c8b3

@matthieugomez
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109352

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.2.0 -m "<description of version>" 3d0c8b37eb3c1c1762c6a0daf0455f821a8d89d1
git push origin v2.2.0

Please sign in to comment.