I just pushed some changes to use The PutArray
functions is the input is a nesting of std::vector<std::vector<...>>
and that vector forms a matrix or higher dimensional matrix or tensor of proper shape.
typedef std::vector<std::vector<std::vector<int>>> ivv_type; // 2 x 2 x 3
ivv_type matrix;
std::vector<int> row11 = {111, 112, 113};
std::vector<int> row12 = {121, 122, 123};
std::vector<int> row21 = {211, 212, 213};
std::vector<int> row22 = {221, 222, 223};
std::vector<std::vector<int>> row1;
std::vector<std::vector<int>> row2;
row1.push_back(row11);
row1.push_back(row12);
row2.push_back(row21);
row2.push_back(row22);
matrix.push_back(row1);
matrix.push_back(row2);
value res;
shell.enable(mathematica::bulk_io); // ENABLE this feature
shell << Total(Flatten(matrix));
shell >> res;
BOOST_CHECK(*res == 2004);
The above will use MLPutInteger32Array
/ WSPutInteger32Array
These two changes are currently in develop
branch. I'll have some more tests and then I'll put them in master
branch.
After that I'll use Armadillo
Eigen
etc.. as optional dependencies.