Skip to content

Commit e62cd48

Browse files
committed
add a test for scaling mode
1 parent e7fefcd commit e62cd48

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

test/solvers/test_Levenberg_Marquardt.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using ManifoldDiff, Manifolds, Manopt, Test, RecursiveArrayTools
3838
function_type = FunctionVectorialType(), jacobian_type = FunctionVectorialType(),
3939
)
4040
p1 = [0.0, 0.0]
41-
# Interfacve I: Functions
41+
# Interface I: Functions
4242
r1a1 = LevenbergMarquardt(
4343
M1, F1, JF1, p1, m;
4444
function_type = FunctionVectorialType(), jacobian_type = FunctionVectorialType()
@@ -333,6 +333,19 @@ using ManifoldDiff, Manifolds, Manopt, Test, RecursiveArrayTools
333333
# using ManifoldMakie
334334
# scatter(M2, ps); geodesics!(M2, geob); geodesics!(M2, geoa);
335335
# the first curve (same color as points) should hit the end points, the second is “skewed”
336+
337+
@testset "mode selection" begin
338+
(o2_ns, s2_ns) = LevenbergMarquardt(
339+
TM2, vgf2, P0;
340+
robustifier = 1.0e-4 HuberRobustifier(), return_objective = true, return_state = true,
341+
retraction_method = StabilizedRetraction(default_retraction_method(TM2)),
342+
scaling_mode = :Normal,
343+
)
344+
@test isapprox(TM2, s2.p, s2_ns.p; atol = 1.0e-2)
345+
# due to different scaling they should be a bit different
346+
@test !isapprox(TM2, s2.p, s2_ns.p; atol = 1.0e-8)
347+
end
348+
336349
@testset "Block Robust Geodesic Regression on the Sphere" begin
337350
# We group the 4 points from before into start/end (nonrobust) and middle (robust)
338351
b1 = [1, 4]; m1 = length(b1)

0 commit comments

Comments
 (0)