toDoubleArray

Convert matrix to a DoubleArray in row-major order