@Test
public void testRowMajorFormat() throws Exception {

    double[] data = new double[]{1, 2, 3, 4, 5, 6};
    DenseMatrix matA = new DenseMatrix(2, 3, data, true);
    Assert.assertArrayEquals(data, new double[]{1, 4, 2, 5, 3, 6}, 0.);
    Assert.assertArrayEquals(matA.getData(), new double[]{1, 4, 2, 5, 3, 6}, 0.);
    data = new double[]{1, 2, 3, 4};
    matA = new DenseMatrix(2, 2, data, true);
    Assert.assertArrayEquals(data, new double[]{1, 3, 2, 4}, 0.);
    Assert.assertArrayEquals(matA.getData(), new double[]{1, 3, 2, 4}, 0.);
}