27#ifndef fitExpModGaussian_hpp
28#define fitExpModGaussian_hpp
40template <
typename realT>
64template <
typename fitterT>
69 typedef typename fitterT::realT realT;
71 static const int nparams = fitterT::nparams;
97 static_assert( nparams == 4,
"fitExpModGaussian: Wrong setGuess called for no location parameter." );
111 static_assert( nparams == 3,
"fitExpModGaussian: Wrong setGuess called for no location parameter." );
118 void setArray( realT *data,
int n )
141 void sigma( realT ns )
147 void lambda( realT nl )
189template <
typename realT>
207template <
typename _realT>
210 typedef _realT realT;
212 static const int nparams = 3;
214 static void func( realT *p, realT *hx,
int m,
int n,
void *adata )
218 for(
int i = 0; i < arr->
n; i++ )
231template <
typename _realT>
234 typedef _realT realT;
236 static const int nparams = 4;
238 static void func( realT *p, realT *hx,
int m,
int n,
void *adata )
242 for(
int i = 0; i < arr->
n; i++ )
void setGuess(realT mu, realT sigma, realT lambda)
Set the initial guess.
void setGuess(realT G0, realT mu, realT sigma, realT lambda)
Set the initial guess.
int fit()
Perform the fit.
void allocate_params()
Allocate parameters array based on previous call to nParams.
realT * p
Parameter array. On input is the initial estimates. On output has the estimated solution.
int n
I: measurement vector dimension.
levmarInterface()
Default constructor.
void * adata
Pointer to possibly additional data, passed uninterpreted to func & jacf.
The Exponentially Modified Gaussian distribution.
realT expModGaussian(realT x, realT mu, realT sigma, realT lambda)
The Exponentially Modified Gaussian at a point.
A c++ interface to the templatized levmar minimization routines..
Wrapper for a native array to pass to levmarInterface, with Exponentially Modified Gaussian details.
size_t n
dimension of the array
realT lambda
the denominator or 1/peak-scale
realT G0
the location parameter.
realT * data
Pointer to the array.
realT sigma
the scale parameter
realT mu
the shape parameter
levmarInterface fitter structure for the Exponentially Modified Gaussian with fixed constant level.
levmarInterface fitter structure for the Exponentially Modified Gaussian with arbitrary constant leve...