Example: Linear program
Profiles: OSCAR v1.0, OSCAR v1.1, OSCAR v1.2, OSCAR v1.3, OSCAR v1.4, OSCAR v1.5, OSCAR v1.6, OSCAR v1.7, OSCAR v1.8
Construct a linear program on the cube in dimension 3.
Related Specification
Systems
Oscar.jl
Generate code (generate.jl) [ edit ]
using Oscar
P = cube(3)
obj = linear_program(P, [3, -2, 4]; k=2, convention=:min)
save("data.mrdi", obj)
Data outputs
Profiles: OSCAR v1.0, OSCAR v1.1, OSCAR v1.2, OSCAR v1.3, OSCAR v1.4, OSCAR v1.5, OSCAR v1.6, OSCAR v1.7
Data file: data.mrdi
{
"_ns": {"Oscar": ["https://github.com/oscar-system/Oscar.jl", "1.7.0"]},
"_type": {"name": "LinearProgram", "params": {"_type": "QQField"}},
"data": {
"feasible_region": {
"_info": {"description": "cube of dimension 3\n"},
"LP": [
{
"_id": "unnamed#0",
"convention": "min",
"_attrs": {"convention": {"attachment": true}},
"LINEAR_OBJECTIVE": ["2", "3", "-2", "4"]
}
],
"BOUNDED": true,
"_attrs": {"FACETS": {"_type": "SparseMatrix<Rational, NonSymmetric>"}},
"CONE_DIM": 4,
"FACETS": [
{"0": "1", "1": "1"},
{"0": "1", "1": "-1"},
{"0": "1", "2": "1"},
{"0": "1", "2": "-1"},
{"0": "1", "3": "1"},
{"0": "1", "3": "-1"},
{"cols": 4}
],
"VERTICES_IN_FACETS": [
[0, 2, 4, 6],
[1, 3, 5, 7],
[0, 1, 4, 5],
[2, 3, 6, 7],
[0, 1, 2, 3],
[4, 5, 6, 7],
{"cols": 8}
],
"AFFINE_HULL": [{"cols": 4}],
"_type": "polytope::Polytope<Rational>",
"_ns": {"polymake": ["https://polymake.org", "4.15"]},
"CONE_AMBIENT_DIM": 4
},
"convention": "min",
"lpcoeffs": {
"data": ["2", "3", "-2", "4"],
"_type": "common::Vector<Rational>",
"_ns": {"polymake": ["https://polymake.org", "4.15"]}
}
}
}
This serialized output is equivalent for these profiles up to UUID renaming and recorded namespace version strings.