979899100101102103104105106107
A.checkSquare(); LUSolver solver = new LUSolver(); solver.setA(A); // create AMatrix from AVector AMatrix B = b.asColumnMatrix(); AMatrix X = solver.solve(B); // if no solution if(X == null) return null; return X.asVector(); }
118119120121122123124125126
*/ private static AMatrix solveSquare(AMatrix A, AMatrix B) { A.checkSquare(); LUSolver solver = new LUSolver(); solver.setA(A); return solver.solve(B); } }