Skip to content

Commit 23c7b93

Browse files
committed
Update docs for ipopt
1 parent 99cf2b2 commit 23c7b93

File tree

5 files changed

+189
-3
lines changed

5 files changed

+189
-3
lines changed

docs/source/attribute/ipopt.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
### Supported [model attribute](#pyoptinterface.ModelAttribute)
2+
3+
:::{list-table}
4+
:header-rows: 1
5+
6+
* - Attribute
7+
- Get
8+
- Set
9+
* - Name
10+
-
11+
-
12+
* - ObjectiveSense
13+
-
14+
-
15+
* - DualStatus
16+
-
17+
-
18+
* - PrimalStatus
19+
-
20+
-
21+
* - RawStatusString
22+
-
23+
-
24+
* - TerminationStatus
25+
-
26+
-
27+
* - BarrierIterations
28+
-
29+
-
30+
* - DualObjectiveValue
31+
-
32+
-
33+
* - NodeCount
34+
-
35+
-
36+
* - NumberOfThreads
37+
-
38+
-
39+
* - ObjectiveBound
40+
-
41+
-
42+
* - ObjectiveValue
43+
-
44+
-
45+
* - RelativeGap
46+
-
47+
-
48+
* - Silent
49+
-
50+
-
51+
* - SimplexIterations
52+
-
53+
-
54+
* - SolverName
55+
-
56+
-
57+
* - SolverVersion
58+
-
59+
-
60+
* - SolveTimeSec
61+
-
62+
-
63+
* - TimeLimitSec
64+
-
65+
-
66+
:::
67+
68+
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
69+
70+
:::{list-table}
71+
:header-rows: 1
72+
73+
* - Attribute
74+
- Get
75+
- Set
76+
* - Value
77+
-
78+
-
79+
* - LowerBound
80+
-
81+
-
82+
* - UpperBound
83+
-
84+
-
85+
* - Domain
86+
-
87+
-
88+
* - PrimalStart
89+
-
90+
-
91+
* - Name
92+
-
93+
-
94+
:::
95+
96+
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
97+
98+
:::{list-table}
99+
:header-rows: 1
100+
101+
* - Attribute
102+
- Get
103+
- Set
104+
* - Name
105+
-
106+
-
107+
* - Primal
108+
-
109+
-
110+
* - Dual
111+
-
112+
-
113+
:::
114+

docs/source/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Changelog
22

33
## Unreleased
4+
5+
## 0.3.0
46
- Add `model.set_variable_bounds(variable, lb, ub)` to make it easier to change variable bounds
7+
- Introduce nonlinear programming support of Ipopt
8+
- Support new versions of optimizers
9+
- Various minor bug fixes
510

611
## 0.2.8
712
- Fix bugs in HiGHS and MOSEK when the quadratic objective function contains nondiagonal terms

docs/source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ gurobi.md
2323
copt.md
2424
mosek.md
2525
highs.md
26+
ipopt.md
2627
benchmark.md
2728
changelog.md
2829
```

docs/source/ipopt.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Ipopt
2+
3+
## Initial setup
4+
5+
```python
6+
from pyoptinterface import ipopt
7+
8+
model = ipopt.Model()
9+
```
10+
11+
You need to follow the instructions in [Getting Started](getting_started.md#ipopt) to set up the optimizer correctly.
12+
13+
:::{attention}
14+
15+
Due to the internal API design of Ipopt, the `ipopt.Model` lacks some features compared to other solvers. Some of these restrictions may be lifted in the future.
16+
17+
- It does not support `delete_variable` and `delete_constraint` methods.
18+
- It does not support incremental modification of linear constraint like `set_normalized_rhs` and `set_normalized_coefficient`.
19+
- It only supports to minimize the objective function. If you want to maximize the objective function, you need to multiply the objective function by -1 manually.
20+
:::
21+
22+
## The capability of `ipopt.Model`
23+
24+
### Supported constraints
25+
26+
:::{list-table}
27+
:header-rows: 1
28+
29+
* - Constraint
30+
- Supported
31+
* - <project:#model.add_linear_constraint>
32+
-
33+
* - <project:#model.add_quadratic_constraint>
34+
-
35+
* - <project:#model.add_second_order_cone_constraint>
36+
-
37+
* - <project:#model.add_sos_constraint>
38+
-
39+
* - <project:#model.add_nl_constraint>
40+
-
41+
42+
:::
43+
44+
```{include} attribute/ipopt.md
45+
```
46+
47+
48+
## Solver-specific operations
49+
50+
### Parameter
51+
52+
For [solver-specific parameters](https://coin-or.github.io/Ipopt/OPTIONS.html), we provide `set_raw_parameter` methods to get and set the parameters.
53+
54+
```python
55+
model = ipopt.Model()
56+
57+
# set the value of the parameter
58+
model.set_raw_parameter("tol", 1e-5)
59+
model.set_raw_parameter("max_iter", 200)
60+
61+
# For HSL library
62+
model.set_raw_parameter("hsllib", "/path/to/libhsl.so")
63+
model.set_raw_parameter("linear_solver", "ma27")
64+
```
65+
66+
## JIT compiler used by Ipopt interface
67+

scripts/generate_attribute_table.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44

55
import pyoptinterface as poi
6-
from pyoptinterface import gurobi, copt, mosek, highs
7-
8-
model = gurobi.Model
6+
from pyoptinterface import gurobi, copt, mosek, highs, ipopt
97

108

119
def attribute_support_table(f, attribute_enum):
@@ -44,6 +42,7 @@ def print_table(io: IO[str], results):
4442
(copt.Model, "copt"),
4543
(mosek.Model, "mosek"),
4644
(highs.Model, "highs"),
45+
(ipopt.Model, "ipopt"),
4746
]
4847

4948
rootdir = Path(__file__).parent.parent

0 commit comments

Comments
 (0)