Skip to content

Commit

Permalink
Fix solve_exp_ode not updating position (#748)
Browse files Browse the repository at this point in the history
* Fix  solve_exp_ode doc string

Fixes #740

* Implement failing test for #744

* Fix`solve_exp_ode` does not ever update position #744

* Add changelog entry
  • Loading branch information
r0uv3n authored Sep 15, 2024
1 parent 11f0a6c commit 43b6990
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.3] - unreleased

* Fixed `solve_exp_ode` only returning the starting position ([#744](https://github.com/JuliaManifolds/Manifolds.jl/issues/744))
* Fixed documentation of `solve_exp_ode` function signature ([#740](https://github.com/JuliaManifolds/Manifolds.jl/issues/740))

## [0.10.2] - unreleased

### Changed
Expand Down
2 changes: 1 addition & 1 deletion ext/ManifoldsOrdinaryDiffEqExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function solve_exp_ode(
params = (M,)
prob = ODEProblem(exp_problem, u0, (0.0, t), params)
sol = solve(prob, solver; kwargs...)
q = sol.u[1][(n + 1):(2 * n)]
q = sol.u[end][(n + 1):(2 * n)]
return q
end
# also define exp! for metric manifold anew in this case
Expand Down
4 changes: 2 additions & 2 deletions src/manifolds/ConnectionManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ function solve_exp_ode end
M::ConnectionManifold,
p,
X,
t::Number,
B::AbstractBasis;
t::Number;
B::AbstractBasis = DefaultOrthonormalBasis(),
backend::AbstractDiffBackend = default_differential_backend(),
solver = AutoVern9(Rodas5()),
kwargs...,
Expand Down
17 changes: 17 additions & 0 deletions test/metric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,23 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p,
N2 = ConnectionManifold(E, TestConnection())
@test exp(N2, p, X) == X
end

# see also Issue #744 (https://github.com/JuliaManifolds/Manifolds.jl/issues/744)
@testset "solve_exp_ode values" begin
E = TestEuclidean{3}()
g = TestEuclideanMetric()
g_scaled = TestScaledEuclideanMetric()
M = MetricManifold(E, g)
default_retraction_method(::TestEuclidean) = TestRetraction()
p = [1.0, 2.0, 3.0]
X = [2.0, 3.0, 4.0]
t = 2.5

# we're testing on a flat euclidean space
@test exp(M, p, X) p + X
@test exp(M, p, X, t) p + t * X
end

@testset "Local Metric Error message" begin
M = MetricManifold(BaseManifold{2}(), NotImplementedMetric())
A = Manifolds.get_default_atlas(M)
Expand Down

0 comments on commit 43b6990

Please sign in to comment.