Skip to content

Commit cab89d5

Browse files
authored
Update to 1.0 release (#19)
1 parent ab96302 commit cab89d5

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ called _MathOptFormat_ with the file extension `.mof.json`.
55

66
MathOptFormat is rigidly defined by the [JSON schema](http://json-schema.org/)
77
available at
8-
[`https://jump.dev/MathOptFormat/schemas/mof.0.6.schema.json`](https://jump.dev/MathOptFormat/schemas/mof.0.6.schema.json).
8+
[`https://jump.dev/MathOptFormat/schemas/mof.1.0.schema.json`](https://jump.dev/MathOptFormat/schemas/mof.1.0.schema.json).
99

1010
It is intended for the schema to be self-documenting. Instead of modifying or
1111
adding to this documentation, clarifying edits should be made to the
@@ -82,7 +82,7 @@ Encoded into the MathOptFormat file format, this example becomes:
8282
},
8383
"constraints": [{
8484
"name": "x >= 1",
85-
"function": {"type": "SingleVariable", "variable": "x"},
85+
"function": {"type": "Variable", "name": "x"},
8686
"set": {"type": "GreaterThan", "lower": 1}
8787
}]
8888
}
@@ -185,7 +185,7 @@ Here is a summary of the functions defined by MathOptFormat.
185185

186186
| Name | Description | Example |
187187
| ---- | ----------- | ------- |
188-
| `"SingleVariable"` | The scalar variable `variable`. | {"type": "SingleVariable", "variable": "x"} |
188+
| `"Variable"` | The scalar variable `x`. | {"type": "Variable", "name": "x"} |
189189
| `"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. | {"type": "ScalarAffineFunction", "constant": 1.0, "terms": [{"coefficient": 2.5, "variable": "x"}]} |
190190
| `"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. | {"type": "ScalarQuadraticFunction", "constant": 1.0, "affine_terms": [{"coefficient": 2.5, "variable": "x"}], "quadratic_terms": [{"coefficient": 2.0, "variable_1": "x", "variable_2": "y"}]} |
191191
| `"ScalarNonlinearFunction"` | An expression graph representing a scalar nonlinear function. | |

examples/biobjective.mof.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"description": "The problem: [min{2x - y + 1, -y}]",
33
"version": {
4-
"major": 0,
5-
"minor": 7
4+
"major": 1,
5+
"minor": 0
66
},
77
"variables": [{
88
"name": "x"

examples/milp.mof.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"description": "The problem: min{x | x + y >= 1, x ∈ [0, 1], y ∈ {0, 1}}",
33
"version": {
4-
"major": 0,
5-
"minor": 7
4+
"major": 1,
5+
"minor": 0
66
},
77
"variables": [{
88
"name": "x",
@@ -14,8 +14,8 @@
1414
"objective": {
1515
"sense": "min",
1616
"function": {
17-
"type": "SingleVariable",
18-
"variable": "x"
17+
"type": "Variable",
18+
"name": "x"
1919
}
2020
},
2121
"constraints": [{
@@ -40,8 +40,8 @@
4040
}, {
4141
"name": "x ∈ [0, 1]",
4242
"function": {
43-
"type": "SingleVariable",
44-
"variable": "x"
43+
"type": "Variable",
44+
"name": "x"
4545
},
4646
"set": {
4747
"type": "Interval",
@@ -51,8 +51,8 @@
5151
}, {
5252
"name": "y ∈ {0, 1}",
5353
"function": {
54-
"type": "SingleVariable",
55-
"variable": "y"
54+
"type": "Variable",
55+
"name": "y"
5656
},
5757
"set": {
5858
"type": "ZeroOne"

examples/nlp.mof.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"description": "The problem: min{2x + sin(x)^2 + y}.",
33
"version": {
4-
"major": 0,
5-
"minor": 7
4+
"major": 1,
5+
"minor": 0
66
},
77
"variables": [{
88
"name": "x"

examples/quadratic.mof.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"description": "The problem: min{x^2 + x * y + y^2}",
33
"version": {
4-
"major": 0,
5-
"minor": 7
4+
"major": 1,
5+
"minor": 0
66
},
77
"variables": [{
88
"name": "x"

examples/vector.mof.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"description": "The problem: min{0 | [1 2; 3 4][x, y] + [5, 6] ∈ R+.",
33
"version": {
4-
"major": 0,
5-
"minor": 7
4+
"major": 1,
5+
"minor": 0
66
},
77
"variables": [{
88
"name": "x"
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/schema#",
3-
"$id": "https://jump.dev/MathOptFormat/schemas/mof.0.7.schema.json",
3+
"$id": "https://jump.dev/MathOptFormat/schemas/mof.1.0.schema.json",
44
"title": "The schema for MathOptFormat",
55
"type": "object",
66
"required": ["version", "variables", "objective", "constraints"],
@@ -11,10 +11,10 @@
1111
"required": ["minor", "major"],
1212
"properties": {
1313
"minor": {
14-
"const": 6
14+
"const": 0
1515
},
1616
"major": {
17-
"const": 0
17+
"const": 1
1818
}
1919
}
2020
},
@@ -281,14 +281,14 @@
281281
"type": "object",
282282
"required": ["type"],
283283
"oneOf": [{
284-
"description": "The scalar variable `variable`.",
285-
"examples": ["{\"type\": \"SingleVariable\", \"variable\": \"x\"}"],
286-
"required": ["variable"],
284+
"description": "The scalar variable `x`.",
285+
"examples": ["{\"type\": \"Variable\", \"name\": \"x\"}"],
286+
"required": ["name"],
287287
"properties": {
288288
"type": {
289-
"const": "SingleVariable"
289+
"const": "Variable"
290290
},
291-
"variable": {
291+
"name": {
292292
"type": "string"
293293
}
294294
}

0 commit comments

Comments
 (0)