* @param b
* @return
*/
private static AVector solveSquare(AMatrix A, AVector b) {
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();
}