Example: Rational matrix
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
The matrix is given as
$$ \left( \begin{array}{cccc} 12 & 31 & 24 & 78\\ 51 & 63 & 17 & 35\\ 23 & 99 & 19 & 34 \end{array} \right) $$
with entries in the rational numbers $\mathbb{Q}$.
Related Specification
Systems
Oscar.jl
Generate code (generate.jl) [ edit ]
using Oscar
mat = matrix(QQ,[12 31 24 78; 51 63 17 35; 23 99 19 34]);
save("data.mrdi", mat)
Data outputs
Profiles: OSCAR v1.0, OSCAR v1.1, OSCAR v1.2, OSCAR v1.3
Data file: data.mrdi
{
"_ns": {"Oscar": ["https://github.com/oscar-system/Oscar.jl", "1.3.1"]},
"_type": {"name": "MatElem", "params": "aff5e04a-ac71-4434-bb56-fcdc8b874d6e"},
"data": [["12", "31", "24", "78"], ["51", "63", "17", "35"], ["23", "99", "19", "34"]],
"_refs": {
"aff5e04a-ac71-4434-bb56-fcdc8b874d6e": {"_type": "MatSpace", "data": {"base_ring": {"_type": "QQField"}, "ncols": "4", "nrows": "3"}}
}
}
This serialized output is equivalent for these profiles up to UUID renaming and recorded namespace version strings.
Profiles: 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": "MatElem", "params": "9337de46-ad2f-4ad1-a95f-5eec3c1c340a"},
"data": [["12", "31", "24", "78"], ["51", "63", "17", "35"], ["23", "99", "19", "34"]],
"_refs": {
"9337de46-ad2f-4ad1-a95f-5eec3c1c340a": {
"_type": {"name": "MatSpace", "params": {"_type": "QQField"}},
"data": {"ncols": "4", "nrows": "3"}
}
}
}
This serialized output is equivalent for these profiles up to UUID renaming and recorded namespace version strings.
polymake
Generate code (generate.pl) [ edit ]
use strict;
use warnings;
use application "polytope";
my $mat = new Matrix<Rational>([[12,31,24,78],[51,63,17,35],[23,99,19,34]]);
save_data($mat, "data.json");
Data outputs
Profiles: default
Data file: data.json
{
"_ns": {"polymake": ["https://polymake.org", "4.14"]},
"_type": "common::Matrix<Rational, NonSymmetric>",
"data": [["12", "31", "24", "78"], ["51", "63", "17", "35"], ["23", "99", "19", "34"]]
}