Skip to content

Commit 8cb058b

Browse files
ConvexOptimization: depend on released SciMLBase 3.36; unify onto OptimizationSolution
SciMLBase v3.36.0 registers ConvexOptimizationProblem and folds the convex solution into the single OptimizationSolution (with a type-stable `dual` field), removing ConvexOptimizationSolution. So: - Drop the temporary [sources] git-rev to the SciMLBase #1440 branch and bump the compat floor to SciMLBase = "3.36" (the release carrying the types). - Use OptimizationSolution instead of ConvexOptimizationSolution in the backend and its test; the solve already returns the one struct with duals populated (build_convex_solution defaults calculate_dual = Val(true)). Verified against released SciMLBase 3.36.0: resolves, LP/SOC solves return correct primal + dual, non-convex objective rejected; all core tests pass. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 03c5cee commit 8cb058b

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

lib/ConvexOptimization/Project.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1313
SymbolicAnalysis = "4297ee4d-0239-47d8-ba5d-195ecdf594fe"
1414
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1515

16-
# Temporary: ConvexOptimizationProblem/Solution are unreleased (SciML/SciMLBase.jl#1440).
17-
# Drop this [sources] once a SciMLBase with those types is registered.
18-
[sources]
19-
SciMLBase = {url = "https://github.com/ChrisRackauckas-Claude/SciMLBase.jl", rev = "convex-optimization-problem"}
20-
2116
[compat]
2217
Clarabel = "0.10, 0.11"
2318
LinearAlgebra = "1.10"
2419
MathOptInterface = "1.45"
2520
Reexport = "1.2"
26-
SciMLBase = "3"
21+
SciMLBase = "3.36"
2722
SparseArrays = "1.10"
2823
SymbolicAnalysis = "0.3"
2924
Symbolics = "7"

lib/ConvexOptimization/src/ConvexOptimization.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module ConvexOptimization
22

33
using Reexport
44
@reexport using SciMLBase
5-
using SciMLBase: ConvexOptimizationProblem, ConvexOptimizationSolution,
5+
using SciMLBase: ConvexOptimizationProblem, OptimizationSolution,
66
OptimizationFunction, AbstractOptimizationCache, AbstractOptimizationAlgorithm,
77
NullParameters, ReturnCode
88
import MathOptInterface as MOI
@@ -21,8 +21,8 @@ returns the affine map whose image must lie in the MathOptInterface vector cone
2121
…). The output length of `g` must equal `MOI.dimension(set)`.
2222
2323
The backend traces `g` on its own symbolic variables, so each `ConeConstraint`
24-
maps to exactly one MOI constraint and therefore one entry of
25-
`ConvexOptimizationSolution.dual`, in the order the constraints are given.
24+
maps to exactly one MOI constraint and therefore one entry of the returned
25+
`OptimizationSolution.dual`, in the order the constraints are given.
2626
Because the cone is named explicitly, the returned dual is already expressed in
2727
the user's variables (no sign remap): `>=` → `MOI.Nonnegatives`, `<=` →
2828
`MOI.Nonpositives`, `==` → `MOI.Zeros`.

lib/ConvexOptimization/test/core_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ConvexOptimization
22
using SciMLBase
3-
using SciMLBase: ConvexOptimizationProblem, ConvexOptimizationSolution
3+
using SciMLBase: ConvexOptimizationProblem, OptimizationSolution
44
import MathOptInterface as MOI
55
import Clarabel
66
using Test
@@ -20,7 +20,7 @@ c = [1.0, 2.0]
2020

2121
sol = solve(prob, ConvexMOI(Clarabel.Optimizer))
2222

23-
@test sol isa ConvexOptimizationSolution
23+
@test sol isa OptimizationSolution
2424
@test SciMLBase.successful_retcode(sol.retcode)
2525
@test isapprox(sol.u, [1.0, 0.0]; atol = 1.0e-6)
2626
@test isapprox(sol.objective, 1.0; atol = 1.0e-6)

0 commit comments

Comments
 (0)