Skip to content

Commit 3438a63

Browse files
committed
solvers / codecov ++
1 parent a908781 commit 3438a63

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/plans/count.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function ManifoldCountObjective(
6060
end
6161
# Store the undecorated type of the input is decorated
6262
function ManifoldCountObjective(
63-
::AbstractManifold, objective::O, counts::Dict{Symbol, I}
63+
objective::O, counts::Dict{Symbol, I}
6464
) where {
6565
E <: AbstractEvaluationType,
6666
I <: Union{<:Integer, AbstractVector{<:Integer}},

src/solvers/quasi_Newton.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ function get_message(qns::QuasiNewtonState)
134134
return d
135135
end
136136
function Base.show(io::IO, qns::QuasiNewtonState)
137-
print(io, "QuasiNewtonState(;")
138-
print(io, "direction_update = $(qns.direction_update), ")
139-
print(io, "p = ", qns.p, ", p_old = ", qns.p_old, ", η = ", qns.η, ", X = ", qns.X, ", sk = ", qns.sk, ", yk = ", qns.yk, ", ")
137+
print(io, "QuasiNewtonState(; ")
138+
print(io, "direction_update = ", qns.direction_update, ", p = ", qns.p, ", p_old = ", qns.p_old)
139+
print(io, ", η = ", qns.η, ", X = ", qns.X, ", sk = ", qns.sk, ", yk = ", qns.yk, ", ")
140140
print(io, "nondescent_direction_behavior = ", qns.nondescent_direction_behavior, ", nondescent_direction_value = ", qns.nondescent_direction_value, ", ")
141141
print(io, "preconditioner = ", qns.preconditioner, ", retraction_method = ", qns.retraction_method, ", stepsize = ", qns.stepsize, ", ")
142-
print(io, "stopping_criertion = ". qns.stop, ", X_old = ", qns.X_old, ", vector_transport_method = ", qns.vector_transport_method)
142+
print(io, "stopping_critertion = ", qns.stop, ", X_old = ", qns.X_old, ", vector_transport_method = ", qns.vector_transport_method)
143143
return print(io, ")")
144144
end
145145
function status_summary(qns::QuasiNewtonState; context::Symbol = :default)

test/solvers/test_convex_bundle_method.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ using Manopt: estimate_sectional_curvature
4141
stepsize = Manopt.DomainBackTrackingStepsize(M; contraction_factor = 0.975),
4242
stopping_criterion = StopAfterIteration(200),
4343
)
44+
# A state can not be created with just a manifold and a substate, then the problem is missing
45+
@test_throws ErrorException ConvexBundleMethodState(M, Manopt.Test.DummyState())
4446
@test get_iterate(cbms) == p0
4547
cbms.X = [1.0, 0.0, 0.0, 0.0, 0.0]
4648

test/solvers/test_quasi_Newton.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,8 @@ end
5757
@test norm(x_lrbfgs - x_solution) 0 atol = 10.0^(-14)
5858
# with State
5959
lrbfgs_s = quasi_Newton(
60-
M,
61-
f,
62-
grad_f,
63-
p;
64-
stopping_criterion = StopWhenGradientNormLess(10^(-6)),
65-
return_state = true,
66-
debug = [],
60+
M, f, grad_f, p;
61+
stopping_criterion = StopWhenGradientNormLess(10^(-6)), return_state = true, debug = [],
6762
)
6863
# Verify that Newton update direction works also allocating
6964
dmp = DefaultManoptProblem(M, ManifoldGradientObjective(f, grad_f))
@@ -76,6 +71,7 @@ end
7671
Manopt.status_summary(lrbfgs_s; context = :default),
7772
"# Solver state for `Manopt.jl`s Quasi Newton Method\n"
7873
)
74+
@test startswith(repr(lrbfgs_s), "QuasiNewtonState(; ")
7975
@test get_last_stepsize(dmp, lrbfgs_s, lrbfgs_s.stepsize) > 0
8076
@test Manopt.get_iterate(lrbfgs_s) == x_lrbfgs
8177
set_gradient!(lrbfgs_s, M, p, grad_f(M, p))

0 commit comments

Comments
 (0)