#include <LinearSolver.hpp>
List of all members.
Public Member Functions |
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
|
Detailed Description
template<>
class pwiz::math::LinearSolver< LinearSolverType_LU >
Definition at line 55 of file LinearSolver.hpp.
Member Function Documentation
template<typename matrix_type , typename vector_type >
vector_type pwiz::math::LinearSolver< LinearSolverType_LU >::solve |
( |
const matrix_type & |
A, |
|
|
const vector_type & |
y |
|
) |
| |
|
inline |
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.
References A.
{
namespace ublas = boost::numeric::ublas;
matrix_type A_factorized =
A;
ublas::permutation_matrix<size_t> pm(
y.size());
int singular = lu_factorize(A_factorized, pm);
if (singular) throw std::runtime_error("[LinearSolver<LU>::solve()] A is singular.");
lu_substitute(A_factorized, pm, result);
return result;
}
The documentation for this class was generated from the following file: