#include <LinearSolver.hpp>
|
template<typename matrix_type , typename vector_type > |
vector_type | solve (const matrix_type &A, const vector_type &y) |
| solve system of linear equations Ax = y using boost::ublas; note: extra copying inefficiencies for ease of client use
|
|
Definition at line 55 of file LinearSolver.hpp.
◆ solve()
template<typename matrix_type , typename vector_type >
solve system of linear equations Ax = y using boost::ublas; note: extra copying inefficiencies for ease of client use
Definition at line 62 of file LinearSolver.hpp.
64 {
65 namespace ublas = boost::numeric::ublas;
66
67 matrix_type A_factorized =
A;
68 ublas::permutation_matrix<size_t> pm(
y.size());
69
70 int singular = lu_factorize(A_factorized, pm);
71 if (singular) throw std::runtime_error("[LinearSolver<LU>::solve()] A is singular.");
72
73 vector_type result(
y);
74 lu_substitute(A_factorized, pm, result);
75
76 return result;
77 }
KernelTraitsBase< Kernel >::space_type::ordinate_type y
References A, and y.
The documentation for this class was generated from the following file:
- /data/libpwiz-dev3648559106/libpwiz-3.0.18342/pwiz/utility/math/LinearSolver.hpp