Commit c995346
Register eigmax/eigmin as symbolic matrix atoms
eigmax(X)/eigmin(X) on a symbolic matrix crashed with
"MethodError: no method matching eigvals!(::Matrix{Num})": they have DCP
rules (symmetric_domain(), Convex/Concave) but, unlike logdet and
eigsummax, no @register_symbolic, so the call fell through to numeric
LinearAlgebra.eigmax and tried to compute eigenvalues of a Matrix{Num}.
Register both for Matrix{Num} so the call builds an unevaluated symbolic
atom and the existing rules fire. This also repairs the previously-broken
gDCP eigmax path (add_gdcprule with no backing registration). Collision-
safe: eigmax/eigmin return a scalar and a symbolic is not <: Number, so
no BasicSymbolic{SymReal} scalar method is overwritten (hasmethod goes
false->true, purely additive) — the same pattern as logdet/eigsummax.
Verified: clean from-disk precompile, eigmax(X)->Convex, eigmin(X)->
Concave, numeric eigmax/eigmin unchanged.
Part of #121.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7d44d89 commit c995346
3 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
0 commit comments