@Test
public void testSolveLS() throws Exception {

    double[][] data = {
        {-2, 2, -3},
        {-1, 1, -1.5},
        {2, 0, -1},
        {2, 0, -1},
    };
    DenseMatrix matA = new DenseMatrix(data);
    DenseMatrix matB = DenseMatrix.rand(4, 1);
    DenseMatrix matX = matA.solveLS(matB);
    DenseMatrix r = matA.multiplies(matX).minus(matB);
    DenseVector b = DenseVector.rand(4);
    DenseVector x = matA.solveLS(b);
}