@Test
public void testSolveSquareMatrix() {
AMatrix m= Matrix.create(new double[][] {{1,2,2},{1,4,1},{5,9,2}});
AMatrix x = Linear.solveLeastSquares(m, Matrix.create(new double[][]{{1},{3},{3}}));
assertArrayEquals(new double[] {-1.35294117647,1.05882352941,0.11764705882},x.asDoubleArray(), 1e-8);
}
@Test(expected=IllegalArgumentException.class)
public void testSolveSquareMatrixRectangular() {
AMatrix m= Matrix.create(new double[][] {{1,2},{1,4},{5,9}});