From 31d8c77ab3d284887f580ec1cf0d919b39dc85b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 5 Oct 2026 13:18:15 +0200 Subject: [PATCH 1/2] Rename Penopt.Pennon to Penopt.NON for consistency --- README.md | 15 +++++++++++++-- src/Pennon.jl | 6 +++--- src/Penopt.jl | 2 +- test/pennon.jl | 6 +++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a26fde0..3251ee7 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ PENNON shared library or static archive, re-running `Pkg.build("Penopt")`, and restarting Julia, as for PENBMI. Availability is reported by `Penopt.has_pennon()`. -`Penopt.Pennon.Optimizer` accepts nonlinear scalar objectives and constraints, +`Penopt.NON.Optimizer` accepts nonlinear scalar objectives and constraints, and accepts nonlinear semidefinite constraints as an `MOI.VectorNonlinearFunction` in an `MOI.PositiveSemidefiniteConeTriangle`. Derivatives are evaluated with MOI's @@ -80,7 +80,7 @@ session. Pick the solver explicitly: `Penopt.SDP.Optimizer` solves semidefinite programs with PENSDP, `Penopt.BMI.Optimizer` solves bilinear matrix inequalities and -quadratic objectives with PENBMI, and `Penopt.Pennon.Optimizer` solves general +quadratic objectives with PENBMI, and `Penopt.NON.Optimizer` solves general nonlinear semidefinite programs with PENNON. ```julia @@ -100,6 +100,17 @@ natively by `Penopt.BMI.Optimizer`: model = Model(Penopt.BMI.Optimizer) ``` +For general nonlinear objectives, scalar constraints, and matrix inequalities, +use the PENNON backend: + +```julia +model = Model(Penopt.NON.Optimizer) +``` + +Enable the PENNON library as described in [PENNON](#pennon) above. MOI bridges +automatically convert affine and quadratic functions to nonlinear functions, +so JuMP expressions do not need explicit nonlinear conversion. + ## Options See the [Penbmi Documentation](http://www.penopt.com/doc/penbmi2_1.pdf) diff --git a/src/Pennon.jl b/src/Pennon.jl index 8af8e70..30650de 100644 --- a/src/Pennon.jl +++ b/src/Pennon.jl @@ -503,12 +503,12 @@ function MOI.get(model::PennonOptimizer, attr::MOI.PrimalStatus) return model.info == 0 ? MOI.FEASIBLE_POINT : MOI.UNKNOWN_RESULT_STATUS end -module Pennon +module NON import ..Penopt """ - Penopt.Pennon.Optimizer() + Penopt.NON.Optimizer() Optimizer for nonlinear semidefinite programs. Matrix constraints are accepted as `MOI.VectorNonlinearFunction`-in-`MOI.PositiveSemidefiniteConeTriangle` and @@ -516,4 +516,4 @@ their derivatives are supplied to PENNON by MOI's sparse reverse-mode AD. """ const Optimizer = Penopt.PennonOptimizer -end # module Pennon +end # module NON diff --git a/src/Penopt.jl b/src/Penopt.jl index 44311ad..a4f48a8 100644 --- a/src/Penopt.jl +++ b/src/Penopt.jl @@ -33,7 +33,7 @@ has_penbmi() = !isempty(libpenbmi) """ has_pennon() -Return whether the PENNON library used by [`Penopt.Pennon.Optimizer`](@ref) was +Return whether the PENNON library used by [`Penopt.NON.Optimizer`](@ref) was found by `Pkg.build("Penopt")`. """ has_pennon() = !isempty(libpennon) diff --git a/test/pennon.jl b/test/pennon.jl index 64065ab..b7a64b6 100644 --- a/test/pennon.jl +++ b/test/pennon.jl @@ -12,13 +12,13 @@ import MathOptInterface as MOI import Penopt function _model() - model = Model(Penopt.Pennon.Optimizer) + model = Model(Penopt.NON.Optimizer) set_silent(model) return model end function test_interface() - model = Penopt.Pennon.Optimizer() + model = Penopt.NON.Optimizer() @test MOI.get(model, MOI.SolverName()) == "Pennon" @test MOI.supports_incremental_interface(model) @test MOI.get(model, MOI.Bridges.ListOfNonstandardBridges{Float64}()) == @@ -68,7 +68,7 @@ function test_interface() end function test_scalar_constraint_dispatch() - model = Penopt.Pennon.Optimizer() + model = Penopt.NON.Optimizer() x = MOI.add_variable(model) @test MOI.get(model, MOI.NumberOfVariables()) == 1 f = MOI.ScalarNonlinearFunction(:sin, Any[x]) From fbca1869e89ffb8a915e05275d1716c953b3229b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 5 Oct 2026 13:19:28 +0200 Subject: [PATCH 2/2] Bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 98eb675..09aa327 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Penopt" uuid = "fb8f6f4e-b8f1-11e9-2b95-bdba3fec731e" authors = ["Michal Kocvara ", "BenoƮt Legat ", "Michael Stingl "] -version = "0.1.0" +version = "0.2.0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"