40template <
typename realT>
64template <
typename fitterT>
69 typedef typename fitterT::realT realT;
71 static const int nparams = fitterT::nparams;
96 static_assert( nparams == 3,
"fitWeibull: Wrong setGuess called for no location parameter." );
108 static_assert( nparams == 2,
"fitWeibull: Wrong setGuess called for location parameter." );
114 void setArray( realT *data,
int n )
137 void lambda( realT nl )
174template <
typename realT>
191template <
typename _realT>
194 typedef _realT realT;
196 static const int nparams = 3;
198 static void func( realT *p, realT *hx,
int m,
int n,
void *adata )
202 for(
int i = 0; i < arr->
n; i++ )
215template <
typename _realT>
218 typedef _realT realT;
220 static const int nparams = 2;
222 static void func( realT *p, realT *hx,
int m,
int n,
void *adata )
226 for(
int i = 0; i < arr->
n; i++ )
void setGuess(realT k, realT lambda)
Set the initial guess when platescale and central obscuration are fixed.
void setGuess(realT x0, realT k, realT lambda)
Set the initial guess when platescale and central obscuration are fixed.
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.
realT weibull(realT x, realT x0, realT k, realT lambda)
The general shifted Weibull distribution at a point.
A c++ interface to the templatized levmar minimization routines..
Wrapper for a native array to pass to levmarInterface, with Weibull details.
realT x0
the location parameter.
size_t n
dimension of the array
realT k
the shape parameter
realT lambda
the scale parameter
realT * data
Pointer to the array.
levmarInterface fitter structure for the shifted Weibull Distribution
levmarInterface fitter structure for the shifted Weibull Distribution
The Weibull distribution.