UnivariateLinearLsqFit< T, Function > Class Template Reference

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

template<typename T, typename Function>
class UnivariateLinearLsqFit< T, Function >

Linear least-squares fit of data to a function with outlier rejection and iteration. The number of parameters is assumed known at compile time.

Function objects have to conform to a simple interface: (it is a template object in this example, but does not need to be).

template<typename T, typename Tpar, int N> class Poly1D { public: enum { NPar = N }; typedef Tpar param_vector_type; typedef T value_type;

// optional static void prettyPrint(ostream& os, const TPar& p);

// evaluate at location x for parameter vector p T operator()( const T x, const TPar& p ) const;

// return the n-th basis function evaluated at values in array x MArray<T,1> get_nth_basis( const int n, const MArray<T,1>& x ) };


Member Typedef Documentation

template<typename T, typename Function>
typedef Function::TPar UnivariateLinearLsqFit< T, Function >::param_vec_type

Constructor & Destructor Documentation

template<typename T, typename Function>
UnivariateLinearLsqFit< T, Function >::UnivariateLinearLsqFit ( int  niter = 1,
float  kappa = 4.0,
bool  quiet = true 
) [inline]
template<typename T, typename Function>
virtual UnivariateLinearLsqFit< T, Function >::~UnivariateLinearLsqFit (  )  [inline, virtual]

Member Function Documentation

template<typename T, typename Function>
void UnivariateLinearLsqFit< T, Function >::set_rejection ( const int  niter,
const float  kappa 
) [inline]
template<typename T , typename Function >
UnivariateLinearLsqFit< T, Function >::param_vec_type UnivariateLinearLsqFit< T, Function >::fit ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y,
const MArray< T, 1 > &  y_errors,
param_vec_type errors = NULL 
) const [inline]
template<typename T , typename Function >
void UnivariateLinearLsqFit< T, Function >::reject ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y,
const MArray< T, 1 > &  y_errors,
const param_vec_type p,
MArray< T, 1 > &  new_x,
MArray< T, 1 > &  new_y,
MArray< T, 1 > &  new_y_errors 
) const [inline, protected]

Field Documentation

template<typename T, typename Function>
int UnivariateLinearLsqFit< T, Function >::niter_ [protected]
template<typename T, typename Function>
float UnivariateLinearLsqFit< T, Function >::kappa_ [protected]
template<typename T, typename Function>
bool UnivariateLinearLsqFit< T, Function >::quiet_ [protected]

Generated on 4 Nov 2015 for CURE by  doxygen 1.6.1