working on issue 366 [still broken; using 01.R to test]

Decided to send matrices to C; crazily, it can be easier doing that in
C than in R, even though C does not have a proper matrix type.