Skip to content

Commit ab96302

Browse files
authored
[Breaking] Rename IndicatorSet to Indicator (#18)
1 parent c29e2dd commit ab96302

File tree

8 files changed

+889
-10
lines changed

8 files changed

+889
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Here is a summary of the sets defined by MathOptFormat.
246246
| `"PositiveSemidefiniteConeSquare"` | The cone of symmetric positive semidefinite matrices, with side length `side_dimension`. The entries of the matrix are given column by column (or equivalently, row by row). The matrix is both constrained to be symmetric and to be positive semidefinite. That is, if the functions in entries `(i, j)` and `(j, i)` are different, then a constraint will be added to make sure that the entries are equal. | {"type": "PositiveSemidefiniteConeSquare", "side_dimension": 2} |
247247
| `"PowerCone"` | [x, y, z] ∈ {R³: x^{exponent} y^{1-exponent} ≥ \|z\|; x, y ≥ 0} | {"type": "PowerCone", "exponent": 2.0} |
248248
| `"DualPowerCone"` | [u, v, w] ∈ {R³: (u / exponent)^{exponent} (v / (1-exponent))^{1-exponent} ≥ \|w\|; u, v ≥ 0} | {"type": "DualPowerCone", "exponent": 2.0} |
249-
| `"IndicatorSet"` | If `activate_on=one`: (y, x) ∈ {0,1}×Rᴺ: y = 0 ⟹ x ∈ S, otherwise when `activate_on=zero`: (y, x) ∈ {0,1}×Rᴺ: y = 1 ⟹ x ∈ S. | {"type": "IndicatorSet", "set": {"type": "LessThan", "upper": 2.0}, "activate_on": "one"} |
249+
| `"Indicator"` | If `activate_on=one`: (y, x) ∈ {0,1}×Rᴺ: y = 0 ⟹ x ∈ S, otherwise when `activate_on=zero`: (y, x) ∈ {0,1}×Rᴺ: y = 1 ⟹ x ∈ S. | {"type": "Indicator", "set": {"type": "LessThan", "upper": 2.0}, "activate_on": "one"} |
250250
| `"NormOneCone"` | (t, x) ∈ {R^{dimension}: t ≥ Σᵢ\|xᵢ\|} | {"type": "NormOneCone", "dimension": 2} |
251251
| `"NormInfinityCone"` | (t, x) ∈ {R^{dimension}: t ≥ maxᵢ\|xᵢ\|} | {"type": "NormInfinityCone", "dimension": 2} |
252252
| `"RelativeEntropyCone"` | (u, v, w) ∈ {R^{dimension}: u ≥ sumᵢ wᵢlog(wᵢ/vᵢ), vᵢ ≥ 0, wᵢ ≥ 0} | {"type": "RelativeEntropyCone", "dimension": 3} |

examples/biobjective.mof.json

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

examples/milp.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{x | x + y >= 1, x ∈ [0, 1], y ∈ {0, 1}}",
33
"version": {
44
"major": 0,
5-
"minor": 6
5+
"minor": 7
66
},
77
"variables": [{
88
"name": "x",

examples/nlp.mof.json

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

examples/quadratic.mof.json

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

examples/vector.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{0 | [1 2; 3 4][x, y] + [5, 6] ∈ R+.",
33
"version": {
44
"major": 0,
5-
"minor": 6
5+
"minor": 7
66
},
77
"variables": [{
88
"name": "x"

python/mof.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
import jsonschema
33
import os
44

5-
SCHEMA_FILENAME = '../schemas/mof.0.6.schema.json'
5+
6+
SCHEMA_FILENAME = '../schemas/mof.0.7.schema.json'
67

78
def validate(filename):
8-
with open(filename, 'r') as io:
9+
with open(filename, 'r', encoding='utf-8') as io:
910
instance = json.load(io)
10-
with open(SCHEMA_FILENAME, 'r') as io:
11+
with open(SCHEMA_FILENAME, 'r', encoding='utf-8') as io:
1112
schema = json.load(io)
1213
jsonschema.validate(instance = instance, schema = schema)
1314

1415
def summarize_schema():
15-
with open(SCHEMA_FILENAME, 'r') as io:
16+
with open(SCHEMA_FILENAME, 'r', encoding='utf-8') as io:
1617
schema = json.load(io)
1718
summary = "## Sets\n"
1819
summary += "\n### Scalar Sets\n\n" + summarize(schema, "scalar_sets")

0 commit comments

Comments
 (0)