@@ -186,7 +186,53 @@ For more information on `"Nonlinear"` functions, see
186
186
| ` "VectorAffineFunction" ` | The function ` Ax + b ` , where ` A ` is a sparse matrix specified by a list of ` VectorAffineTerm ` s in ` terms ` and ` b ` is a dense vector specified by ` constants ` . | {"head": "VectorAffineFunction", "constants": [ 1.0] , "terms": [ {"output_index": 1, "scalar_term": {"coefficient": 2.5, "variable": "x"}}] } |
187
187
| ` "VectorQuadraticFunction" ` | The vector-valued quadratic function ` q(x) + Ax + b ` , where ` q(x) ` is specified by a list of ` VectorQuadraticTerm ` s in ` quadratic_terms ` , ` A ` is a sparse matrix specified by a list of ` VectorAffineTerm ` s in ` affine_terms ` and ` b ` is a dense vector specified by ` constants ` . | |
188
188
189
- #### Nonlinear functions
189
+ ### List of supported sets
190
+
191
+ The list of sets supported by MathOptFormat are contained in the
192
+ ` #/definitions/scalar_sets ` and ` #/definitions/vector_sets ` fields of the
193
+ schema. Scalar sets are sets for which ` Mj=1 ` , while vector sets are sets for
194
+ which ` Mj≥1 ` .
195
+
196
+ Here is a summary of the sets defined by MathOptFormat.
197
+
198
+ #### Scalar Sets
199
+
200
+ | Name | Description | Example |
201
+ | ---- | ----------- | ------- |
202
+ | ` "LessThan" ` | (-∞, upper] | {"head": "LessThan", "upper": 2.1} |
203
+ | ` "GreaterThan" ` | [ lower, ∞) | {"head": "GreaterThan", "lower": 2.1} |
204
+ | ` "EqualTo" ` | {value} | {"head": "EqualTo", "value": 2.1} |
205
+ | ` "Interval" ` | [ lower, upper] | {"head": "Interval", "lower": 2.1, "upper": 3.4} |
206
+ | ` "Semiinteger" ` | {0} ∪ {lower, lower + 1, ..., upper} | {"head": "Semiinteger", "lower": 2, "upper": 4} |
207
+ | ` "Semicontinuous" ` | {0} ∪ [ lower, upper] | {"head": "Semicontinuous", "lower": 2.1, "upper": 3.4} |
208
+ | ` "ZeroOne" ` | {0, 1} | {"head": "ZeroOne"} |
209
+ | ` "Integer" ` | ℤ | {"head": "Integer"} |
210
+
211
+ #### Vector Sets
212
+
213
+ | Name | Description | Example |
214
+ | ---- | ----------- | ------- |
215
+ | ` "ExponentialCone" ` | [ x, y, z] ∈ {R³: y * exp(x / y) ≤ z, y ≥ 0} | {"head": "ExponentialCone"} |
216
+ | ` "DualExponentialCone" ` | [ u, v, w] ∈ {R³: -u * exp(v / u) ≤ exp(1) * w, u < 0} | {"head": "DualExponentialCone"} |
217
+ | ` "SOS1" ` | A special ordered set of type I. | {"head": "SOS1", "weights": [ 1, 3, 2] } |
218
+ | ` "SOS2" ` | A special ordered set of type II. | {"head": "SOS2", "weights": [ 1, 3, 2] } |
219
+ | ` "GeometricMeanCone" ` | [ t, x] ∈ {R^{dimension}: t ≤ (Πxᵢ)^{1 / (dimension-1)}} | {"head": "GeometricMeanCone", "dimension": 3} |
220
+ | ` "SecondOrderCone" ` | [ t, x] ∈ {R^{dimension} : t ≥ \|\| x\|\| ₂ | {"head": "SecondOrderCone", "dimension": 3} |
221
+ | ` "RotatedSecondOrderCone" ` | [ t, u, x] ∈ {R^{dimension} : 2tu ≥ (\|\| x\|\| ₂)²; t, u ≥ 0} | {"head": "RotatedSecondOrderCone", "dimension": 3} |
222
+ | ` "Zeros" ` | {0}^{dimension} | {"head": "Zeros", "dimension": 3} |
223
+ | ` "Reals" ` | R^{dimension} | {"head": "Reals", "dimension": 3} |
224
+ | ` "Nonpositives" ` | R₋^{dimension} | {"head": "Nonpositives", "dimension": 3} |
225
+ | ` "Nonnegatives" ` | R₊^{dimension} | {"head": "Nonnegatives", "dimension": 3} |
226
+ | ` "RootDetConeTriangle" ` | | |
227
+ | ` "RootDetConeSquare" ` | | |
228
+ | ` "LogDetConeTriangle" ` | | |
229
+ | ` "LogDetConeSquare" ` | | |
230
+ | ` "PositiveSemidefiniteConeTriangle" ` | | |
231
+ | ` "PositiveSemidefiniteConeSquare" ` | | |
232
+ | ` "PowerCone" ` | [ x, y, z] ∈ {R³: x^{exponent} y^{1-exponent} ≥ \| z\| ; x, y ≥ 0} | {"head": "PowerCone", "exponent": 2.0} |
233
+ | ` "DualPowerCone" ` | [ u, v, w] ∈ {R³: (u / exponent)^{exponent} (v / (1-exponent))^{1-exponent} ≥ \| w\| ; u, v ≥ 0} | {"head": "DualPowerCone", "exponent": 2.0} |
234
+
235
+ ### Nonlinear functions
190
236
191
237
Nonlinear functions are encoded in MathOptFormat by an expression graph. Each
192
238
expression graphs is stored in Polish prefix notation. For example, the
@@ -200,7 +246,7 @@ other nodes are stored as a flattened list in the `"node_list"` field. We
200
246
elaborate on permissible nodes and how to store them in the following
201
247
subsections.
202
248
203
- ##### Leaf nodes
249
+ #### Leaf nodes
204
250
205
251
Leaf nodes in the expression graph are data: they can either reference
206
252
optimization variables, or be real or complex valued numeric constants. They are
@@ -220,7 +266,7 @@ the node in `"node_list"`.
220
266
| ---- | ----------- | ------- |
221
267
| ` "node" ` | A pointer to a (1-indexed) element in the ` node_list ` field in a nonlinear function | {"head": "node", "index": 2} |
222
268
223
- ##### Operators
269
+ #### Operators
224
270
225
271
All nonlinear operators in MathOptFormat are described by a JSON object with two fields:
226
272
@@ -301,12 +347,12 @@ and their corresponding arity.
301
347
| ` "min" ` | N-ary |
302
348
| ` "max" ` | N-ary |
303
349
304
- ##### Example
350
+ #### Example
305
351
306
- As an example, consider the function ` f(x, y) = (1 + 3i) ⋅ x + sin^2(x) + y ` .
352
+ As an example, consider the function ` f(x, y) = (1 + 3i) * x + sin^2(x) + y ` .
307
353
308
354
In Polish notation, the expression graph is:
309
- ` f(x, y) = +(1 + 3i, ^(sin(x), 2), y) ` .
355
+ ` f(x, y) = +(*( 1 + 3i, x) , ^(sin(x), 2), y) ` .
310
356
311
357
In MathOptFormat, this expression graph can be encoded as follows:
312
358
``` json
@@ -342,52 +388,6 @@ In MathOptFormat, this expression graph can be encoded as follows:
342
388
}
343
389
```
344
390
345
- ### List of supported sets
346
-
347
- The list of sets supported by MathOptFormat are contained in the
348
- ` #/definitions/scalar_sets ` and ` #/definitions/vector_sets ` fields of the
349
- schema. Scalar sets are sets for which ` Mj=1 ` , while vector sets are sets for
350
- which ` Mj≥1 ` .
351
-
352
- Here is a summary of the sets defined by MathOptFormat.
353
-
354
- #### Scalar Sets
355
-
356
- | Name | Description | Example |
357
- | ---- | ----------- | ------- |
358
- | ` "LessThan" ` | (-∞, upper] | {"head": "LessThan", "upper": 2.1} |
359
- | ` "GreaterThan" ` | [ lower, ∞) | {"head": "GreaterThan", "lower": 2.1} |
360
- | ` "EqualTo" ` | {value} | {"head": "EqualTo", "value": 2.1} |
361
- | ` "Interval" ` | [ lower, upper] | {"head": "Interval", "lower": 2.1, "upper": 3.4} |
362
- | ` "Semiinteger" ` | {0} ∪ {lower, lower + 1, ..., upper} | {"head": "Semiinteger", "lower": 2, "upper": 4} |
363
- | ` "Semicontinuous" ` | {0} ∪ [ lower, upper] | {"head": "Semicontinuous", "lower": 2.1, "upper": 3.4} |
364
- | ` "ZeroOne" ` | {0, 1} | {"head": "ZeroOne"} |
365
- | ` "Integer" ` | ℤ | {"head": "Integer"} |
366
-
367
- #### Vector Sets
368
-
369
- | Name | Description | Example |
370
- | ---- | ----------- | ------- |
371
- | ` "ExponentialCone" ` | [ x, y, z] ∈ {R³: y * exp(x / y) ≤ z, y ≥ 0} | {"head": "ExponentialCone"} |
372
- | ` "DualExponentialCone" ` | [ u, v, w] ∈ {R³: -u * exp(v / u) ≤ exp(1) * w, u < 0} | {"head": "DualExponentialCone"} |
373
- | ` "SOS1" ` | A special ordered set of type I. | {"head": "SOS1", "weights": [ 1, 3, 2] } |
374
- | ` "SOS2" ` | A special ordered set of type II. | {"head": "SOS2", "weights": [ 1, 3, 2] } |
375
- | ` "GeometricMeanCone" ` | [ t, x] ∈ {R^{dimension}: t ≤ (Πxᵢ)^{1 / (dimension-1)}} | {"head": "GeometricMeanCone", "dimension": 3} |
376
- | ` "SecondOrderCone" ` | [ t, x] ∈ {R^{dimension} : t ≥ \|\| x\|\| ₂ | {"head": "SecondOrderCone", "dimension": 3} |
377
- | ` "RotatedSecondOrderCone" ` | [ t, u, x] ∈ {R^{dimension} : 2tu ≥ (\|\| x\|\| ₂)²; t, u ≥ 0} | {"head": "RotatedSecondOrderCone", "dimension": 3} |
378
- | ` "Zeros" ` | {0}^{dimension} | {"head": "Zeros", "dimension": 3} |
379
- | ` "Reals" ` | R^{dimension} | {"head": "Reals", "dimension": 3} |
380
- | ` "Nonpositives" ` | R₋^{dimension} | {"head": "Nonpositives", "dimension": 3} |
381
- | ` "Nonnegatives" ` | R₊^{dimension} | {"head": "Nonnegatives", "dimension": 3} |
382
- | ` "RootDetConeTriangle" ` | | |
383
- | ` "RootDetConeSquare" ` | | |
384
- | ` "LogDetConeTriangle" ` | | |
385
- | ` "LogDetConeSquare" ` | | |
386
- | ` "PositiveSemidefiniteConeTriangle" ` | | |
387
- | ` "PositiveSemidefiniteConeSquare" ` | | |
388
- | ` "PowerCone" ` | [ x, y, z] ∈ {R³: x^{exponent} y^{1-exponent} ≥ \| z\| ; x, y ≥ 0} | {"head": "PowerCone", "exponent": 2.0} |
389
- | ` "DualPowerCone" ` | [ u, v, w] ∈ {R³: (u / exponent)^{exponent} (v / (1-exponent))^{1-exponent} ≥ \| w\| ; u, v ≥ 0} | {"head": "DualPowerCone", "exponent": 2.0} |
390
-
391
391
## Implementations
392
392
393
393
- Julia
0 commit comments