Skip to content

Commit 7ca0378

Browse files
committed
provide a proper test + formatting
1 parent 90043b3 commit 7ca0378

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/plans/conjugate_gradient_plan.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,16 +438,16 @@ $(_kwargs(:vector_transport_method))
438438
439439
[`HagerZhangCoefficient`](@ref), [`conjugate_gradient_descent`](@ref)
440440
"""
441-
mutable struct HagerZhangCoefficientRule{VTM <: AbstractVectorTransportMethod, TF<:Real} <:
441+
mutable struct HagerZhangCoefficientRule{VTM <: AbstractVectorTransportMethod, TF <: Real} <:
442442
DirectionUpdateRule
443443
vector_transport_method::VTM
444444
denom_threshold::TF
445445
end
446446
function HagerZhangCoefficientRule(
447447
M::AbstractManifold; vector_transport_method::VTM = default_vector_transport_method(M),
448-
denom_threshold::TF = 1e-10,
448+
denom_threshold::TF = 1.0e-10,
449449
) where {VTM <: AbstractVectorTransportMethod, TF <: Real}
450-
return HagerZhangCoefficientRule{VTM,TF}(vector_transport_method, denom_threshold)
450+
return HagerZhangCoefficientRule{VTM, TF}(vector_transport_method, denom_threshold)
451451
end
452452

453453
update_rule_storage_points(::HagerZhangCoefficientRule) = Tuple{:Iterate}
@@ -486,7 +486,7 @@ function (u::DirectionUpdateRuleStorage{<:HagerZhangCoefficientRule})(
486486
else
487487
coef = zero(eltype(denom))
488488
end
489-
489+
490490

491491
update_storage!(u.storage, amp, cgs)
492492
return coef

test/solvers/test_conjugate_gradient.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,6 @@ using ManifoldDiff: grad_distance
422422
coefficient = ConjugateGradientBealeRestart(HagerZhangCoefficient()),
423423
return_state = true,
424424
)
425-
@test
425+
@test norm(M, cgs.p, grad_f(M, cgs.p)) < 1.0e-8
426426
end
427427
end

0 commit comments

Comments
 (0)