Skip to content

Commit 49bd2b3

Browse files
fix runic formatting
1 parent f531e5f commit 49bd2b3

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/plans/conjugate_gradient_plan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ Construct the hybrid coefficient update rule.
10621062
10631063
[`HybridCoefficient`](@ref), [`conjugate_gradient_descent`](@ref)
10641064
"""
1065-
struct HybridCoefficientRule{N} <: DirectionUpdateRule where N
1065+
struct HybridCoefficientRule{N} <: DirectionUpdateRule where {N}
10661066
coefficients::NTuple{N, DirectionUpdateRuleStorage}
10671067
lower_bound::DirectionUpdateRuleStorage
10681068
lower_bound_scale::Real
@@ -1090,7 +1090,7 @@ function (u::DirectionUpdateRuleStorage{<:HybridCoefficientRule})(
10901090
return max(u.coefficient.lower_bound_scale * β_lower_bound, min(βs...))
10911091
end
10921092
function show(io::IO, u::HybridCoefficientRule)
1093-
coefficient_str = join([repr(c.coefficient) for c = u.coefficients], ", ")
1093+
coefficient_str = join([repr(c.coefficient) for c in u.coefficients], ", ")
10941094
return print(
10951095
io,
10961096
"Manopt.HybridCoefficientRule(coefficients=($coefficient_str)),lower_bound=$(repr(u.lower_bound.coefficient)),lower_bound_scale=$(u.lower_bound_scale))",

test/plans/test_conjugate_gradient_plan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Manopt.update_rule_storage_vectors(::DummyCGCoeff) = Tuple{}
6363
@test cgbr.threshold == cgbr.threshold
6464
@test repr(LiuStoreyCoefficient(M)()) ==
6565
"Manopt.LiuStoreyCoefficientRule(; vector_transport_method=$pt)"
66-
@test repr(HybridCoefficient(PolakRibiereCoefficient(), FletcherReevesCoefficient())(M)) ==
66+
@test repr(HybridCoefficient(PolakRibiereCoefficient(), FletcherReevesCoefficient())(M)) ==
6767
"Manopt.HybridCoefficientRule(coefficients=(Manopt.PolakRibiereCoefficientRule(; vector_transport_method=$(pt)), Manopt.FletcherReevesCoefficientRule())),lower_bound=Manopt.SteepestDescentCoefficientRule(),lower_bound_scale=1.0)"
6868
end
6969
end

test/solvers/test_conjugate_gradient.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ using LinearAlgebra: Diagonal, dot, eigvals, eigvecs
164164
s8.δ = δ2
165165
@test s8.coefficient(dmp, s8, 2) == dot(grad_2, diff) / dot(grad_1, grad_1)
166166

167-
dU = HybridCoefficient(PolakRibiereCoefficient(),FletcherReevesCoefficient())
167+
dU = HybridCoefficient(PolakRibiereCoefficient(), FletcherReevesCoefficient())
168168
s9 = ConjugateGradientDescentState(
169169
M;
170170
p = x0,
@@ -179,8 +179,10 @@ using LinearAlgebra: Diagonal, dot, eigvals, eigvecs
179179
@test s9.coefficient(dmp, s9, 1) == 0.0 #max(0.0, min(0.0, 1.0))
180180
s9.X = grad_2
181181
s9.δ = δ2
182-
@test s9.coefficient(dmp, s9, 2) == max(0.0,
183-
min(dot(grad_2, diff) / dot(grad_1, grad_1),dot(grad_2, grad_2) / dot(grad_1, grad_1)))
182+
@test s9.coefficient(dmp, s9, 2) == max(
183+
0.0,
184+
min(dot(grad_2, diff) / dot(grad_1, grad_1), dot(grad_2, grad_2) / dot(grad_1, grad_1))
185+
)
184186

185187
end
186188
@testset "Conjugate Gradient runs – Low Rank matrix approx" begin

0 commit comments

Comments
 (0)