Isis Developer 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.
 

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

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

References _FILEINFO_, 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

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

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

References realLinearRoots().

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


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