Isis 3 Programmer Reference
Isis::NonLinearLSQ Class Referenceabstract

NonLinearLSQ Computes a fit using a Levenberg-Marquardt algorithm. More...

#include <NonLinearLSQ.h>

Inheritance diagram for Isis::NonLinearLSQ:
Inheritance graph
Collaboration diagram for Isis::NonLinearLSQ:
Collaboration graph

Classes

struct  _nlsqPointer
 

Public Types

typedef TNT::Array1D< double > NLVector
 
typedef TNT::Array2D< double > NLMatrix
 

Public Member Functions

virtual ~NonLinearLSQ ()
 Destructor. More...
 
virtual int nSize () const =0
 
virtual int nParms () const =0
 
void setMaxIters (int m)
 Sets the maximum number of iterations. More...
 
int maxIters () const
 Maximum number iterations for valid solution. More...
 
virtual NLVector guess ()=0
 
virtual NLVector f_x (const NLVector &x)=0
 
virtual NLMatrix df_x (const NLVector &x)=0
 
virtual double absErr () const
 
virtual double relErr () const
 
int curvefit ()
 
int status () const
 Return status of last fit processing. More...
 
bool success () const
 Determine success from last fit processing. More...
 
bool success (int status) const
 Check status for success of the given condition. More...
 
std::string statusstr () const
 Return error message pertaining to last fit procesing. More...
 
std::string statusstr (int status) const
 Return error message given status condition. More...
 
virtual int checkIteration (const int Iter, const NLVector &fitcoefs, const NLVector &uncerts, double cplxconj, int Istatus)
 Default interation test simply returns input status. More...
 
NLVector coefs () const
 Return coefficients from last fit processing. More...
 
NLVector uncert () const
 Return uncertainties from last fit processing. More...
 
int nIterations () const
 Return number of iterations from last fit processing. More...
 

Protected Member Functions

void Terminate (const std::string &message="")
 
void Abort (const std::string &reason="")
 
bool doContinue () const
 

Private Member Functions

NLVector gslToNlsq (const gsl_vector *v) const
 
NLMatrix gslToNlsq (const gsl_matrix *m) const
 
gsl_vector * NlsqTogsl (const NLVector &v, gsl_vector *gv=0) const
 
gsl_matrix * NlsqTogsl (const NLMatrix &m, gsl_matrix *gm=0) const
 
NLVector getUncertainty (const gsl_matrix *m) const
 

Static Private Member Functions

static int f (const gsl_vector *x, void *params, gsl_vector *fx)
 
static int df (const gsl_vector *x, void *params, gsl_matrix *J)
 
static int fdf (const gsl_vector *x, void *params, gsl_vector *fx, gsl_matrix *J)
 

Private Attributes

NLVector _fitParms
 
NLVector _uncert
 
int _nIters
 
int _maxIters
 
int _status
 
bool _userTerminated
 
std::string _userMessage
 

Detailed Description

NonLinearLSQ Computes a fit using a Levenberg-Marquardt algorithm.

This virtual base class uses the GSL toolkit to apply the Levenberg-Marquardt algorithm to fit data to a non-linear equation using least squares.

Author
2007-11-15 Kris Becker

Definition at line 57 of file NonLinearLSQ.h.

Constructor & Destructor Documentation

◆ ~NonLinearLSQ()

virtual Isis::NonLinearLSQ::~NonLinearLSQ ( )
inlinevirtual

Destructor.

Definition at line 67 of file NonLinearLSQ.h.

Member Function Documentation

◆ checkIteration()

virtual int Isis::NonLinearLSQ::checkIteration ( const int  Iter,
const NLVector &  fitcoefs,
const NLVector &  uncerts,
double  cplxconj,
int  Istatus 
)
inlinevirtual

Default interation test simply returns input status.

Reimplemented in Isis::ZeroBufferFit.

Definition at line 111 of file NonLinearLSQ.h.

◆ coefs()

NLVector Isis::NonLinearLSQ::coefs ( ) const
inline

Return coefficients from last fit processing.

Definition at line 118 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::Solve().

◆ maxIters()

int Isis::NonLinearLSQ::maxIters ( ) const
inline

Maximum number iterations for valid solution.

Returns
int Maximum resolutions

Definition at line 85 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::ZeroBufferFit().

◆ nIterations()

int Isis::NonLinearLSQ::nIterations ( ) const
inline

Return number of iterations from last fit processing.

Definition at line 122 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::Solve().

◆ setMaxIters()

void Isis::NonLinearLSQ::setMaxIters ( int  m)
inline

Sets the maximum number of iterations.

Parameters
mUser provides the maximum number iterations

Definition at line 77 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::ZeroBufferFit().

◆ status()

int Isis::NonLinearLSQ::status ( ) const
inline

Return status of last fit processing.

Definition at line 96 of file NonLinearLSQ.h.

Referenced by statusstr(), and success().

◆ statusstr() [1/2]

std::string Isis::NonLinearLSQ::statusstr ( ) const
inline

Return error message pertaining to last fit procesing.

Definition at line 102 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::Solve().

◆ statusstr() [2/2]

std::string Isis::NonLinearLSQ::statusstr ( int  status) const
inline

Return error message given status condition.

Definition at line 106 of file NonLinearLSQ.h.

References status().

◆ success() [1/2]

bool Isis::NonLinearLSQ::success ( ) const
inline

Determine success from last fit processing.

Definition at line 98 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::Solve().

◆ success() [2/2]

bool Isis::NonLinearLSQ::success ( int  status) const
inline

Check status for success of the given condition.

Definition at line 100 of file NonLinearLSQ.h.

References status().

◆ uncert()

NLVector Isis::NonLinearLSQ::uncert ( ) const
inline

Return uncertainties from last fit processing.

Definition at line 120 of file NonLinearLSQ.h.

Referenced by Isis::ZeroBufferFit::Solve().


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