Skip to content

Commit b2aac13

Browse files
Remove dead code in the DGCP geodesic-curvature engine
Two behavior-preserving removals in find_gcurvature, verified against test/dgp.jl + test/lorentz.jl (unchanged pass): - Delete the unreachable `elseif f_curvature == Affine` branch. The chain opens with `f_curvature == Convex || f_curvature == Affine`, which catches every Affine atom first, so the later Affine block can never run; the `|| f_curvature == Affine` on the Concave branch is dead for the same reason and is dropped. - Delete the duplicate `add_gdcprule(diag, SPD, ...)` in spd.jl. It is identical to the `add_gdcprule(LinearAlgebra.diag, ...)` registration (diag === LinearAlgebra.diag) and, since gdcprules_dict is keyed by function, only overwrote it with the same value. The always-false `sum_log_eigmax` comparison and the (behaviorally inert) distance manifold-key collision are left untouched and flagged in the PR for an intent decision. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7d44d89 commit b2aac13

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

src/gdcp/gdcp_rules.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function find_gcurvature(ex)
204204
else
205205
return GUnknownCurvature
206206
end
207-
elseif f_curvature == Concave || f_curvature == Affine
207+
elseif f_curvature == Concave
208208
if all(enumerate(args)) do (i, arg)
209209
arg_curv = find_gcurvature(arg)
210210
m = f_monotonicity[i]
@@ -220,15 +220,6 @@ function find_gcurvature(ex)
220220
else
221221
return GUnknownCurvature
222222
end
223-
elseif f_curvature == Affine
224-
if all(enumerate(args)) do (i, arg)
225-
arg_curv = find_gcurvature(arg)
226-
arg_curv == GLinear
227-
end
228-
return GLinear
229-
else
230-
return GUnknownCurvature
231-
end
232223
elseif f_curvature isa GCurvature
233224
return f_curvature
234225
else

src/gdcp/spd.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ add_gdcprule(log_quad_form, SymmetricPositiveDefinite, Positive, GConvex, GIncre
190190

191191
add_gdcprule(inv, SymmetricPositiveDefinite, Positive, GConvex, GDecreasing)
192192

193-
add_gdcprule(diag, SymmetricPositiveDefinite, Positive, GConvex, GIncreasing)
194-
195193
# Matrix `log` (both `Arr` and `Matrix{Num}` forms) is defined in atoms.jl via
196194
# `matrix_atom`; the `@register_array_symbolic` form collides with SymbolicUtils'
197195
# scalar `log` on Symbolics v7 (see the note there).

0 commit comments

Comments
 (0)