protected mat matrix(double[] values, int rows, int cols) { return Matrix.Reshape(values, rows, cols, MatrixOrder.FortranColumnMajor); }