Skip to content

Commit

Permalink
Merge e1bcd9f into d435a0b
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaxen committed Nov 5, 2020
2 parents d435a0b + e1bcd9f commit 979973a
Show file tree
Hide file tree
Showing 4 changed files with 459 additions and 99 deletions.
6 changes: 3 additions & 3 deletions src/integrator.jl
Expand Up @@ -60,13 +60,13 @@ function step(
h::Hamiltonian,
z::P,
n_steps::Int=1;
fwd::Bool=n_steps > 0, # simulate hamiltonian backward when n_steps < 0
fwd::Union{Bool,AbstractVector{Bool}}=n_steps > 0, # simulate hamiltonian backward when n_steps < 0
full_trajectory::Val{FullTraj} = Val(false)
) where {T<:AbstractScalarOrVec{<:AbstractFloat}, P<:PhasePoint, FullTraj}
n_steps = abs(n_steps) # to support `n_steps < 0` cases

ϵ = fwd ? step_size(lf) : -step_size(lf)
ϵ = ϵ'
ϵ = step_size(lf)
ϵ = ifelse.(fwd, ϵ, .-ϵ)'

res = if FullTraj
Vector{P}(undef, n_steps)
Expand Down

0 comments on commit 979973a

Please sign in to comment.