@@ -186,7 +186,53 @@ For more information on `"Nonlinear"` functions, see
186186| ` "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"}}] } |
187187| ` "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 ` . | |
188188
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
190236
191237Nonlinear functions are encoded in MathOptFormat by an expression graph. Each
192238expression 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
200246elaborate on permissible nodes and how to store them in the following
201247subsections.
202248
203- ##### Leaf nodes
249+ #### Leaf nodes
204250
205251Leaf nodes in the expression graph are data: they can either reference
206252optimization variables, or be real or complex valued numeric constants. They are
@@ -220,7 +266,7 @@ the node in `"node_list"`.
220266| ---- | ----------- | ------- |
221267| ` "node" ` | A pointer to a (1-indexed) element in the ` node_list ` field in a nonlinear function | {"head": "node", "index": 2} |
222268
223- ##### Operators
269+ #### Operators
224270
225271All nonlinear operators in MathOptFormat are described by a JSON object with two fields:
226272
@@ -301,12 +347,12 @@ and their corresponding arity.
301347| ` "min" ` | N-ary |
302348| ` "max" ` | N-ary |
303349
304- ##### Example
350+ #### Example
305351
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 ` .
307353
308354In 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) ` .
310356
311357In MathOptFormat, this expression graph can be encoded as follows:
312358``` json
@@ -342,52 +388,6 @@ In MathOptFormat, this expression graph can be encoded as follows:
342388}
343389```
344390
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-
391391## Implementations
392392
393393- Julia
0 commit comments