ProteoWizard
Public Types | Public Member Functions | Private Attributes
pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction Class Reference

#include <ParametrizedFunction.hpp>

List of all members.

Public Types

typedef data::SampleDatum
< double, value_type > 
Datum
typedef std::vector< DatumData

Public Member Functions

 ErrorFunction (const ParametrizedFunction< value_type > &f, const Data &data)
int parameterCount () const
double operator() (const ublas::vector< double > &p) const
ublas::vector< double > dp (const ublas::vector< double > &p) const
ublas::matrix< double > dp2 (const ublas::vector< double > &p) const

Private Attributes

const ParametrizedFunction
< value_type > & 
f_
const Datadata_

Detailed Description

template<typename value_type>
class pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction

Definition at line 61 of file ParametrizedFunction.hpp.


Member Typedef Documentation

template<typename value_type>
typedef data::SampleDatum<double, value_type> pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::Datum

Definition at line 65 of file ParametrizedFunction.hpp.

template<typename value_type>
typedef std::vector<Datum> pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::Data

Definition at line 66 of file ParametrizedFunction.hpp.


Constructor & Destructor Documentation

template<typename value_type>
pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::ErrorFunction ( const ParametrizedFunction< value_type > &  f,
const Data data 
)
inline

Definition at line 68 of file ParametrizedFunction.hpp.

: f_(f), data_(data)
{}

Member Function Documentation

template<typename value_type>
int pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::parameterCount ( ) const
inline

Definition at line 72 of file ParametrizedFunction.hpp.

{return f_.parameterCount();}
template<typename value_type>
double pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::operator() ( const ublas::vector< double > &  p) const
inline

Definition at line 74 of file ParametrizedFunction.hpp.

References data_, and norm().

{
double result = 0;
for (typename Data::const_iterator it=data_.begin(); it!=data_.end(); ++it)
result += norm(std::complex<double>(f_(it->x,p) - it->y));
return result;
}
template<typename value_type>
ublas::vector<double> pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::dp ( const ublas::vector< double > &  p) const
inline

Definition at line 82 of file ParametrizedFunction.hpp.

References pwiz::math::MatchedFilter::details::conj(), data_, and pwiz::frequency::ParametrizedFunction< value_type >::parameterCount().

Referenced by pwiz::frequency::DerivativeTest::testDerivatives().

{
ublas::vector<double> result(parameterCount());
result.clear();
for (typename Data::const_iterator it=data_.begin(); it!=data_.end(); ++it)
{
std::complex<double> diffconj = conj(std::complex<double>(f_(it->x,p) - it->y));
result += 2 * real(diffconj*f_.dp(it->x,p));
}
return result;
}
template<typename value_type>
ublas::matrix<double> pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::dp2 ( const ublas::vector< double > &  p) const
inline

Definition at line 94 of file ParametrizedFunction.hpp.

References pwiz::math::MatchedFilter::details::conj(), data_, pwiz::frequency::ParametrizedFunction< value_type >::dp(), pwiz::frequency::ParametrizedFunction< value_type >::dp2(), and pwiz::frequency::ParametrizedFunction< value_type >::parameterCount().

Referenced by pwiz::frequency::DerivativeTest::testDerivatives().

{
ublas::matrix<double> result(parameterCount(), parameterCount());
result.clear();
for (typename Data::const_iterator it=data_.begin(); it!=data_.end(); ++it)
{
std::complex<double> diffconj = conj(std::complex<double>(f_(it->x, p) - it->y));
ublas::vector<value_type> dp = f_.dp(it->x,p);
ublas::matrix<value_type> dp2 = f_.dp2(it->x,p);
result += 2 * real(diffconj*dp2 + outer_prod(conj(dp),dp));
}
return result;
}

Member Data Documentation

template<typename value_type>
const ParametrizedFunction<value_type>& pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::f_
private

Definition at line 109 of file ParametrizedFunction.hpp.

template<typename value_type>
const Data& pwiz::frequency::ParametrizedFunction< value_type >::ErrorFunction::data_
private

Definition at line 110 of file ParametrizedFunction.hpp.


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