FittingFunctionLorentzianWithBackground.h

Go to the documentation of this file.
00001 // FittingFunctionLorentzianWithBackground.h: interface for the FittingFunctionLorentzianWithBackground class.
00002 //
00004 
00005 #if !defined(AFX_FITTINGFUNCTIONLORENTZIANWITHBACKGROUND_H__6F71713F_92F5_4D1F_8E75_E95C70E124FF__INCLUDED_)
00006 #define AFX_FITTINGFUNCTIONLORENTZIANWITHBACKGROUND_H__6F71713F_92F5_4D1F_8E75_E95C70E124FF__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 #include "FittingFunction.h"
00013 
00014 #define SEARCH_LIMIT            1.0E-4
00015 #define NB_ITERATION_MAX        100
00016 
00017 //##ModelId=43849A0202D4
00018 class FittingFunctionLorentzianWithBackground : public FittingFunction  
00019 {
00020 public:
00021         
00022         //##ModelId=43849A0202D6
00023         FittingFunctionLorentzianWithBackground();
00024         //##ModelId=43849A0202D7
00025         FittingFunctionLorentzianWithBackground(long lNbIteration,double dLimitSearch); 
00026         //##ModelId=43849A0202DA
00027         virtual ~FittingFunctionLorentzianWithBackground();
00028 
00029         //##ModelId=43849A0202DC
00030         virtual PtrFunction                             getFunction() const;
00031         //##ModelId=43849A0202E5
00032         virtual PtrFunctionDerivate             getFunctionDerivate() const; 
00033         //##ModelId=43849A0202E7
00034         virtual PtrFunctionAndDerivate  getFunctionAndDerivate() const;
00035         
00036         //##ModelId=43849A0202E9
00037         static int Function                             (const gsl_vector *peak_params, void *calc_data, gsl_vector *func);
00038         //##ModelId=43849A0202EE
00039         static int FunctionDerivate             (const gsl_vector *peak_params, void *calc_data, gsl_matrix *Jacobian);
00040         //##ModelId=43849A0202F6
00041         static int FunctionAndDerivate  (const gsl_vector *peak_params, void *calc_data ,gsl_vector *func, gsl_matrix *Jacobian);
00042         
00043         //##ModelId=43849A0202FC
00044         virtual int doFit(long points, gsl_vector *x,gsl_vector *y,gsl_vector *sigma, gsl_vector *guess,  bool bEstimateGuess,int iSearchStoppingMethod=1, bool bUseScaled=true);
00045         //##ModelId=43849A02030A
00046         virtual int generateFunctionFit(double dValMinX,double dResolutionX,long lNbPoints,gsl_vector* funcX,gsl_vector* funcY);
00047         virtual int generateFunctionFit(long lNbPoints, gsl_vector *x, gsl_vector* funcX,gsl_vector* funcY);
00048         //##ModelId=43849A020315
00049         void printState (size_t iter, gsl_multifit_fdfsolver * s);
00050         //##ModelId=43849A020318
00051         void printResults();
00052                 
00053         double  computeValue(double dX,double dPosition, double dWidth, double dHeight, double dBackground);
00054         double  computeDerivateValue(double dX,double dPosition, double dWidth, double dHeight);
00055 
00056 
00057         void    initializeInitialsParameters(gsl_vector* vExperimentalDataX,gsl_vector* vExperimentalDataY,gsl_vector* vInitialGuess,bool bEstimate);
00058         void    estimateInitialGuess(gsl_vector* vExperimentalDataX,gsl_vector* vExperimentalDataY);
00059 
00060         double  estimateInitialPosition(gsl_vector *vExperimentalDataX, gsl_vector *vExperimentalDataY);
00061         double  estimateInitialSigma(gsl_vector *vExperimentalDataX, gsl_vector *vExperimentalDataY);
00062         double  estimateInitialHeight(gsl_vector *vExperimentalDataX, gsl_vector *vExperimentalDataY);
00063         double  estimateInitialBackground(gsl_vector *vExperimentalDataX, gsl_vector *vExperimentalDataY);
00064 
00065         std::string     getEquation() const;
00066 };
00067 
00068 #endif // !defined(AFX_FITTINGFUNCTIONLORENTZIANWITHBACKGROUND_H__6F71713F_92F5_4D1F_8E75_E95C70E124FF__INCLUDED_)

Generated on Tue Apr 14 09:34:28 2009 for Data Fitting Library by  doxygen 1.4.5