Skip to content

Commit 6edc099

Browse files
sblelongkellertuer
andauthored
Cast max_stepsize in Mesh Adaptive Direct Seach (#526) (#527)
* Cast max_stepsize in Mesh Adaptive Direct Seach (#526) * Format code and update Changelog.md * Update test/solvers/test_mesh_adaptive_direct_search.jl * Update Manifolds.jl dependency to v11.0.2 --------- Co-authored-by: Ronny Bergmann <git@ronnybergmann.net>
1 parent 837bb31 commit 6edc099

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
* fixed a few typos in the documentation strings of a few solvers.
1414
* fixed a typo in the documentation of `LevenbergMarquardt`.
1515
* fixed a bug in an internal tex command to print sums in the documentation.
16+
* fixed the use of `mesh_adaptive_direct_search` on manifolds with irrational injectivity radius.
1617
* improved the `CONTRIBUTING.md` to reflect the new code formatter we use, as mentioned in (#527).
1718

1819
## [0.5.25] October 9, 2025

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ LRUCache = "1.4"
5050
LineSearches = "7.2.0"
5151
LinearAlgebra = "1.10"
5252
ManifoldDiff = "0.3.8, 0.4"
53-
Manifolds = "0.10, 0.11"
53+
Manifolds = "0.11.2"
5454
ManifoldsBase = "1.1, 2"
5555
Markdown = "1.10"
5656
Plots = "1.30"

src/solvers/mesh_adaptive_direct_search.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function mesh_adaptive_direct_search!(
9696
p;
9797
mesh_basis = mesh_basis,
9898
scale_mesh = scale_mesh,
99-
max_stepsize = max_stepsize,
99+
max_stepsize = oftype(scale_mesh, max_stepsize),
100100
stopping_criterion = stopping_criterion,
101101
retraction_method = retraction_method,
102102
vector_transport_method = vector_transport_method,

test/solvers/test_mesh_adaptive_direct_search.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ using Manifolds, Manopt, Test, LinearAlgebra, Random
3434
p_s2 = mesh_adaptive_direct_search!(M2, f2, p1; scale_mesh = 0.1)
3535
@test isapprox(M, p_s2, p1)
3636
@test distance(M2, p_s2, W2) < 1.0e-7
37+
#
38+
#
39+
# An example on a sphere (to ensure type coherence between injectivity radii)
40+
M3 = Sphere(2)
41+
f3(M, p) = sum(p)
42+
p2 = [-1.0, 0.0, 0.0]
43+
s3 = mesh_adaptive_direct_search(M3, f3, p2; return_state = true)
44+
p3 = get_solver_result(s3)
45+
@test f3(M3, p3) < f3(M3, p2)
46+
@test is_point(M3, p3; error = :error)
3747
end

0 commit comments

Comments
 (0)