Isis Developer Reference
|
This class extends Isis::NumericalApproximation. More...
#include <NumericalAtmosApprox.h>
Public Types | |
enum | IntegFunc { OuterFunction , InnerFunction } |
This enum defines function to be integrated by Romberg's method. More... | |
enum | InterpType { Linear , Polynomial , PolynomialNeville , CubicNatural , CubicClamped , CubicNatPeriodic , CubicNeighborhood , CubicHermite , Akima , AkimaPeriodic } |
This enum defines the types of interpolation supported in this class. More... | |
enum | ExtrapType { ThrowError , Extrapolate , NearestEndpoint } |
This enum defines the manner in which a value outside of the domain should be handled if passed to the Evaluate() method. More... | |
Public Member Functions | |
NumericalAtmosApprox (const NumericalApproximation::InterpType &itype=CubicNatural) | |
Uses Isis::NumericalApproximation constructor. | |
virtual | ~NumericalAtmosApprox () |
Empty destructor. | |
double | RombergsMethod (AtmosModel *am, IntegFunc sub, double a, double b) |
This variation on the NumericalApproximation method integrates a specified AtmosModel function rather than an interpolated function based on a data set. | |
double | RefineExtendedTrap (AtmosModel *am, IntegFunc sub, double a, double b, double s, unsigned int n) |
This variation on the NumericalApproximation method integrates a specified AtmosModel function rather than an interpolated function based on a data set. | |
string | Name () const |
Get name of interpolating function assigned to object. | |
InterpType | InterpolationType () |
Returns the enumerated type of interpolation chosen. | |
int | MinPoints () |
Minimum number of points required by interpolating function. | |
int | MinPoints (NumericalApproximation::InterpType itype) |
Minimum number of points required by interpolating function. | |
void | AddData (const double x, const double y) |
Add a datapoint to the set. | |
void | AddData (unsigned int n, double *x, double *y) |
Add set of points to the data set using pointer arrays. | |
void | AddData (const vector< double > &x, const vector< double > &y) |
Add set of points to the data set using vectors. | |
void | SetCubicClampedEndptDeriv (const double yp1, const double ypn) |
Sets the values for the first derivatives of the endpoints of the data set. | |
void | AddCubicHermiteDeriv (unsigned int n, double *fprimeOfx) |
Adds values for the first derivatives of the data points. | |
void | AddCubicHermiteDeriv (const vector< double > &fprimeOfx) |
Adds values for the first derivatives of the data points. | |
void | AddCubicHermiteDeriv (const double fprimeOfx) |
Adds value of a first derivative of a data point. | |
double | DomainMinimum () |
Input data domain minimum value. | |
double | DomainMaximum () |
Input data domain maximum value. | |
bool | Contains (double x) |
Returns whether the passed value is an element of the set of x-values in the data set. | |
unsigned int | Size () |
Returns the number of the coordinates added to the data set. | |
double | Evaluate (const double a, const ExtrapType &etype=ThrowError) |
Calculates interpolated or extrapolated value of tabulated data set for given domain value. | |
vector< double > | Evaluate (const vector< double > &a, const ExtrapType &etype=ThrowError) |
Calculates interpolated value for given set of domain values. | |
vector< double > | PolynomialNevilleErrorEstimate () |
Retrieves the error estimate for the Neville's polynomial interpolation type. | |
vector< double > | CubicClampedSecondDerivatives () |
Retrieves the second derivatives of the data set. | |
double | EvaluateCubicHermiteFirstDeriv (const double a) |
Approximates the first derivative of the data set function evaluated at the given domain value for CubicHermite interpolation type. | |
double | EvaluateCubicHermiteSecDeriv (const double a) |
Approximates the second derivative of the data set function evaluated at the given domain value for CubicHermite interpolation type. | |
double | GslFirstDerivative (const double a) |
Approximates the first derivative of the data set function evaluated at the given domain value for GSL supported interpolation types. | |
double | BackwardFirstDifference (const double a, const unsigned int n=3, const double h=0.1) |
Uses an n point backward first difference formula to approximate the first derivative evaluated at a given domain value. | |
double | ForwardFirstDifference (const double a, const unsigned int n=3, const double h=0.1) |
Uses an n point forward first difference formula to approximate the first derivative evaluated at a given domain value. | |
double | CenterFirstDifference (const double a, const unsigned int n=5, const double h=0.1) |
Uses an n point center first difference formula to approximate the first derivative evaluated at a given domain value. | |
double | GslSecondDerivative (const double a) |
Approximates the second derivative of the interpolated data set function evaluated at the given domain value for GSL supported interpolation types. | |
double | BackwardSecondDifference (const double a, const unsigned int n=3, const double h=0.1) |
Uses an n point backward second difference formula to approximate the second derivative evaluated at a given domain value. | |
double | ForwardSecondDifference (const double a, const unsigned int n=3, const double h=0.1) |
Uses an n point forward second difference formula to approximate the second derivative evaluated at a given domain value. | |
double | CenterSecondDifference (const double a, const unsigned int n=5, const double h=0.1) |
Uses an n point center second difference formula to approximate the second derivative evaluated at a given domain value. | |
double | GslIntegral (const double a, const double b) |
Approximates the integral of the data set function evaluated on the given interval for GSL supported interpolation types. | |
double | TrapezoidalRule (const double a, const double b) |
Uses the trapezoidal rule to approximate the integral of the interpolated data set function on the interval (a, b). | |
double | Simpsons3PointRule (const double a, const double b) |
Uses Simpson's 3-point rule to approximate the integral of the interpolated data set function on the interval (a,b). | |
double | Simpsons4PointRule (const double a, const double b) |
Uses Simpson's 4-point rule to approximate the integral of the interpolated data set function on the interval (a,b). | |
double | BoolesRule (const double a, const double b) |
Uses Boole's Rule to approximate the integral of the interpolated data set function on the interval (a,b). | |
double | RefineExtendedTrap (double a, double b, double s, unsigned int n) |
Calculates refinements extended trapezoidal rule to approximate the integral of the interpolated data set function on the interval (a,b). | |
double | RombergsMethod (double a, double b) |
Uses Romberg's method to approximate the integral of the interpolated data set function on the interval (a,b). | |
void | Reset () |
Resets the state of the object. | |
void | Reset (NumericalApproximation::InterpType itype) |
Resets the state of the object and resets interpolation type. | |
void | SetInterpType (NumericalApproximation::InterpType itype) |
Sets interpolation type. | |
Static Public Member Functions | |
static double | OutrFunc2Bint (AtmosModel *am, double phi) |
This function is the outer integrand over mu at specified phi. | |
static double | InrFunc2Bint (AtmosModel *am, double mu) |
Inner function to be integrated. | |
Protected Types | |
typedef const gsl_interp_type * | InterpFunctor |
GSL Interpolation specs. | |
typedef map< InterpType, InterpFunctor > | FunctorList |
Set up a std::map of GSL interpolator functors. List of function types. | |
typedef FunctorList::const_iterator | FunctorConstIter |
GSL Iterator. | |
Protected Member Functions | |
void | Init (NumericalApproximation::InterpType itype) |
Initializes the object upon instantiation. | |
bool | GslInterpType (NumericalApproximation::InterpType itype) const |
Returns whether an interpolation type is adapted from the GSL library. | |
void | GslAllocation (unsigned int npoints) |
Allocates GSL interpolation functions. | |
void | GslDeallocation () |
Deallocate GSL interpolator resources, if used. | |
InterpFunctor | GslFunctor (NumericalApproximation::InterpType itype) const |
Search for a GSL interpolation function. | |
void | GslIntegrityCheck (int gsl_status, const char *src, int line) |
Checks the status of the GSL interpolation operations. | |
void | ValidateDataSet () |
Validates the data set before computing interpolation. | |
bool | InsideDomain (const double a) |
Returns whether the passed value is greater than or equal to the domain minimum and less than or equal to the domain maximum. | |
bool | GslComputed () const |
Returns whether a GSL interpolation computation of the data set has been performed. | |
void | ComputeGsl () |
Computes the GSL interpolation for a set of (x,y) data points. | |
void | ComputeCubicClamped () |
Computes the cubic clamped interpolation for a set of (x,y) data points, given the first derivatives of the endpoints of the data set. | |
double | ValueToExtrapolate (const double a, const ExtrapType &etype) |
Returns the domain value at which to evaluate. | |
double | EvaluateCubicNeighborhood (const double a) |
Performs cubic spline interpolation for a neighborhood about a. | |
vector< double > | EvaluateCubicNeighborhood (const vector< double > &a, const ExtrapType &etype) |
Performs cubic spline interpolations for neighborhoods about each value of a. | |
double | EvaluateCubicClamped (const double a) |
Performs cubic spline interpolation with clamped boundary conditions, if possible. | |
double | EvaluateCubicHermite (const double a) |
Performs interpolation using the Hermite cubic polynomial. | |
double | EvaluatePolynomialNeville (const double a) |
Performs polynomial interpolation using Neville's algorithm. | |
vector< double > | EvaluateForIntegration (const double a, const double b, const unsigned int n) |
Evaluates data set in order to have enough data points to approximate the function to be integrated. | |
int | FindIntervalLowerIndex (const double a) |
Find the index of the x-value in the data set that is just below the input value, a. | |
void | ReportException (IException::ErrorType type, const string &method, const string &message, const char *filesrc, int lineno) const |
Generalized error report generator. | |
Protected Attributes | |
InterpType | p_itype |
Interpolation type. | |
vector< double > | p_x |
List of X values. | |
vector< double > | p_y |
List of Y values. | |
bool | p_dataValidated |
Flag variable to determine whether ValidateDataSet() has been called. | |
gsl_interp_accel * | p_acc |
Lookup accelorator. | |
gsl_spline * | p_interp |
Currently active interpolator. | |
bool | p_clampedEndptsSet |
Flag variable to determine whether SetCubicClampedEndptDeriv() has been called after all data was added for CubicClamped interpolation. | |
bool | p_clampedComputed |
Flag variable to determine whether ComputeCubicClamped() has been called. | |
double | p_clampedDerivFirstPt |
First derivative of first x-value, p_x[0]. This is only used for the CubicClamped interpolation type. | |
double | p_clampedDerivLastPt |
First derivative of last x-value, p_x[n-1]. This is only used for the CubicClamped interpolation type. | |
vector< double > | p_clampedSecondDerivs |
List of second derivatives evaluated at p_x values. This is only used for the CubicClamped interpolation type. | |
vector< double > | p_polyNevError |
Estimate of error for interpolation evaluated at x. This is only used for the PolynomialNeville interpolation type. 91 taken from AtmosModel. | |
vector< double > | p_fprimeOfx |
List of first derivatives corresponding to each x value in the data set (i.e. each value in p_x) | |
Static Protected Attributes | |
static FunctorList | p_interpFunctors |
Maintains list of interpolator options. | |
This class extends Isis::NumericalApproximation.
It was created to handle numerical integration methods for specific atmospheric functions in the Isis::AtmosModel class. Rather than using a data set to interpolate a function, these methods can take in a pointer to an AtmosModel object and an enumerated value for the specific function that needs to be integrated.
|
protectedinherited |
GSL Iterator.
|
protectedinherited |
Set up a std::map of GSL interpolator functors. List of function types.
|
protectedinherited |
GSL Interpolation specs.
|
inherited |
This enum defines the manner in which a value outside of the domain should be handled if passed to the Evaluate() method.
Enumerator | |
---|---|
ThrowError | Evaluate() throws an error if a is outside of the domain. |
Extrapolate | Evaluate() attempts to extrapolate if a is outside of the domain. This is only valid for NumericalApproximation::InterpType CubicClamped or PolynomialNeville and the result will be accurate only if sufficiently close to the domain boundary. |
NearestEndpoint | Evaluate() returns the y-value of the nearest endpoint if a is outside of the domain. |
This enum defines function to be integrated by Romberg's method.
Enumerator | |
---|---|
OuterFunction | Indicates that Romberg's method will integrate the function OutrFunc2Bint() |
InnerFunction | Indicates that Romberg's method will integrate the function InrFunc2Bint() |
|
inherited |
This enum defines the types of interpolation supported in this class.
|
inline |
Uses Isis::NumericalApproximation constructor.
|
inlinevirtual |
Empty destructor.
|
inherited |
Adds value of a first derivative of a data point.
This method can only be called for cubic Hermite splines, i.e. if NumericalApproximation::InterpType is CubicHermite. Values should be entered in the order of the corresponding data points.
fprimeOfx | Derivative value to be added. |
Isis::IException::Programmer | "Method only used for cspline-Hermite interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
inherited |
Adds values for the first derivatives of the data points.
This method can only be called for cubic Hermite splines, i.e. if NumericalApproximation::InterpType is CubicHermite. These values should be entered in the order of the corresponding data points.
fprimeOfx | Vector of derivative values to be added. |
Isis::IException::Programmer | "Method only used for cspline-Hermite interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
inherited |
Adds values for the first derivatives of the data points.
This method can only be called for cubic Hermite splines, i.e. if NumericalApproximation::InterpType is CubicHermite. These values should be entered in the order of the corresponding data points.
n | Number of derivative values to be added. |
fprimeOfx | Array of derivative values to be added. |
Isis::IException::Programmer | "Method only used for cspline-Hermite interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
inherited |
Add a datapoint to the set.
This method allows the user to add a point to the set of data in preparation for interpolation over an interval.
Note: All data sets must have unique x values. If the interpolation type is not PolynomialNeville, x values must be sorted in ascending order. If CubicNatPeriodic interpolation type is used, the first and last points added to the data set must have the same y value.
x | Domain value to add to data set |
y | Range value corresponding to domain value x |
References Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::p_y.
Referenced by Isis::AtmosModel::GenerateAhTable(), Isis::AtmosModel::GenerateHahgTables(), Isis::LunarLambertEmpirical::LunarLambertEmpirical(), Isis::MinnaertEmpirical::MinnaertEmpirical(), Isis::NumericalApproximation::NumericalApproximation(), and Isis::NumericalApproximation::NumericalApproximation().
|
inherited |
Add set of points to the data set using vectors.
This method allows the user to add a set of points to the set of data in preparation for interpolation over an interval. This method does not overwrite previously added data. Rather, it adds the new data to the end of the existing data set.
Note: Behavior is undefined if the domain is not sorted in ascending or descending order.
x | Vector of domain values to add to data set |
y | Vector of range values corresponding to each domain value in x |
Isis::IException::Programmer | "Invalid arguments. The number of x-values does not equal the number of y-values." |
References _FILEINFO_, Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
inherited |
Add set of points to the data set using pointer arrays.
This method allows the user to add a set of points to the set of data in preparation for interpolation over an interval. This method does not overwrite previously added data. Rather, it adds the new data to the end of the existing data set.
Note: Behavior is undefined if the domain is not sorted in ascending or descending order.
n | Number of data points to be used. |
x | Array of domain values to add to data set |
y | Array of range values corresponding to each domain value in x |
References Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::p_y.
|
inherited |
Uses an n point backward first difference formula to approximate the first derivative evaluated at a given domain value.
This method uses backward first difference formulas to return an approximation of the first derivative of the interpolated data set function evaluated at given a valid domain value, a. Backward difference formulas use n points, with the largest x value at a, for numerical differentiation approximation. This method uses one of the following formulas:
\[ f\prime(a) \approx \frac{1}{h}[f(a) - f(a - h)] \]
\[ f\prime(a) \approx \frac{1}{2h}[3f(a) - 4f(a - h) + f(a - 2h)] \]
a | Domain value at which first deriviative is evaluated. |
n | The number of points used in the formula |
h | Distance between nearest points in the formula |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a-(n-1)h is less than domain min. |
Isis::IException::Programmer | "Invalid argument. There is no n-point backward difference formula in use." |
Isis::IException::Programmer | "Unable to calculate backward first difference for given (a,n,h)" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Uses an n point backward second difference formula to approximate the second derivative evaluated at a given domain value.
This method uses backward second difference formulas to return an approximation of the second derivative of the interpolated data set function evaluated at given a valid domain value, a. Backward second difference formulas use n points, with the largest x value at a, for numerical differentiation approximation. This method uses the following formula:
\[ f\prime\prime(a) \approx \frac{1}{h^2}[f(a) - 2f(a - h) + f(a - 2h)] \]
a | Domain value at which second deriviative is evaluated. |
n | The number of points used in the formula. |
h | Distance between nearest points in the formula. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a-(n-1)h is less than domain min. |
Isis::IException::Programmer | "Invalid argument. There is no n-point backward difference formula in use." |
Isis::IException::Programmer |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Uses Boole's Rule to approximate the integral of the interpolated data set function on the interval (a,b).
The Boole's Rule for integration approximation uses a 5-point Newton-Cote formula. This rule states:
\[ \int_{a}^b f(x)dx \approx \frac{2h}{45}[7f(a) + 32f(a+h) + 12f(a+2h) + 32f(a+3h) + 7f(a+4h)] \]
where h = (b - a)/4.
This method uses a composite, or extended, Boole's rule formula to approximate the integral.
Note: The method uses an algorithm that is adapted from the IDL function int_tabulated.pro.
a | Lower bound of interval. |
b | Upper bound of interval. |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using Boole's rule" |
References _FILEINFO_, and Isis::NumericalApproximation::EvaluateForIntegration().
|
inherited |
Uses an n point center first difference formula to approximate the first derivative evaluated at a given domain value.
This method uses center first difference formulas to return an approximation of the first derivative of the interpolated data set function evaluated at given a valid domain value, a. Center difference formulas use n points, centered at a, for numerical differentiation approximation. This method uses one of the following formulas:
\[ f\prime(a) \approx \frac{1}{2h}[f(a + h) - f(a - h)] \]
\[ f\prime(a) \approx \frac{1}{12h}[-f(a + 2h) + 8f(a +h) - 8f(a - h) + f(a - 2h)] \]
a | Domain value at which first deriviative is evaluated. |
n | The number of points used in the formula. |
h | Distance between nearest points in the formula. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a+(n-1)h is greater than domain max or a-(n-1)h is less than domain min. |
Isis::IException::Programmer | "Invalid argument. There is no n-point center difference formula in use." |
Isis::IException::Programmer | "Unable to calculate center first difference for (a,n,h)" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Uses an n point center second difference formula to approximate the second derivative evaluated at a given domain value.
This method uses center second difference formulas to return an approximation of the second derivative of the interpolated data set function evaluated at given a valid domain value, a. Center second difference formulas use n points, centered at a, for numerical differentiation approximation. This method uses one of the following formulas:
\[ f\prime\prime(a) \approx \frac{1}{h^2}[f(a + h) - 2f(a) + f(a - h)] \]
\[ f\prime\prime(a) \approx \frac{1}{12h^2}[-f(a + 2h) + 16f(a +h) - 30f(a) + 16f(a - h) - f(a - 2h)] \]
a | Domain value at which second deriviative is evaluated. |
n | The number of points used in the formula. |
h | Distance between nearest points in the formula. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a+(n-1)h is greater than domain max or a-(n-1)h is less than domain min. |
Isis::IException::Programmer | "Invalid argument. There is no n-point center difference formula in use." |
Isis::IException::Programmer | "Unable to calculate center second difference for (a,n,h)" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
protectedinherited |
Computes the cubic clamped interpolation for a set of (x,y) data points, given the first derivatives of the endpoints of the data set.
This protected method is called only if the object is assigned a cubic clamped interpolation type and if it has not already been computed for the given data set. It calculates the second derivatives for each p_x value of the known data set and stores these values in p_clampedSecondDerivs so that the EvaluateCubicClamped() method may be called to interpolate the set using clamped boundary conditions, if possible. This method must be called when all the data points have been added to the object for the data set and after SetCubicClampedEndptDeriv() has been called. If the endpoint derivatives are greater than or equal to 1 x 1030, the routine is signaled to set the corresponding boundary condition for a natural spline, with zero second derivative on that boundary.
Issis::IException::Programmer | "Must use SetCubicClampedEndptDeriv() before computing cubic spline with clamped boundary" |
Issis::IException::Programmer | "Unable to compute cubic clamped interpolation" |
References _FILEINFO_, Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), Isis::NumericalApproximation::Size(), and Isis::NumericalApproximation::ValidateDataSet().
Referenced by Isis::NumericalApproximation::CubicClampedSecondDerivatives(), and Isis::NumericalApproximation::Evaluate().
|
protectedinherited |
Computes the GSL interpolation for a set of (x,y) data points.
This protected method is called only if the object is assigned a GSL interpolation type and if it has not already been computed on the given data set. It will compute the interval of interpolated range values over the given domain. A copy of this data is maintained in the object so the data points do not need to be interpolated on each evaluation of a point unless the data set changes.
Isis::IException::Programmer | "Unable to compute GSL interpolation" |
References _FILEINFO_, Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::Size(), and Isis::NumericalApproximation::ValidateDataSet().
Referenced by Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), and Isis::NumericalApproximation::GslSecondDerivative().
|
inherited |
Returns whether the passed value is an element of the set of x-values in the data set.
This method uses a binary search of the set of x-values to determine whether the input is contained in this set.
x | Value to search for in the data set. |
References Isis::NumericalApproximation::p_x.
|
inherited |
Retrieves the second derivatives of the data set.
This method returns a vector of the same size as the data set. Each component is the second derivative of the corresponding p_x value , as estimated by the ComputeCubicClamped() method.
Isis::IException::Programmer | "Method only used for cspline-clamped interpolation type" |
Isis::IException::Programmer | "Unable to calculate the second derivatives of the data set for a clamped cubic spline." |
References _FILEINFO_, Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
inherited |
Input data domain maximum value.
This method validates the data set for the assigned interpolation type and returns the largest value in p_x of the data set.
Isis::IException::Programmer | "Unable to calculate the domain minimum for the data set." |
References _FILEINFO_, Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::ValidateDataSet().
Referenced by Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::InsideDomain(), and Isis::NumericalApproximation::ValueToExtrapolate().
|
inherited |
Input data domain minimum value.
This method validates the data set for the assigned interpolation type and returns the smallest value in p_x of the data set.
Isis::IException::Programmer | "Unable to calculate the domain maximum for the data set." |
References _FILEINFO_, Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::ValidateDataSet().
Referenced by Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::InsideDomain(), and Isis::NumericalApproximation::ValueToExtrapolate().
|
inherited |
Calculates interpolated or extrapolated value of tabulated data set for given domain value.
This method returns the approximate value for f(a), where a is an element near the domain and f is the approximated function for the given data set. If the given value, a, falls outside of the domain, then the extrapoltion type is examined to determine the result. CubicNeighborhood and GSL interpolation types can not extrapolate, so the user must choose to throw an error or return f evaluated at the nearest domain boundary. CubicClamped, CubicHermite, and PolynomialNeville interpolation types can extrapolate a value with accuracy only if a is near enough to the domain boundary. Default NumericalApproximation::ExtrapType is ThrowError.
a | Domain value from which to interpolate a corresponding range value |
etype | NumericalApproximation::ExtrapType enum value indicates how to evaluate if a falls outside of the domain. (Default: ThrowError) |
Isis::IException::Programmer | "Unable to evaluate the function at the point a" |
References _FILEINFO_, Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::EvaluateCubicClamped(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::PolynomialNeville, and Isis::NumericalApproximation::ValueToExtrapolate().
Referenced by Isis::HapkeAtm1::AtmosModelAlgorithm(), Isis::HapkeAtm2::AtmosModelAlgorithm(), Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::LunarLambertEmpirical::PhotoModelAlgorithm(), Isis::MinnaertEmpirical::PhotoModelAlgorithm(), and Isis::NumericalApproximation::RefineExtendedTrap().
|
inherited |
Calculates interpolated value for given set of domain values.
This method returns the approximate values for f(ai), where ai is an element in the domain and f is the interpolated function for the given data set. If any of the given values in a fall outside of the domain, then the extrapoltion type is examined to determine the result. CubicNeighborhood and GSL interpolation types can not extrapolate, so the user must choose to throw an error or return f evaluated at the nearest domain boundary. CubicClamped and PolynomialNeville interpolation types can extrapolate a value with accuracy only if ai is near enough to the domain boundary.
a | Vector of domain values from which to interpolate a vector of corresponding range values |
etype | NumericalApproximation::ExtrapType enum value indicates how to evaluate any value of a that falls outside of the domain. (Default: ThrowError) |
Isis::IException::Programmer | "Unable to evaluate the function at the vector of points, a." |
References _FILEINFO_, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::PolynomialNeville, and Isis::NumericalApproximation::ValueToExtrapolate().
|
protectedinherited |
Performs cubic spline interpolation with clamped boundary conditions, if possible.
This is a protected method called by Evaluate() if the NumericalApproximation::InterpType is CubicClamped and SetCubicClampedEndptDeriv() has been called. It uses the second derivative vector, p_clampedSecondDerivs, to interpolate the value for f(a) using a clamped cubic spline formula,
Note: If the given value, a, falls outside of the domain, then extrapolation is attempted and the result is accurate only if a is near enough to the domain boundary.
a | Domain value from which to interpolate a corresponding range value |
References Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::Evaluate().
|
protectedinherited |
Performs interpolation using the Hermite cubic polynomial.
This is a protected method called by Evaluate() if the NumericalApproximation::InterpType is CubicHermite. It returns an approximate value for f(a) by using the Hermite cubic polynomial, which uses Lagrange coefficient polynomials. The data points and each corresponding first derivative should have been already added.
a | Domain value from which to interpolate a corresponding range value |
Isis::IException::User | "Invalid arguments. The size of the first derivative vector does not match the number of (x,y) data points." |
References _FILEINFO_, Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::ReportException(), Isis::NumericalApproximation::Size(), and Isis::IException::User.
Referenced by Isis::NumericalApproximation::Evaluate().
|
inherited |
Approximates the first derivative of the data set function evaluated at the given domain value for CubicHermite interpolation type.
This method returns an approximation of the first derivative evaluated at given a valid domain value, a. It is able to extrapolate for values not far outside of the domain
References _FILEINFO_, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::ReportException(), Isis::NumericalApproximation::Size(), and Isis::IException::User.
|
inherited |
Approximates the second derivative of the data set function evaluated at the given domain value for CubicHermite interpolation type.
This method returns an approximation of the second derivative evaluated at given a valid domain value, a. It is able to extrapolate for values not far outside of the domain
References _FILEINFO_, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::ReportException(), Isis::NumericalApproximation::Size(), and Isis::IException::User.
|
protectedinherited |
Performs cubic spline interpolation for a neighborhood about a.
This is a protected method called by Evaluate() if the NumericalApproximation::InterpType is CubicNeighborhood. It uses an algorithm that is adapted from the IDL interpol.pro application using the "/spline" keyword on an irregular grid. This type of cubic spline fits a natural cubic spline to the 4-point neighborhood of known data points surrounding a. For example, suppose {x0, x1, ..., xn} is the array of known domain values in the data set and \( x_i \leq a < x_{i+1}\) for some i such that \( 0 \leq i \leq n \), then f(a) is evaluated by interpolating the natural cubic spline consisting of the data set {xi-1, xi, xi+1, xi+2} at a.
Note: If the given value, a, falls outside of the domain, then f evaluated at the nearest domain boundary is returned.
a | Domain value from which to interpolate a corresponding range value. |
Isis::IException::Programmer | "Unable to evaluate cubic neighborhood interpolation at a" |
References _FILEINFO_, Isis::NumericalApproximation::CubicNatural, Isis::NumericalApproximation::NearestEndpoint, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::Evaluate(), and Isis::NumericalApproximation::Evaluate().
|
protectedinherited |
Performs cubic spline interpolations for neighborhoods about each value of a.
This is a protected method called by Evaluate() if the NumericalApproximation::InterpType is CubicNeighborhood. It uses an algorithm that is adapted from the IDL interpol.pro application using the "/spline" keyword on an irregular grid. For each component of a, this method fits a natural cubic spline using the 4-point neighborhood of known data points surrounding that component. For example, suppose {x0, x1, ..., xn} is the array of known domain values in the data set, then for each component of a, ak, in the domain, there is an i such that \( 0 \leq i \leq n \) and \( x_i \leq a_k < x_{i+1}\). Then, f(ak) is evaluated by interpolating the natural cubic spline consisting of the data set {xi-1, xi, xi+1, xi+2} at ak.
Note: If any given value, ai, falls outside of the domain, then f is evaluated at the nearest domain boundary.
a | Vector of domain values from which to interpolate a vector of corresponding range values |
etype | NumericalApproximation::ExtrapType enum value indicates how to evaluate if a falls outside of the domain. (Default: ThrowError) |
Isis::IException::Programmer | "Unable to evaluate cubic neighborhood interpolation at the values in the vector, a" |
References _FILEINFO_, Isis::NumericalApproximation::CubicNatural, Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::NearestEndpoint, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::Size(), and Isis::NumericalApproximation::ValueToExtrapolate().
|
protectedinherited |
Evaluates data set in order to have enough data points to approximate the function to be integrated.
a | Lower bound of interval. |
b | Upper bound of interval. |
n | Number of points used in Newton-Cotes formula. |
Isis::IException::Programmer | (When a > b) "Invalid interval entered" |
Isis::IException::Programmer | "Invalid arguments. Interval entered is not contained within domain" |
Isis::IException::Programmer | "Unable to evaluate the data set for integration" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::BoolesRule(), Isis::NumericalApproximation::Simpsons3PointRule(), Isis::NumericalApproximation::Simpsons4PointRule(), and Isis::NumericalApproximation::TrapezoidalRule().
|
protectedinherited |
Performs polynomial interpolation using Neville's algorithm.
This is a protected method called by Evaluate() if the NumericalApproximation::InterpType is PolynomialNeville. It uses Neville's algorithm for Lagrange polynomials. It returns a value f(a) and sets the error estimate p_polyNevError. After this method is called, the user may access this error estimate by calling PolynomialNevilleErrorEstimate().
Note: If the given value, a, falls outside of the domain, then extrapolation is attempted and the result is accurate only if a is near enough to the domain boundary.
a | Domain value from which to interpolate a corresponding range value |
References Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::Evaluate(), and Isis::NumericalApproximation::Evaluate().
|
protectedinherited |
Find the index of the x-value in the data set that is just below the input value, a.
This method is used by EvaluateCubicHermite(), EvaluateCubFirstDeriv() and EvaluateCubicHermiteSecDeriv() to determine in which interval of x-values a lies. It returns the index of the lower endpoint of the interval. If a is below the domain minimum, the method returns 0 as the lower index. If a is above the domain maximum, it returns the second to last index of the data set, Size()-2, as the lower index.
a | Domain value around which the interval lies |
References Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), and Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv().
|
inherited |
Uses an n point forward first difference formula to approximate the first derivative evaluated at a given domain value.
This method uses forward first difference formulas to return an approximation of the first derivative of the interpolated data set function evaluated at given a valid domain value, a. Forward difference formulas use n points, with the smallest x value at a, for numerical differentiation approximation. This method uses one of the following formulas:
\[ f\prime(a) \approx \frac{1}{h}[f(a + h) - f(a)] \]
\[ f\prime(a) \approx \frac{1}{2h}[-f(a + 2h) + 4f(a + h) - 3f(a)] \]
a | Domain value at which first deriviative is evaluated. |
n | The number of points used in the formula. |
h | Distance between nearest points in the formula. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a+(n-1)h is greater than domain max. |
Isis::IException::Programmer | "Invalid argument. There is no n-point forward difference formula in use." |
Isis::IException::Programmer | "Unable to calculate forward first difference for (a,n,h)" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Uses an n point forward second difference formula to approximate the second derivative evaluated at a given domain value.
This method uses forward second difference formulas to return an approximation of the second derivative of the interpolated data set function evaluated at given a valid domain value, a. Forward second difference formulas use n points, with the smallest x value at a, for numerical differentiation approximation. This method uses the following formula:
\[ f\prime\prime(a) \approx \frac{1}{h^2}[f(a + 2h) - 2f(a + h) + f(a)] \]
a | Domain value at which second deriviative is evaluated. |
n | The number of points used in the formula. |
h | Distance between nearest points in the formula. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Formula steps outside of domain." If a+(n-1)h is greater than domain max. |
Isis::IException::Programmer | "Invalid argument. There is no n-point forward difference formula in use." |
Isis::IException::Programmer | "Unable to calculate forward second difference for (a,n,h)" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::p_dataValidated, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ValidateDataSet().
|
protectedinherited |
Allocates GSL interpolation functions.
This method is called within Compute to allocate pointers to a GSL interpolation object and to a GSL accelerator object (for interpolation look-ups). This is only called for the GSL interpolation types. If it is deemed invalid, an exception will be thrown.
npoints | Number of points to allocate for the GSL interpolator |
References Isis::NumericalApproximation::GslDeallocation(), Isis::NumericalApproximation::GslFunctor(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, and Isis::NumericalApproximation::p_itype.
Referenced by Isis::NumericalApproximation::ComputeGsl().
|
protectedinherited |
Returns whether a GSL interpolation computation of the data set has been performed.
This method is only applicable to GSL interpolation types.
Isis::IException::Programmer | "Method only valid for GSL interpolation types" |
References _FILEINFO_, Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, and Isis::IException::Programmer.
Referenced by Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), and Isis::NumericalApproximation::GslSecondDerivative().
|
protectedinherited |
Deallocate GSL interpolator resources, if used.
If a GSL interpolator function has been allocated, this routine will free its resources and reset internal pointers to reflect this state and provide a mechanism to test its state. Otherwise, this method sets the internal GSL pointers to their default, 0.
References Isis::NumericalApproximation::p_acc, and Isis::NumericalApproximation::p_interp.
Referenced by Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::~NumericalApproximation().
|
inherited |
Approximates the first derivative of the data set function evaluated at the given domain value for GSL supported interpolation types.
This method returns an approximation of the first derivative evaluated at given a valid domain value, a. It is a wrapper for the GSL subroutine gsl_spline_eval_deriv_e(). If the NumericalApproximation::InterpType is not a GSL type, then this method throws an error. No documentation was found concerning the algorithm used by this method.
a | Domain value at which first deriviative is evaluated. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Cannot use this method for interpolation type" (If the interpolation type is not GSL) |
Isis::IException::Programmer | "Unable to compute the first derivative at a using the GSL interpolation" |
Isis::IException::Programmer | "Unable to compute the first derivative at a. GSL integrity check failed" |
References _FILEINFO_, Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
protectedinherited |
Search for a GSL interpolation function.
This method searches the supported GSL options table for a given interpolation function as requested by the caller. If it is not found, an exception will be thrown indicating the erroneous request.
itype | Type of GSL interpolator to find |
Isis::IException::Programmer | "Invalid argument. Unable to find GSL interpolator" |
References _FILEINFO_, Isis::NumericalApproximation::p_interpFunctors, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
Referenced by Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::MinPoints(), Isis::NumericalApproximation::Name(), and Isis::NumericalApproximation::SetInterpType().
|
inherited |
Approximates the integral of the data set function evaluated on the given interval for GSL supported interpolation types.
This method returns an approximation of the integral evaluated on a given valid domain interval, (a,b). It is a wrapper for the GSL subroutine gsl_spline_eval_integ_e(). If the NumericalApproximation::InterpType is not a GSL type, then this method throws an error. No documentation was found concerning the algorithm used by this method.
a | Lower endpoint at which integral is evaluated. |
b | Upper endpoint at which integral is evaluated. |
Isis::IException::Programmer | (When a > b) "Invalid interval entered" |
Isis::IException::Programmer | "Invalid arguments. Interval entered is not contained within domain" |
Isis::IException::Programmer | "Cannot use this method for interpolation type" (If the interpolation type is not GSL) |
Isis::IException::Programmer | "Unable to compute the integral on the interval (a,b) using GSL interpolation" |
Isis::IException::Programmer | "Unable to compute the integral on the interval (a,b). GSL integrity check failed." |
References _FILEINFO_, Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
protectedinherited |
Checks the status of the GSL interpolation operations.
This method takes a return status from a GSL call and determines if it is completed successfully. This implementation currently allows the GSL_DOMAIN error to propagate through sucessfully as the domain can be checked by the caller if they deem this necessary.
gsl_status | Return status of a GSL function call |
src | Name of the calling source invoking the check. This allows more precise determination of the error. |
line | Line of the calling source that invoked the check |
Isis::IException::Programmer | "GSL error occured" |
References Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
Referenced by Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), and Isis::NumericalApproximation::GslSecondDerivative().
|
protectedinherited |
Returns whether an interpolation type is adapted from the GSL library.
GSL interpolation types include the following:
itype | Interpolation type to be compared to GSL list |
References Isis::NumericalApproximation::Akima, Isis::NumericalApproximation::AkimaPeriodic, Isis::NumericalApproximation::CubicNatPeriodic, Isis::NumericalApproximation::CubicNatural, Isis::NumericalApproximation::Linear, and Isis::NumericalApproximation::Polynomial.
Referenced by Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::MinPoints(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::RefineExtendedTrap(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetInterpType(), Isis::NumericalApproximation::ValueToExtrapolate(), and Isis::NumericalApproximation::~NumericalApproximation().
|
inherited |
Approximates the second derivative of the interpolated data set function evaluated at the given domain value for GSL supported interpolation types.
This method returns an approximation of the second derivative evaluated at given a valid domain value, a. It is a wrapper for the GSL subroutine gsl_spline_eval_deriv2_e(). If the NumericalApproximation::InterpType is not a GSL type, then this method throws an error. No documentation was found concerning the algorithm used by this method.
a | Domain value at which second deriviative is evaluated. |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain." |
Isis::IException::Programmer | "Cannot use this method for interpolation type" (If the interpolation type is not GSL) |
Isis::IException::Programmer | "Unable to compute the second derivative at a using GSL interpolation" |
Isis::IException::Programmer | "Unable to compute the second derivative at a. GSL integrity check failed" |
References _FILEINFO_, Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::InsideDomain(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
|
protectedinherited |
Initializes the object upon instantiation.
This method sets up the initial state of the object, typically at instantiation. It populates the interpolation function table identifying which options are available to the users of this class.
GSL error handling is turned off - upon repeated instantiation of this object. The GSL default error handling, termination of the application via an abort() is unacceptable. This calls adopts an alternative policy provided by the GSL whereby error checking must be done by the calling environment. This has an unfortunate drawback in that it is not enforceable in an object oriented environment that utilizes the GSL in disjoint classes.
itype | NumericalApproximation::InterpType enum value to be assigned to this object |
Isis::IException::Programmer | "Unable to initialize NumericalApproximation object" |
References _FILEINFO_, Isis::NumericalApproximation::Akima, Isis::NumericalApproximation::AkimaPeriodic, Isis::NumericalApproximation::CubicNatPeriodic, Isis::NumericalApproximation::CubicNatural, Isis::NumericalApproximation::Linear, Isis::NumericalApproximation::p_acc, Isis::NumericalApproximation::p_interp, Isis::NumericalApproximation::p_interpFunctors, Isis::NumericalApproximation::Polynomial, and Isis::NumericalApproximation::SetInterpType().
Referenced by Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::NumericalApproximation(), and Isis::NumericalApproximation::NumericalApproximation().
|
static |
Inner function to be integrated.
This function is the inner integrand with all its parameters except cos(ema) hidden. For atmSwitch=0 this integrand is mu times the photometric angle, giving the hemispheric albedo for the outer integral. atmSwitch of 1, 2, 3, give the 3 integrals over the atmospheric single- particle phase function used in the Hapke/Henyey-Greenstein atmospheric model.
am | Pointer to AtmosModel object |
mu | Angle at which the function will be integrated |
Isis::iException::Programmer | "Invalid value of atmospheric switch used as argument to this function" |
References _FILEINFO_, Isis::PI, and Isis::IException::Programmer.
Referenced by RefineExtendedTrap().
|
protectedinherited |
Returns whether the passed value is greater than or equal to the domain minimum and less than or equal to the domain maximum.
a | Value to be verified as valid domain value. |
Isis::IException::Programmer | "Unable to compute domain boundaries" |
References _FILEINFO_, Isis::NumericalApproximation::DomainMaximum(), and Isis::NumericalApproximation::DomainMinimum().
Referenced by Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), and Isis::NumericalApproximation::GslSecondDerivative().
|
inlineinherited |
Returns the enumerated type of interpolation chosen.
This method can be selected after all the points are added in the interpolation by using Compute() method. Note that this prints out as an integer representaion of the enumerated type:
References Isis::NumericalApproximation::p_itype.
|
inherited |
Minimum number of points required by interpolating function.
This method returns the minimum number of points that are required by the interpolating function in order for it to be applied to a data set. It returns the number of the of the currently selected/active interpolation function.
Isis::IException::Programmer | "Unable to calculate minimum points." |
References _FILEINFO_, Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::GslFunctor(), Isis::NumericalApproximation::p_itype, and Isis::NumericalApproximation::PolynomialNeville.
Referenced by Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Minimum number of points required by interpolating function.
This method returns the minimum number of points that are required by the interpolating function in order for it to be applied to a data set. It returns the minimum number for the specifed interpolation function as specified by the caller.
itype | Type of interpolation function for which to return minimum points |
Isis::IException::Programmer | "Invalid argument. Unknown interpolation type" |
Isis::IException::Programmer | "Unable to calculate minimum points" |
References _FILEINFO_, Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::PolynomialNeville, and Isis::IException::Programmer.
|
inherited |
Get name of interpolating function assigned to object.
This method returns the name of the interpolation type that is currently assigned to this object as a std::string. This may be called without adding any points. If called before computation, the result reflects the name of the function chosen at instantiation.
Isis::IException::Programmer | "Unable to retrieve numerical approximation name", |
References _FILEINFO_, Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::CubicHermite, Isis::NumericalApproximation::CubicNatural, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::GslFunctor(), Isis::NumericalApproximation::p_itype, and Isis::NumericalApproximation::PolynomialNeville.
Referenced by Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::CubicClampedSecondDerivatives(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::PolynomialNevilleErrorEstimate(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), Isis::NumericalApproximation::ValidateDataSet(), and Isis::NumericalApproximation::ValueToExtrapolate().
|
static |
This function is the outer integrand over mu at specified phi.
Outer function to be integrated.
am | Pointer to AtmosModel object |
phi | Angle at which the function will be integrated |
References _FILEINFO_, InnerFunction, and Isis::PI.
Referenced by RefineExtendedTrap().
|
inherited |
Retrieves the error estimate for the Neville's polynomial interpolation type.
This method must be called after the Evaluate() method has been invoked. If the Evaluate() method is passed a vector, this error will contain an error estimate for each of the values of the passed in vector. Otherwise, it will contain a single value.
Isis::IException::Programmer | "Method only used for polynomial-Neville's interpolation type" |
Isis::IException::Programmer | "Error not calculated" |
References _FILEINFO_, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::PolynomialNeville, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
double Isis::NumericalAtmosApprox::RefineExtendedTrap | ( | AtmosModel * | am, |
IntegFunc | sub, | ||
double | a, | ||
double | b, | ||
double | s, | ||
unsigned int | n ) |
This variation on the NumericalApproximation method integrates a specified AtmosModel function rather than an interpolated function based on a data set.
This routine computes the nth stage of refinement of an extended trapezoidal rule. This method is used by RombergsMethod() to integrate. When called with n = 1, the method returns the crudest estimate of the integral. Subsequent calls with n = 2, 3, ... (in sequential order) will improve the accuracy by adding 2n-2 additional interior points. This method can be used to integrate by the extended trapeziodal rule if you know the number of steps you want to take.
am | Pointer to AtmosModel object |
sub | Enumerated value of atmospheric function to be integrated |
a | Lower limit of integration |
b | Upper limit of integration |
s | Previous value of refinement |
n | Number of partitions to use when integrating |
Isis::iException::Programmer | "Caught an error" (from InrFunc2Bint() or OutrFunc2Bint() method) |
References _FILEINFO_, InnerFunction, InrFunc2Bint(), and OutrFunc2Bint().
Referenced by RombergsMethod().
|
inherited |
Calculates refinements extended trapezoidal rule to approximate the integral of the interpolated data set function on the interval (a,b).
This method calculates the nth stage of refinement of an extended trapezoidal rule. When called with n = 1, the method returns the non-composite trapezoidal estimate of the integral. Subsequent calls with n = 2, 3, ... (in sequential order) will improve the accuracy by adding 2n-2 additional interior points. This method can be used to integrate by the extended trapeziodal rule if you know the number of steps you want to take. For example, if you want 2M + 1, use the following code:
Note: Although this method may be used to approximate an integral, as described above, it is most often used by RombergsMethod() to integrate.
a | Lower limit of integration |
b | Upper limit of integration |
s | Previous value of refinement |
n | Number of partitions to use when integrating |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using the extended trapezoidal rule" |
References _FILEINFO_, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::Extrapolate, Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::NearestEndpoint, and Isis::NumericalApproximation::p_itype.
Referenced by Isis::NumericalApproximation::RombergsMethod().
|
protectedinherited |
Generalized error report generator.
This method is used throughout this class to standardize error reporting as a convenience to its implementor.
type | Type of Isis::IException |
methodName | Name of method where exception originated |
message | Error context string provided by the caller |
filesrc | Name of the file the error occured in. |
lineno | Line number of the calling source where the error occured. |
Isis::IException::errType | equal to type and error message equal to (methodName + " - " + message) |
Referenced by Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::CubicClampedSecondDerivatives(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslFunctor(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslIntegrityCheck(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::PolynomialNevilleErrorEstimate(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), Isis::NumericalApproximation::SetInterpType(), Isis::NumericalApproximation::ValidateDataSet(), and Isis::NumericalApproximation::ValueToExtrapolate().
|
inherited |
Resets the state of the object.
This method deallocates the internal state of the object and clears the data set and class variables. The object is returned to its original state, so data points must be entered before computing again. This does not clear or reset the interpolation type.
References Isis::NumericalApproximation::GslDeallocation(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_polyNevError, Isis::NumericalApproximation::p_x, and Isis::NumericalApproximation::p_y.
Referenced by Isis::AtmosModel::GenerateAhTable(), Isis::AtmosModel::GenerateHahgTables(), Isis::LunarLambertEmpirical::LunarLambertEmpirical(), Isis::MinnaertEmpirical::MinnaertEmpirical(), Isis::NumericalApproximation::Reset(), Isis::LunarLambertEmpirical::~LunarLambertEmpirical(), and Isis::MinnaertEmpirical::~MinnaertEmpirical().
|
inherited |
Resets the state of the object and resets interpolation type.
This method will clear the data set, reset the validation status of the data to false, reset the interpolation type, clear class variables and deallocate (inactivate) the internal state of the object. The object is returned to its original state, so data points must be entered before computing again.
itype | NumericalApproximation::InterpType enum value to be assigned to this object |
Isis::IException::Programmer | "Unable to reset interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::SetInterpType().
double Isis::NumericalAtmosApprox::RombergsMethod | ( | AtmosModel * | am, |
IntegFunc | sub, | ||
double | a, | ||
double | b ) |
This variation on the NumericalApproximation method integrates a specified AtmosModel function rather than an interpolated function based on a data set.
It returns the integral of the given function from a to b for the given AtmosModel. Integration is performed by Romberg's method for Numerical Integration of order 2K, where, e.g., K=2 is simpson's rule. This is a generalization of the trapezoidal rule. Romberg Integration uses a series of refinements on the extended (or composite) trapezoidal rule. This method calls a polynomial interpolation (Neville's algorithm) to extrapolate successive refinements.
am | Pointer to AtmosModel object |
sub | Enumerated value of atmospheric function to be integrated |
a | Lower limit of integration |
b | Upper limit of integration |
Isis::iException::Programmer | "Failed to converge." |
Isis::iException::Programmer | "Caught an error" (from RefineExtendedTrap(), Constructor, Evaluate(), or PolynomialNevilleErrorEstimate() method) |
References _FILEINFO_, Isis::NumericalApproximation::Extrapolate, Isis::NumericalApproximation::PolynomialNeville, Isis::IException::Programmer, and RefineExtendedTrap().
|
inherited |
Uses Romberg's method to approximate the integral of the interpolated data set function on the interval (a,b).
This method returns the integral of the function from a to b using Romberg's method for Numerical Integration of order 2K, where, e.g., K=2 is simpson's rule. This is a generalization of the trapezoidal rule. Romberg Integration uses a series of refinements on the extended (or composite) trapezoidal rule to reduce error terms. This method makes use of Neville's algorithm for polynomial interpolation to extrapolate successive refinements.
a | Lower limit of integration |
b | Upper limit of integration |
Isis::IException::Programmer | "Failed to converge." |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using Romberg's method" |
References _FILEINFO_, Isis::NumericalApproximation::Extrapolate, Isis::NumericalApproximation::PolynomialNeville, Isis::IException::Programmer, and Isis::NumericalApproximation::RefineExtendedTrap().
|
inherited |
Sets the values for the first derivatives of the endpoints of the data set.
This method can only be called for cubic splines with clamped boundary conditions, i.e. if NumericalApproximation::InterpType is CubicClamped.
yp1 | First derivative of the function evaluated at the domain minimum. |
ypn | First derivative of the function evaluated at the domain maximum. |
Isis::IException::Programmer | "Method only used for cspline-clamped interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::CubicClamped, Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
Referenced by Isis::AtmosModel::GenerateAhTable(), Isis::AtmosModel::GenerateHahgTables(), Isis::LunarLambertEmpirical::LunarLambertEmpirical(), and Isis::MinnaertEmpirical::MinnaertEmpirical().
|
inherited |
Sets interpolation type.
This method will reset the interpolation type to that of the input parameter and deallocate memory. Unlike the Reset() method, this method does NOT discard the data set. However, since interpolations have differing requirements for valid data sets, the data set stored is not yet validated for the new interpolation type. Other class variables are cleared if they are interpolation type dependent.
itype | NumericalApproximation::InterpType enum value to be assigned to this object |
Isis::IException::Programmer | "Invalid argument. Unknown interpolation type" |
Isis::IException::Programmer | "Unable to set interpolation type" |
References _FILEINFO_, Isis::NumericalApproximation::GslFunctor(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::p_clampedComputed, Isis::NumericalApproximation::p_clampedDerivFirstPt, Isis::NumericalApproximation::p_clampedDerivLastPt, Isis::NumericalApproximation::p_clampedEndptsSet, Isis::NumericalApproximation::p_clampedSecondDerivs, Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_fprimeOfx, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_polyNevError, Isis::IException::Programmer, and Isis::NumericalApproximation::ReportException().
Referenced by Isis::AtmosModel::GenerateAhTable(), Isis::AtmosModel::GenerateHahgTables(), Isis::NumericalApproximation::Init(), Isis::LunarLambertEmpirical::LunarLambertEmpirical(), Isis::MinnaertEmpirical::MinnaertEmpirical(), Isis::NumericalApproximation::operator=(), and Isis::NumericalApproximation::Reset().
|
inherited |
Uses Simpson's 3-point rule to approximate the integral of the interpolated data set function on the interval (a,b).
The Simpson's 3-Point Rule for numerical integration uses a 3-point Newton-Cote formula. This rule states:
\[ \int_{a}^b f(x)dx \approx \frac{h}{3}[f(a) + f(a+h) + 4*f(a+2h)] \]
where h = (b - a)/2. This method uses a composite, or extended, Simpson's rule algorithm to approximate the integral.
a | Lower bound of interval. |
b | Upper bound of interval. |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using Simpson's 3 point rule" |
References _FILEINFO_, and Isis::NumericalApproximation::EvaluateForIntegration().
|
inherited |
Uses Simpson's 4-point rule to approximate the integral of the interpolated data set function on the interval (a,b).
The Simpson's 4-point Rule for numerical integration uses a 4-point Newton-Cote formula and is sometimes called the Simpson's 3/8 Rule. This rule states:
\[ \int_{a}^b f(x)dx \approx \frac{3h}{8}[f(a) + 3f(a+h) + 3f(a+2h) + f(a+3h)] \]
where h = (b - a)/3. This method uses a composite, or extended, Simpson's 3/8 rule algorithm to approximate the integral.
a | Lower bound of interval. |
b | Upper bound of interval. |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using Simpson's 4 point rule" |
References _FILEINFO_, and Isis::NumericalApproximation::EvaluateForIntegration().
|
inlineinherited |
Returns the number of the coordinates added to the data set.
References Isis::NumericalApproximation::p_x.
Referenced by Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::EvaluateCubicClamped(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluateForIntegration(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::FindIntervalLowerIndex(), and Isis::NumericalApproximation::ValidateDataSet().
|
inherited |
Uses the trapezoidal rule to approximate the integral of the interpolated data set function on the interval (a, b).
The trapeziod rule for integration approximation uses a 2-point Newton-Cote formula. This rule states:
\[ \int_{a}^b f(x)dx \approx \frac{h}{2}[f(a) + f(b)] \]
where h = b - a. This method uses a composite, or extended, trapeziodal rule algorithm to approximate the integral.
a | Lower bound of interval. |
b | Upper bound of interval. |
Isis::IException::Programmer | "Unable to calculate the integral on the interval (a,b) using the trapezoidal rule" |
References _FILEINFO_, and Isis::NumericalApproximation::EvaluateForIntegration().
|
protectedinherited |
Validates the data set before computing interpolation.
This method is called from the ComputeCubicClamped() and ComputeGsl() methods to verify that the data set contains the minimum number of required points and that the components of the vector of domain values are unique. For all interpolation types other than polynomial-Neville's, the method verifies that the vector of domain values are also sorted in ascending order. For CubicNatPeriodic interpolation type, this method verifies that the first and last p_y values are equal, i.e. \( f(x_0) = f(x_{n-1}) \).
Isis::IException::Programmer | "Interpolation requires a minimim of data points" |
Isis::IException::Programmer | "Invalid data set, x-values must be unique" |
Isis::IException::Programmer | "Invalid data set, x-values must be in ascending order" (if interpolation type is not polynomial-Neville's) |
Isis::IException::Programmer | "First and last points of the data set must have the same y-value" (if interpolation type is cubic-periodic) |
References _FILEINFO_, Isis::NumericalApproximation::CubicNatPeriodic, Isis::NumericalApproximation::MinPoints(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::p_dataValidated, Isis::NumericalApproximation::p_itype, Isis::NumericalApproximation::p_x, Isis::NumericalApproximation::p_y, Isis::NumericalApproximation::PolynomialNeville, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::Size().
Referenced by Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::NumericalApproximation(), and Isis::NumericalApproximation::NumericalApproximation().
|
protectedinherited |
Returns the domain value at which to evaluate.
This protected method is called by Evaluate() if a falls outside of the domain of p_x values in the data set. The return value is determined by the NumericalApproximation::ExtrapType. If it is ThrowError, an error is thrown indicating that a is out of the domain. If it is NearestEndpoint, then the nearest domain boundary value is returned. Otherwise, i.e. Extrapolate, a is returned as long as the NumericalApproximation::InterpType is not GSL or cubic neighborhood.
a | Value passed into Evaluate() that falls outside of domain. |
etype | NumericalApproximation::ExtrapType enum value indicates how to evaluate if a falls outside of the domain. (Default: ThrowError) |
Isis::IException::Programmer | "Invalid argument. Value entered is outside of domain @throws Isis::IException::Programmer "Invalid argument. Cannot extrapolate for interpolation type" (GSL or CubicNeighborhood) |
References _FILEINFO_, Isis::NumericalApproximation::CubicNeighborhood, Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::GslInterpType(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::NearestEndpoint, Isis::NumericalApproximation::p_itype, Isis::IException::Programmer, Isis::NumericalApproximation::ReportException(), and Isis::NumericalApproximation::ThrowError.
Referenced by Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::Evaluate(), and Isis::NumericalApproximation::EvaluateCubicNeighborhood().
|
protectedinherited |
Lookup accelorator.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslDeallocation(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), and Isis::NumericalApproximation::Init().
|
protectedinherited |
Flag variable to determine whether ComputeCubicClamped() has been called.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::CubicClampedSecondDerivatives(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
First derivative of first x-value, p_x[0]. This is only used for the CubicClamped interpolation type.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
First derivative of last x-value, p_x[n-1]. This is only used for the CubicClamped interpolation type.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
Flag variable to determine whether SetCubicClampedEndptDeriv() has been called after all data was added for CubicClamped interpolation.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
List of second derivatives evaluated at p_x values. This is only used for the CubicClamped interpolation type.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::CubicClampedSecondDerivatives(), Isis::NumericalApproximation::EvaluateCubicClamped(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
Flag variable to determine whether ValidateDataSet() has been called.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::BackwardFirstDifference(), Isis::NumericalApproximation::BackwardSecondDifference(), Isis::NumericalApproximation::CenterFirstDifference(), Isis::NumericalApproximation::CenterSecondDifference(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::ForwardFirstDifference(), Isis::NumericalApproximation::ForwardSecondDifference(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetInterpType(), and Isis::NumericalApproximation::ValidateDataSet().
|
protectedinherited |
List of first derivatives corresponding to each x value in the data set (i.e. each value in p_x)
Referenced by Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
Currently active interpolator.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslDeallocation(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), and Isis::NumericalApproximation::Init().
|
staticprotectedinherited |
Maintains list of interpolator options.
Referenced by Isis::NumericalApproximation::GslFunctor(), and Isis::NumericalApproximation::Init().
|
protectedinherited |
Interpolation type.
Referenced by Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::AddCubicHermiteDeriv(), Isis::NumericalApproximation::CubicClampedSecondDerivatives(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::GslAllocation(), Isis::NumericalApproximation::GslComputed(), Isis::NumericalApproximation::GslFirstDerivative(), Isis::NumericalApproximation::GslIntegral(), Isis::NumericalApproximation::GslSecondDerivative(), Isis::NumericalApproximation::InterpolationType(), Isis::NumericalApproximation::MinPoints(), Isis::NumericalApproximation::Name(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::PolynomialNevilleErrorEstimate(), Isis::NumericalApproximation::RefineExtendedTrap(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::SetCubicClampedEndptDeriv(), Isis::NumericalApproximation::SetInterpType(), Isis::NumericalApproximation::ValidateDataSet(), Isis::NumericalApproximation::ValueToExtrapolate(), and Isis::NumericalApproximation::~NumericalApproximation().
|
protectedinherited |
Estimate of error for interpolation evaluated at x. This is only used for the PolynomialNeville interpolation type. 91 taken from AtmosModel.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::Evaluate(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::PolynomialNevilleErrorEstimate(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::SetInterpType().
|
protectedinherited |
List of X values.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::Contains(), Isis::NumericalApproximation::DomainMaximum(), Isis::NumericalApproximation::DomainMinimum(), Isis::NumericalApproximation::EvaluateCubicClamped(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::FindIntervalLowerIndex(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), Isis::NumericalApproximation::Size(), and Isis::NumericalApproximation::ValidateDataSet().
|
protectedinherited |
List of Y values.
Referenced by Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::AddData(), Isis::NumericalApproximation::ComputeCubicClamped(), Isis::NumericalApproximation::ComputeGsl(), Isis::NumericalApproximation::EvaluateCubicClamped(), Isis::NumericalApproximation::EvaluateCubicHermite(), Isis::NumericalApproximation::EvaluateCubicHermiteFirstDeriv(), Isis::NumericalApproximation::EvaluateCubicHermiteSecDeriv(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluateCubicNeighborhood(), Isis::NumericalApproximation::EvaluatePolynomialNeville(), Isis::NumericalApproximation::NumericalApproximation(), Isis::NumericalApproximation::operator=(), Isis::NumericalApproximation::Reset(), and Isis::NumericalApproximation::ValidateDataSet().