ProteoWizard
Public Member Functions | List of all members
pwiz::math::LinearSolver< LinearSolverType_LU > Class Template Reference

#include <LinearSolver.hpp>

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 More...
 

Detailed Description

template<>
class pwiz::math::LinearSolver< LinearSolverType_LU >

Definition at line 55 of file LinearSolver.hpp.

Member Function Documentation

§ solve()

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.

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  }
#define A
KernelTraitsBase< Kernel >::space_type::ordinate_type y

The documentation for this class was generated from the following file: