Isis 3 Programmer Reference
Isis::FunctionTools Class Reference

A collection of tools for mathmatical function root finding, maximization, etc (eventually) This class contains only static methods, and cannot be instantiated. More...

#include <FunctionTools.h>

Collaboration diagram for Isis::FunctionTools:
Collaboration graph

Static Public Member Functions

static QList< double > realLinearRoots (double coeffLinearTerm, double coeffConstTerm)
 Find the real roots (0 or 1) of a linear equation Form: coeffLinearTerm*X + coeffConstTerm = 0.0 NOTE: in the case of infinite roots an empty set is returned.
 
static QList< double > realQuadraticRoots (double coeffQuadTerm, double coeffLinearTerm, double coeffConstTerm)
 The correct way to find the real roots of a quadratic (0, 1, or 2) (according to numerical recipies 3rd edtion page 227).
 
static QList< double > realCubicRoots (double coeffCubicTerm, double coeffQuadTerm, double coeffLinearTerm, double coeffConstTerm)
 Find the real roots of a cubic (1, 2, or 3) (see numerical recipies 3rd edtion page 227) Form: coeffCubicTerm*X^3 + coeffQuadTerm*X^2 + coeffLinearTerm*X + coeffConstTerm = 0.0.
 
template<typename Functor >
static bool brentsRootFinder (Functor &func, const QList< double > pt1, const QList< double > pt2, double tol, int maxIter, double &root)
 Van Wijngaarden-Dekker-Brent Method for root finding on a discreetly defined function meaning that we can evaluate the function for discreet points, but we lack a global function and derivative definitions.
 

Private Member Functions

 FunctionTools ()
 Constructor.
 
 ~FunctionTools ()
 destructor
 

Detailed Description

A collection of tools for mathmatical function root finding, maximization, etc (eventually) This class contains only static methods, and cannot be instantiated.

Author
2012-05-07 Orrin Thomas
History

2012-05-07 Orrin Thomas - Original version

2012-06-22 Orrin Thomas - Added realLinearRoots, realQuadraticRoots, and realCubicRoots

Definition at line 37 of file FunctionTools.h.

Constructor & Destructor Documentation

◆ FunctionTools()

Isis::FunctionTools::FunctionTools ( )
private

Constructor.

This is private and left undefined so this class cannot be instaniated. The functions are static and are intended to be used without an instance of the class.

◆ ~FunctionTools()

Isis::FunctionTools::~FunctionTools ( )
private

destructor

This is private and to left undefined so this class cannot be instaniated

Member Function Documentation

◆ brentsRootFinder()

template<typename Functor >
static bool Isis::FunctionTools::brentsRootFinder ( Functor & func,
const QList< double > pt1,
const QList< double > pt2,
double tol,
int maxIter,
double & root )
inlinestatic

Van Wijngaarden-Dekker-Brent Method for root finding on a discreetly defined function meaning that we can evaluate the function for discreet points, but we lack a global function and derivative definitions.

See Numerical Recipes 3rd eddition pages 454-456.

This method requires that the root be bounded on the interval [pt1,pt2], and is gaurenteed to convege a root (by Brent) in the interval as long the function is continous and can evaluated on that interval.

Note that if there are multiple roots on the interval the function will find one of them and there is no particular gaurentee which one. Note, also that I have changed the convergance criteria to enforce the nearness of the function to zero rather than the precision of the root.

Parameters
functemplate parameter that must have a double operator()(double) defined
pt1one of the already defined points (x, y) that bracket the root
pt2one of the already defined points (x, y) that bracket the root
tolhow close to zero the function must come before iterations stop
maxiterthe maximum number of iterations before stoping the root search
rootthe returned root (if any)
Returns
bool true if the solution converged, false otherwise

Definition at line 176 of file FunctionTools.h.

References Isis::IException::Programmer, and Isis::toString().

◆ realCubicRoots()

static QList< double > Isis::FunctionTools::realCubicRoots ( double coeffCubicTerm,
double coeffQuadTerm,
double coeffLinearTerm,
double coeffConstTerm )
inlinestatic

Find the real roots of a cubic (1, 2, or 3) (see numerical recipies 3rd edtion page 227) Form: coeffCubicTerm*X^3 + coeffQuadTerm*X^2 + coeffLinearTerm*X + coeffConstTerm = 0.0.

Parameters
coeffCubicTermcoefficient of the cubic term
coeffQuadTermcoefficient of the quadratic term
coefflinearTermcoefficient of the linear term
coeffConstTermcoefficient of the constant term

Definition at line 106 of file FunctionTools.h.

References realQuadraticRoots(), and Isis::TWOPI.

Referenced by Isis::KaguyaMiCameraDistortionMap::SetUndistortedFocalPlane().

◆ realLinearRoots()

static QList< double > Isis::FunctionTools::realLinearRoots ( double coeffLinearTerm,
double coeffConstTerm )
inlinestatic

Find the real roots (0 or 1) of a linear equation Form: coeffLinearTerm*X + coeffConstTerm = 0.0 NOTE: in the case of infinite roots an empty set is returned.

Parameters
coefflinearTermcoefficient of the linear term
coeffConstTermcoefficient of the constant term

Definition at line 48 of file FunctionTools.h.

Referenced by realQuadraticRoots().

◆ realQuadraticRoots()

static QList< double > Isis::FunctionTools::realQuadraticRoots ( double coeffQuadTerm,
double coeffLinearTerm,
double coeffConstTerm )
inlinestatic

The correct way to find the real roots of a quadratic (0, 1, or 2) (according to numerical recipies 3rd edtion page 227).

Form: coeffQuadTerm*X^2 + coeffLinearTerm*X + coeffConstTerm = 0.0

Parameters
coeffQuadTermcoefficient of the quadratic term
coefflinearTermcoefficient of the linear term
coeffConstTermcoefficient of the constant term

Definition at line 71 of file FunctionTools.h.

References realLinearRoots().

Referenced by realCubicRoots(), and Isis::KaguyaMiCameraDistortionMap::SetUndistortedFocalPlane().


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