use crate::sde::ManifoldSDE;
use cartan_core::Manifold;
use pathwise_core::state::Increment;
pub struct GeodesicEuler;
impl GeodesicEuler {
pub fn step<M, D, G>(
&self,
sde: &ManifoldSDE<M, D, G>,
x: &M::Point,
t: f64,
dt: f64,
inc: &Increment<f64>,
) -> M::Point
where
M: Manifold,
D: Fn(&M::Point, f64) -> M::Tangent + Send + Sync,
G: Fn(&M::Point, f64) -> M::Tangent + Send + Sync,
{
let f = (sde.drift)(x, t);
let g = (sde.diffusion)(x, t);
let tangent = f * dt + g * inc.dw;
sde.manifold.exp(x, &tangent)
}
}