134 template<
class T,
class DataPo
int>
179 for(
int i=0;i<
m_modelDim;++i) e += d[i] * model[i];
189 const int N = (int)points.size();
194 for(
int i=0;i<N;i++){
205 Si =
m_C ?
m_S.inv()* (*m_C) :
m_S.inv();
207 Si =
m_C ?
m_S.pinv(
true)* (*m_C) :
m_S.pinv(
true);
LeastSquareModelFitting(int modelDim, DesignMatrixGen gen, DynMatrix< T > *constraintMatrix=0)
constructor with given parameters
Definition: LeastSquareModelFitting.h:166
DesignMatrixGen m_gen
design matrix row generator
Definition: LeastSquareModelFitting.h:149
DynMatrix< T > m_Evals
Definition: LeastSquareModelFitting.h:152
undocument this line if you encounter any issues!
Definition: Any.h:37
Special linear algebra exception type .
Definition: DynMatrix.h:71
icl64f getError(const Model &model, const DataPoint &p)
computes the error for a given data point
Definition: LeastSquareModelFitting.h:175
Highly flexible and optimized matrix class implementation.
Definition: DynMatrix.h:81
DynMatrix< T > m_svdVt
Definition: LeastSquareModelFitting.h:152
Direct Least Square Fitting Algorithm.
Definition: LeastSquareModelFitting.h:135
DynMatrix< T > m_D
utility valiables
Definition: LeastSquareModelFitting.h:152
LeastSquareModelFitting()
Empty constructor that creates a dummy instance.
Definition: LeastSquareModelFitting.h:163
Model fit(const std::vector< DataPoint > &points)
fits the model to the given data points and returns optimal parameter set
Definition: LeastSquareModelFitting.h:187
std::vector< T > Model
model type (defines the model parameters)
Definition: LeastSquareModelFitting.h:142
DynMatrix< T > m_svdS
Definition: LeastSquareModelFitting.h:152
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
DynMatrix< T > m_Evecs
Definition: LeastSquareModelFitting.h:152
Model m_model
the model parameters
Definition: LeastSquareModelFitting.h:158
DynMatrix< T > m_S
Definition: LeastSquareModelFitting.h:152
utils::Function< void, const DataPoint &, T * > DesignMatrixGen
fills the give float* with data from the given data point
Definition: LeastSquareModelFitting.h:139
void eigen(DynMatrix &eigenvectors, DynMatrix &eigenvalues) const
Extracts the matrix's eigenvalues and eigenvectors.
DynMatrix< T > m_svdU
Definition: LeastSquareModelFitting.h:152
void copy(const T *src, const T *srcEnd, T *dst)
moves data from source to destination array (no casting possible)
Definition: CoreFunctions.h:216
int m_modelDim
model dimension
Definition: LeastSquareModelFitting.h:146
utils::SmartPtr< DynMatrix< T > > m_C
constraint matrix
Definition: LeastSquareModelFitting.h:155
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75