My Project
 All Classes Functions Variables Pages
Public Slots | Signals | Public Member Functions | List of all members
fitthread Class Reference

thread class to perform fitting and error calculation tasks More...

#include <fitthread.h>

Inheritance diagram for fitthread:
Inheritance graph
[legend]
Collaboration diagram for fitthread:
Collaboration graph
[legend]

Public Slots

void stop_calculations ()
 
void paraboloid (double **x, double *y, int N, int points, double *fxy)
 fits a dim-dimensional paraboloid centered at zero at points x, UNUSED More...
 

Signals

void refresh_progress (int ID, int citer, double chi2)
 progressbar in fitmodel should be updated
 
void finished (int ID)
 calculation is finished
 
void error_message (int runi, QString message)
 fitmodel instance should print error message
 

Public Member Functions

void run ()
 
void exit ()
 
 fitthread (double *para, int *changed, double *errors, int cpara, double(*f)(void *), void *instance, int MaxIter, double conv, bool forceSimplex)
 global fitting More...
 
 fitthread (double *para, int runi, double *errors, int cpara, double(*f)(void *, int), void *instance, int MaxIter, double conv)
 seriell fitting More...
 
 fitthread (double *para, int *changed, double *errors, int cpara, double(*chi2)(void *), void *instance, ErrMod mode, double(*fitting)(void *), int MonteCarloIterations, int crun, int cglobal, bool(*correlated)(void *, int, int))
 global error calculation More...
 
 fitthread (double *para, int runi, double *errors, int cpara, double(*chi2)(void *, int), void *instance, ErrMod mode, int MonteCarloIterations)
 global error calculation
 
void errors_covariant ()
 see ErrMod
 
void errors_MonteCarlo (double pdfmin, double sigmac)
 see ErrMod More...
 
void errors_uncorrelated (bool EmitSignals)
 see ErrMod, EmitSignals may suppress Progressbar update at internal use
 
void errors_MINOS ()
 see ErrMod
 

Detailed Description

thread class to perform fitting and error calculation tasks

Moessfit uses multithreading to efficiently fit and error calculate the data which usually consists of several runs. Multithreading is organized in the following way:
(1) seriell fitting: the model specified by the user uses run specific parameters only. Then every run can be calculated individually (=seriell), no data is shared. For every run a fitthread will be created. All fitthread can work paralell.
(2) global fitting: only one fitthread is used, multithreading is not used by using several fitthreads, but within fitmodel using QtConcurrent to calculate the spectra individually, if the global model has to be updated

A fitthread knows the data to manipulate (which is owned by a fitmodel) and a function to recalculate the related fitmodel and get an updated chi2 value.

Constructor & Destructor Documentation

fitthread::fitthread ( double *  para,
int *  changed,
double *  errors,
int  cpara,
double(*)(void *)  f,
void *  instance,
int  MaxIter,
double  conv,
bool  forceSimplex 
)

global fitting

Parameters
para,:parameters to be changed
changed,:help array to indicate if a parameter was changed
errors,:intial step sizes
cpara,:parameter count
instance,:fitmodel instance, is owner and used to recalculate
MaxIter,:maximum iteration count
conv,:convergence criterium
forceSimplex,:use GSL Simplex minimizer instead internal one
fitthread::fitthread ( double *  para,
int  runi,
double *  errors,
int  cpara,
double(*)(void *, int)  f,
void *  instance,
int  MaxIter,
double  conv 
)

seriell fitting

Parameters
runi,:run index in fitmodel
for other parameters see first constructor
fitthread::fitthread ( double *  para,
int *  changed,
double *  errors,
int  cpara,
double(*)(void *)  chi2,
void *  instance,
ErrMod  mode,
double(*)(void *)  fitting,
int  MonteCarloIterations,
int  crun,
int  cglobal,
bool(*)(void *, int, int)  correlated 
)

global error calculation

Parameters
MonteCarloIterations,:sample count to be probed
crun,:run count
cglobal,:global parameter count
correlated,:for other parameters see first constructor

Member Function Documentation

void fitthread::errors_MonteCarlo ( double  pdfmin,
double  sigmac 
)

see ErrMod

Parameters
sigma,:is the multiplier to uncorrelated error intervall. The region to probe is defined by these extended intervalls
void fitthread::paraboloid ( double **  x,
double *  y,
int  N,
int  points,
double *  fxy 
)
slot

fits a dim-dimensional paraboloid centered at zero at points x, UNUSED

x is points*dim array holding the arguments, y are the function values at x (a points-dimensional vetctor and fxy returns the elements of the Hesse Matrix H in the following order: fx = (f11, f12, f13 ..., f22, f23,...,fNN)) The data can be used in a quadradic model: f(x) = 0.5*xHx


The documentation for this class was generated from the following files: