Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Penopt"
uuid = "fb8f6f4e-b8f1-11e9-2b95-bdba3fec731e"
authors = ["Michal Kocvara <kocvara@penopt.com>", "Benoît Legat <benoit.legat@gmail.com>", "Michael Stingl <mstingl@penopt.com>"]
version = "0.1.0"
version = "0.2.0"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Pennon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,17 @@ 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
their derivatives are supplied to PENNON by MOI's sparse reverse-mode AD.
"""
const Optimizer = Penopt.PennonOptimizer

end # module Pennon
end # module NON
2 changes: 1 addition & 1 deletion src/Penopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions test/pennon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()) ==
Expand Down Expand Up @@ -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])
Expand Down
Loading