Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix solve_exp_ode not updating position #748

Merged
merged 4 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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)]

Check warning on line 64 in ext/ManifoldsOrdinaryDiffEqExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/ManifoldsOrdinaryDiffEqExt.jl#L64

Added line #L64 was not covered by tests
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
Loading