1 #ifndef NumericalApproximation_h 2 #define NumericalApproximation_h 7 #include <gsl/gsl_errno.h> 8 #include <gsl/gsl_spline.h> 782 void AddData(
const double x,
const double y);
783 void AddData(
unsigned int n,
double *x,
double *y);
784 void AddData(
const vector <double> &x,
const vector <double> &y);
785 void SetCubicClampedEndptDeriv(
const double yp1,
const double ypn);
786 void AddCubicHermiteDeriv(
unsigned int n,
double *fprimeOfx);
787 void AddCubicHermiteDeriv(
const vector <double> &fprimeOfx);
788 void AddCubicHermiteDeriv(
const double fprimeOfx);
791 double DomainMinimum();
792 double DomainMaximum();
793 bool Contains(
double x);
814 double Evaluate(
const double a,
const ExtrapType &etype = ThrowError);
815 vector <double> Evaluate(
const vector <double> &a,
const ExtrapType &etype = ThrowError);
816 vector <double> PolynomialNevilleErrorEstimate();
817 vector <double> CubicClampedSecondDerivatives();
818 double EvaluateCubicHermiteFirstDeriv(
const double a);
819 double EvaluateCubicHermiteSecDeriv(
const double a);
822 double GslFirstDerivative(
const double a);
823 double BackwardFirstDifference(
const double a,
const unsigned int n = 3,
824 const double h = 0.1);
825 double ForwardFirstDifference(
const double a,
const unsigned int n = 3,
826 const double h = 0.1);
827 double CenterFirstDifference(
const double a,
const unsigned int n = 5,
828 const double h = 0.1);
830 double GslSecondDerivative(
const double a);
831 double BackwardSecondDifference(
const double a,
const unsigned int n = 3,
832 const double h = 0.1);
833 double ForwardSecondDifference(
const double a,
const unsigned int n = 3,
834 const double h = 0.1);
835 double CenterSecondDifference(
const double a,
const unsigned int n = 5,
836 const double h = 0.1);
839 double GslIntegral(
const double a,
const double b);
840 double TrapezoidalRule(
const double a,
const double b);
841 double Simpsons3PointRule(
const double a,
const double b);
842 double Simpsons4PointRule(
const double a,
const double b);
843 double BoolesRule(
const double a,
const double b);
844 double RefineExtendedTrap(
double a,
double b,
double s,
unsigned int n);
845 double RombergsMethod(
double a,
double b);
882 void GslAllocation(
unsigned int npoints);
883 void GslDeallocation();
886 void GslIntegrityCheck(
int gsl_status,
const char *src,
888 void ValidateDataSet();
889 bool InsideDomain(
const double a);
891 bool GslComputed()
const;
893 void ComputeCubicClamped();
894 double ValueToExtrapolate(
const double a,
const ExtrapType &etype);
895 double EvaluateCubicNeighborhood(
const double a);
896 vector <double> EvaluateCubicNeighborhood(
const vector <double> &a,
const ExtrapType &etype);
897 double EvaluateCubicClamped(
const double a);
898 double EvaluateCubicHermite(
const double a);
899 double EvaluatePolynomialNeville(
const double a);
900 vector <double> EvaluateForIntegration(
const double a,
const double b,
901 const unsigned int n);
902 int FindIntervalLowerIndex(
const double a);
905 const string &message,
const char *filesrc,
bool p_clampedEndptsSet
Flag variable to determine whether SetCubicClampedEndptDeriv() has been called after all data was add...
Definition: NumericalApproximation.h:867
vector< double > p_x
List of X values.
Definition: NumericalApproximation.h:856
InterpType
This enum defines the types of interpolation supported in this class.
Definition: NumericalApproximation.h:725
vector< double > p_fprimeOfx
List of first derivatives corresponding to each x value in the data set (i.e. each value in p_x) ...
Definition: NumericalApproximation.h:875
double p_clampedDerivFirstPt
First derivative of first x-value, p_x[0]. This is only used for the CubicClamped interpolation type...
Definition: NumericalApproximation.h:869
Cubic Spline interpolation using 4-pt Neighborhoods with natural boundary conditions.
Definition: NumericalApproximation.h:731
Namespace for the standard library.
Polynomial interpolation.
Definition: NumericalApproximation.h:726
NumericalApproximation provides various numerical analysis methods of interpolation, extrapolation and approximation of a tabulated set of x, y data.
Definition: NumericalApproximation.h:720
Cubic Spline interpolation with natural boundary conditions.
Definition: NumericalApproximation.h:728
Cubic Spline interpolation with periodic boundary conditions.
Definition: NumericalApproximation.h:730
map< InterpType, InterpFunctor > FunctorList
Set up a std::map of GSL interpolator functors. List of function types.
Definition: NumericalApproximation.h:861
Cubic Spline interpolation using the Hermite cubic polynomial.
Definition: NumericalApproximation.h:732
vector< double > p_clampedSecondDerivs
List of second derivatives evaluated at p_x values. This is only used for the CubicClamped interpolat...
Definition: NumericalApproximation.h:871
Linear interpolation.
Definition: NumericalApproximation.h:725
ExtrapType
This enum defines the manner in which a value outside of the domain should be handled if passed to th...
Definition: NumericalApproximation.h:807
Cubic Spline interpolation with clamped boundary conditions.
Definition: NumericalApproximation.h:729
Polynomial interpolation using Neville's algorithm.
Definition: NumericalApproximation.h:727
double p_clampedDerivLastPt
First derivative of last x-value, p_x[n-1]. This is only used for the CubicClamped interpolation type...
Definition: NumericalApproximation.h:870
static FunctorList p_interpFunctors
Maintains list of interpolator options.
Definition: NumericalApproximation.h:865
const gsl_interp_type * InterpFunctor
GSL Interpolation specs.
Definition: NumericalApproximation.h:860
Non-rounded Akima Spline interpolation with natural boundary conditions.
Definition: NumericalApproximation.h:733
ErrorType
Contains a set of exception error types.
Definition: IException.h:127
bool p_dataValidated
Flag variable to determine whether ValidateDataSet() has been called.
Definition: NumericalApproximation.h:858
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
vector< double > p_y
List of Y values.
Definition: NumericalApproximation.h:857
vector< double > p_polyNevError
Estimate of error for interpolation evaluated at x. This is only used for the PolynomialNeville inter...
Definition: NumericalApproximation.h:873
InterpType p_itype
Interpolation type.
Definition: NumericalApproximation.h:855
gsl_interp_accel * p_acc
Lookup accelorator.
Definition: NumericalApproximation.h:863
FunctorList::const_iterator FunctorConstIter
GSL Iterator.
Definition: NumericalApproximation.h:862
unsigned int Size()
Returns the number of the coordinates added to the data set.
Definition: NumericalApproximation.h:799
bool p_clampedComputed
Flag variable to determine whether ComputeCubicClamped() has been called.
Definition: NumericalApproximation.h:868
Evaluate() throws an error if a is outside of the domain.
Definition: NumericalApproximation.h:807
InterpType InterpolationType()
Returns the enumerated type of interpolation chosen.
Definition: NumericalApproximation.h:775
gsl_spline * p_interp
Currently active interpolator.
Definition: NumericalApproximation.h:864