Isis 3 Developer 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>
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. More... | |
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). More... | |
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. More... | |
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. More... | |
A collection of tools for mathmatical function root finding, maximization, etc (eventually) This class contains only static methods, and cannot be instantiated.
|
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.
func | template parameter that must have a double operator()(double) defined |
pt1 | one of the already defined points (x, y) that bracket the root |
pt2 | one of the already defined points (x, y) that bracket the root |
tol | how close to zero the function must come before iterations stop |
maxiter | the maximum number of iterations before stoping the root search |
root | the returned root (if any) |
References _FILEINFO_, Isis::IException::Programmer, and Isis::toString().
|
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.
coeffCubicTerm | coefficient of the cubic term |
coeffQuadTerm | coefficient of the quadratic term |
coefflinearTerm | coefficient of the linear term |
coeffConstTerm | coefficient of the constant term |
References realQuadraticRoots(), and Isis::TWOPI.
Referenced by Isis::KaguyaMiCameraDistortionMap::SetUndistortedFocalPlane().
|
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.
coefflinearTerm | coefficient of the linear term |
coeffConstTerm | coefficient of the constant term |
Referenced by realQuadraticRoots().
|
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
coeffQuadTerm | coefficient of the quadratic term |
coefflinearTerm | coefficient of the linear term |
coeffConstTerm | coefficient of the constant term |
References realLinearRoots().
Referenced by realCubicRoots(), and Isis::KaguyaMiCameraDistortionMap::SetUndistortedFocalPlane().