You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+104Lines changed: 104 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,110 @@ Here is a summary of the functions defined by MathOptFormat.
182
182
|`"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"}}]} |
183
183
|`"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`. ||
184
184
185
+
#### Nonlinear functions
186
+
187
+
Nonlinear functions are encoded in MathOptFormat by an expression graph. Each
188
+
expression graphs is stored in Polish prefix notation. For example, the
189
+
nonlinear expression `sin²(x)` is expressed as `^(sin(x), 2)`.
190
+
191
+
The expression graph is stored as an object with three required fields:
192
+
`"head"`, which must be `"Nonlinear"`, as well as `"root"` and `"node_list"`.
193
+
194
+
`"root"` contains an object defining the root node of the expression graph. All
195
+
other nodes are stored as a flattened list in the `"node\_list"` field. We
196
+
elaborate on permissible nodes and how to store them in the following
197
+
subsections.
198
+
199
+
##### Leaf nodes
200
+
201
+
Leaf nodes in the expression graph are data: they can either reference
202
+
optimization variables, or be real or complex valued numeric constants. They are
0 commit comments