Skip to content

Commit

Permalink
Add a test for the new factory.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Dec 30, 2024
1 parent fe5d1c6 commit 85c1a64
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/plans/test_nonlinear_least_squares_plan.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Manifolds, Manopt, Test

@testset "Nonlinear lest squares plane" begin
@testset "Test cost/residual/jacobian cases with smoothing" begin end
@testset "Smootthing factory" begin
s1 = Manopt.smoothing_factory(:Identity)
@test s1 isa ManifoldHessianObjective

s2 = Manopt.smoothing_factory((:Identity, 2))
@test s2 isa VectorHessianFunction
@test length(s2) == 2

s3 = Manopt.smoothing_factory((:Identity, 3.0))
@test s3 isa ManifoldHessianObjective

for s in [:Arctan, :Cauchy, :Huber, :SoftL1, :Tukey]
s4 = Manopt.smoothing_factory(s)
@test s4 isa ManifoldHessianObjective
end

s5 = Manopt.smoothing_factory(((:Identity, 2), (:Huber, 3)))
@test s5 isa VectorHessianFunction
@test length(s5) == 5
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include("utils/example_tasks.jl")
include("plans/test_conjugate_residual_plan.jl")
include("plans/test_interior_point_newton_plan.jl")
include("plans/test_nelder_mead_plan.jl")
include("plans/test_nonlinear_least_squares_plan.jl")
include("plans/test_gradient_plan.jl")
include("plans/test_constrained_plan.jl")
include("plans/test_hessian_plan.jl")
Expand Down

0 comments on commit 85c1a64

Please sign in to comment.