TODO: Calls from C/C++ are still broken because inside the MaponiA3 algo there is compensation for the fact that Fortran sends it's arrays in column-major order. This must be resolved by transposeing S_inv before it is passed to MaponiA3 and remove the compensations made there.