@Test
public void testRank() throws Exception {

    double[][] data1 = {
        {-2, 2, -3},
        {-1, 1, 3},
        {2, 0, -1},
    };
    DenseMatrix matA = new DenseMatrix(data1);
    Assert.assertEquals(matA.rank(), 3);
    double[][] data2 = {
        {-2, 2, -3},
        {-1, 1, -1.5},
        {2, 0, -1},
        {2, 0, -1},
    };
    DenseMatrix matB = new DenseMatrix(data2);
    Assert.assertEquals(matB.rank(), 2);
}