Skip to content

Commit 650add1

Browse files
committed
Rename Nonlinear to ScalarNonlinearFunction for consistency.
This also enables us to add VectorNonlinearFunction in the future.
1 parent 751be03 commit 650add1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ Here is a summary of the functions defined by MathOptFormat.
172172
| `"SingleVariable"` | The scalar variable `variable`. | {"head": "SingleVariable", "variable": "x"} |
173173
| `"ScalarAffineFunction"` | The function `a'x + b`, where `a` is a sparse vector specified by a list of `ScalarAffineTerm`s in `terms` and `b` is the scalar in `constant`. Duplicate variables in `terms` are accepted, and the corresponding coefficients are summed together. | {"head": "ScalarAffineFunction", "constant": 1.0, "terms": [{"coefficient": 2.5, "variable": "x"}]} |
174174
| `"ScalarQuadraticFunction"` | The function `0.5x'Qx + a'x + b`, where `a` is a sparse vector of `ScalarAffineTerm`s in `affine_terms`, `b` is the scalar `constant`, and `Q` is a symmetric matrix specified by a list of `ScalarQuadraticTerm`s in `quadratic_terms`. Duplicate indices in `affine_terms` and `quadratic` are accepted, and the corresponding coefficients are summed together. Mirrored indices in `quadratic_terms` (i.e., `(i,j)` and `(j, i)`) are considered duplicates; only one need to be specified. | {"head": "ScalarAffineFunction", "constant": 1.0, "affine_terms": [{"coefficient": 2.5, "variable": "x"}], "quadratic_terms": [{"coefficient": 2.0, "variable_1": "x", "variable_2": "y"}]} |
175-
| `"Nonlinear"` | An expression graph representing a scalar function. | |
175+
| `"ScalarNonlinearFunction"` | An expression graph representing a scalar nonlinear function. | |
176176

177177

178-
For more information on `"Nonlinear"` functions, see
178+
For more information on `"ScalarNonlinearFunction"` functions, see
179179
[Nonlinear functions](@ref).
180180

181181
#### Vector Functions
@@ -239,7 +239,8 @@ expression graphs is stored in Polish prefix notation. For example, the
239239
nonlinear expression `sin²(x)` is expressed as `^(sin(x), 2)`.
240240

241241
The expression graph is stored as an object with three required fields:
242-
`"head"`, which must be `"Nonlinear"`, as well as `"root"` and `"node_list"`.
242+
`"head"`, which must be `"ScalarNonlinearFunction"`, as well as `"root"` and
243+
`"node_list"`.
243244

244245
`"root"` contains an object defining the root node of the expression graph. All
245246
other nodes are stored as a flattened list in the `"node_list"` field. We
@@ -357,7 +358,7 @@ In Polish notation, the expression graph is:
357358
In MathOptFormat, this expression graph can be encoded as follows:
358359
```json
359360
{
360-
"head": "Nonlinear",
361+
"head": "ScalarNonlinearFunction",
361362
"root": {
362363
"head": "+",
363364
"args": [

examples/nlp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"objectives": [{
1010
"sense": "min",
1111
"function": {
12-
"head": "Nonlinear",
12+
"head": "ScalarNonlinearFunction",
1313
"root": {
1414
"head": "node",
1515
"index": 4

mof.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@
317317
}
318318
}
319319
}, {
320-
"description": "An expression graph representing a scalar function.",
320+
"description": "An expression graph representing a scalar nonlinear function.",
321321
"required": ["root", "node_list"],
322322
"properties": {
323323
"head": {
324-
"const": "Nonlinear"
324+
"const": "ScalarNonlinearFunction"
325325
},
326326
"root": {
327327
"$ref": "#/definitions/NonlinearTerm"

0 commit comments

Comments
 (0)