ProteoWizard
Public Member Functions
pwiz::math::LinearLeastSquares< LinearLeastSquaresType_LU > Class Template Reference

#include <LinearLeastSquares.hpp>

List of all members.

Public Member Functions

template<typename T >
boost::numeric::ublas::vector< T > solve (const boost::numeric::ublas::matrix< T > &A, const boost::numeric::ublas::vector< T > &y)

Detailed Description

template<>
class pwiz::math::LinearLeastSquares< LinearLeastSquaresType_LU >

Definition at line 40 of file LinearLeastSquares.hpp.


Member Function Documentation

template<typename T >
boost::numeric::ublas::vector<T> pwiz::math::LinearLeastSquares< LinearLeastSquaresType_LU >::solve ( const boost::numeric::ublas::matrix< T > &  A,
const boost::numeric::ublas::vector< T > &  y 
)
inline

Definition at line 44 of file LinearLeastSquares.hpp.

References y.

{
boost::numeric::ublas::permutation_matrix<std::size_t> m(A.size1());
boost::numeric::ublas::matrix<T> AtA = prod(trans(A), A);
boost::numeric::ublas::vector<T> b = y;
boost::numeric::ublas::vector<T> r;
// This serves as a sanity check. Note that an exception here
// probably indicates a data file error.
if (boost::numeric::ublas::lu_factorize(AtA, m) == 0.)
{
r = prod(trans(A), b);
boost::numeric::ublas::lu_substitute(AtA, m, r);
}
return r;
}

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