LU and LU inverse is done
This commit is contained in:
@@ -23,8 +23,11 @@ namespace numerics{
|
||||
if (method == "Gauss-Jordan"){
|
||||
inverse_gj(A);
|
||||
}
|
||||
else if(method == "LU"){
|
||||
inplace_inverse_lu(A);
|
||||
}
|
||||
else{
|
||||
throw std::runtime_error("numerics::inplace_inverse(" + method + ") - Not implemented yet \r \nImplemented: 'Gauss-Jordan',");
|
||||
throw std::runtime_error("numerics::inplace_inverse(" + method + ") - Not implemented yet \r \nImplemented: 'Gauss-Jordan', 'LU'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,21 +35,11 @@ namespace numerics{
|
||||
|
||||
template <typename T>
|
||||
utils::Matrix<T> inverse(utils::Matrix<T>& A, std::string method = "Gauss-Jordan"){
|
||||
|
||||
|
||||
utils::Matrix<T> B = A;
|
||||
|
||||
inplace_inverse(B, method);
|
||||
|
||||
return B;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace numerics
|
||||
|
||||
#endif // _inverse_n_
|
||||
Reference in New Issue
Block a user