SciDAVis  1.D4
Public Member Functions | Private Member Functions
LorentzFit Class Reference

#include <MultiPeakFit.h>

Inheritance diagram for LorentzFit:
MultiPeakFit Fit Filter scripted

List of all members.

Public Member Functions

 LorentzFit (ApplicationWindow *parent, Graph *g)
 LorentzFit (ApplicationWindow *parent, Graph *g, const QString &curveTitle)
 LorentzFit (ApplicationWindow *parent, Graph *g, const QString &curveTitle, double start, double end)
- Public Member Functions inherited from MultiPeakFit
void enablePeakCurves (bool on)
 MultiPeakFit (ApplicationWindow *parent, Graph *g=0, PeakProfile profile=Gauss, int peaks=1)
int peaks ()
void setNumPeaks (int n)
void setPeakCurvesColor (int colorIndex)
- Public Member Functions inherited from Fit
double chiSquare ()
 Returns the sum of squares of the residuals from the best-fit line.
MatrixcovarianceMatrix (const QString &matrixName)
double * errors ()
 Returns a vector with the standard deviations of the results.
double evaluate_d (const gsl_vector *x)
int evaluate_df (const gsl_vector *x, gsl_matrix *J)
int evaluate_f (const gsl_vector *x, gsl_vector *f)
 Fit (ApplicationWindow *parent, Graph *g=0, const char *name=0)
virtual void fit ()
 Actually does the fit. Should be reimplemented in derived classes.
QString formula ()
void generateFunction (bool yes, int points=100)
 Specifies weather the result of the fit is a function curve.
virtual QString legendInfo ()
 Output string added to the plot as a new legend.
int numParameters ()
TableparametersTable (const QString &tableName)
double * results ()
 Returns a vector with the fit results.
double rSquare ()
 Returns the coefficient of determination, R^2.
void scaleErrors (bool yes=true)
 Specifies wheather the errors must be scaled with sqrt(chi_2/dof)
void setAlgorithm (Algorithm s)
void setDataCurve (int curve, double start, double end)
void setInitialGuess (int parIndex, double val)
void setInitialGuesses (double *x_init)
bool setYErrorSource (ErrorSource err, const QString &colName=QString::null, bool fail_silently=false)
 Sets the data set to be used as source of Y errors.
 ~Fit ()
- Public Member Functions inherited from Filter
int dataSize ()
 Returns the size of the fitted data set.
bool error ()
 Filter (ApplicationWindow *parent, Table *t=0, const char *name=0)
 Filter (ApplicationWindow *parent, Graph *g=0, const char *name=0)
virtual bool run ()
 Actually does the job. Should be reimplemented in derived classes.
void setColor (int colorId)
 Sets the color of the output fit curve.
void setColor (const QString &colorName)
 Sets the color of the output fit curve. Provided for convenience. To be used in scripts only!
bool setDataFromCurve (const QString &curveTitle, Graph *g=0)
bool setDataFromCurve (const QString &curveTitle, double from, double to, Graph *g=0)
void setInterval (double from, double to)
 Changes the data range if the source curve was already assigned. Provided for convenience.
void setMaximumIterations (int iter)
 Sets the maximum number of iterations to be performed during an iterative session.
void setOutputPoints (int points)
 Sets the number of points in the output curve.
void setOutputPrecision (int digits)
 Sets the precision used for the output.
void setTolerance (double eps)
 Sets the tolerance used by the GSL routines.
virtual void showLegend ()
 Adds a new legend to the plot. Calls virtual legendInfo()
 ~Filter ()
- Public Member Functions inherited from scripted
 scripted (ScriptingEnv *env)
void scriptingChangeEvent (ScriptingChangeEvent *)
 ~scripted ()

Private Member Functions

void init ()

Additional Inherited Members

- Public Types inherited from MultiPeakFit
enum  PeakProfile { Gauss, Lorentz }
- Public Types inherited from Fit
enum  Algorithm { ScaledLevenbergMarquardt, UnscaledLevenbergMarquardt, NelderMeadSimplex }
enum  ErrorSource { UnknownErrors, AssociatedErrors, PoissonErrors, CustomErrors }
typedef int(* fit_function )(const gsl_vector *, void *, gsl_vector *)
typedef int(* fit_function_df )(const gsl_vector *, void *, gsl_matrix *)
typedef int(* fit_function_fdf )(const gsl_vector *, void *, gsl_vector *, gsl_matrix *)
typedef double(* fit_function_simplex )(const gsl_vector *, void *)
- Static Public Member Functions inherited from MultiPeakFit
static QStringList generateExplanationList (int order)
static QString generateFormula (int order, PeakProfile profile)
static QStringList generateParameterList (int order)
- Static Public Member Functions inherited from Fit
static double evaluate_df_helper (double x, void *param)
- Protected Member Functions inherited from MultiPeakFit
void guessInitialValues ()
 Used by the GaussFit and LorentzFit derived classes to calculate initial values for the parameters.
- Protected Member Functions inherited from Fit
virtual void calculateFitCurveData (double *par, double *X, double *Y)
 Calculates the data for the output fit curve and store itin the X an Y vectors.
void insertFitFunctionCurve (const QString &name, double *x, double *y, int penWidth=1)
 Adds the result curve as a FunctionCurve to the plot, if d_gen_function = true.
- Protected Member Functions inherited from Filter
QwtPlotCurve * addResultCurve (double *x, double *y)
 Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.
virtual void calculateOutputData (double *X, double *Y)
 Calculates the data for the output curve and store it in the X an Y vectors.
int curveIndex (const QString &curveTitle, Graph *g)
 Performs checks and returns the index of the source data curve if OK, -1 otherwise.
virtual bool isDataAcceptable ()
virtual QString logInfo ()
 Output string added to the log pannel of the application.
virtual void output ()
 Performs the data analysis and takes care of the output.

Constructor & Destructor Documentation

LorentzFit::LorentzFit ( ApplicationWindow parent,
Graph g 
)

References init().

LorentzFit::LorentzFit ( ApplicationWindow parent,
Graph g,
const QString &  curveTitle 
)
LorentzFit::LorentzFit ( ApplicationWindow parent,
Graph g,
const QString &  curveTitle,
double  start,
double  end 
)

Member Function Documentation

void LorentzFit::init ( )
private

Reimplemented from Filter.

References Filter::d_explanation, and Fit::d_param_explain.

Referenced by LorentzFit().


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