make matrixlib calls use 1D pointers