Skip to content

Commit

Permalink
chore: add warning for using generalized leapfrog with vectorization
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Xu <[email protected]>
  • Loading branch information
Kai Xu committed Jul 23, 2024
1 parent 62b4ede commit 5462aad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/riemannian/integrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ function step(
n_steps::Int = 1;
fwd::Bool = n_steps > 0, # simulate hamiltonian backward when n_steps < 0
full_trajectory::Val{FullTraj} = Val(false),
) where {T<:AbstractScalarOrVec{<:AbstractFloat},P<:PhasePoint,FullTraj}
) where {T<:AbstractScalarOrVec{<:AbstractFloat},P<:PhasePoint{TP},FullTraj,TP}
n_steps = abs(n_steps) # to support `n_steps < 0` cases

ϵ = fwd ? step_size(lf) : -step_size(lf)
ϵ = ϵ'

if !(T <: AbstractFloat) || !(TP <: AbstractVector)
@warn "Vectorization is not tested for GeneralizedLeapfrog."
end

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

0 comments on commit 5462aad

Please sign in to comment.