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...
vector< double > p_x
List of X values.
InterpType
This enum defines the types of interpolation supported in this class.
vector< double > p_fprimeOfx
List of first derivatives corresponding to each x value in the data set (i.e. each value in p_x) ...
double p_clampedDerivFirstPt
First derivative of first x-value, p_x[0]. This is only used for the CubicClamped interpolation type...
Cubic Spline interpolation using 4-pt Neighborhoods with natural boundary conditions.
Namespace for the standard library.
Polynomial interpolation.
NumericalApproximation provides various numerical analysis methods of interpolation, extrapolation and approximation of a tabulated set of x, y data.
Cubic Spline interpolation with natural boundary conditions.
Cubic Spline interpolation with periodic boundary conditions.
map< InterpType, InterpFunctor > FunctorList
Set up a std::map of GSL interpolator functors. List of function types.
Cubic Spline interpolation using the Hermite cubic polynomial.
vector< double > p_clampedSecondDerivs
List of second derivatives evaluated at p_x values. This is only used for the CubicClamped interpolat...
ExtrapType
This enum defines the manner in which a value outside of the domain should be handled if passed to th...
Cubic Spline interpolation with clamped boundary conditions.
Polynomial interpolation using Neville's algorithm.
double p_clampedDerivLastPt
First derivative of last x-value, p_x[n-1]. This is only used for the CubicClamped interpolation type...
static FunctorList p_interpFunctors
Maintains list of interpolator options.
const gsl_interp_type * InterpFunctor
GSL Interpolation specs.
Non-rounded Akima Spline interpolation with natural boundary conditions.
ErrorType
Contains a set of exception error types.
bool p_dataValidated
Flag variable to determine whether ValidateDataSet() has been called.
Namespace for ISIS/Bullet specific routines.
vector< double > p_y
List of Y values.
vector< double > p_polyNevError
Estimate of error for interpolation evaluated at x. This is only used for the PolynomialNeville inter...
InterpType p_itype
Interpolation type.
gsl_interp_accel * p_acc
Lookup accelorator.
FunctorList::const_iterator FunctorConstIter
GSL Iterator.
unsigned int Size()
Returns the number of the coordinates added to the data set.
bool p_clampedComputed
Flag variable to determine whether ComputeCubicClamped() has been called.
Evaluate() throws an error if a is outside of the domain.
InterpType InterpolationType()
Returns the enumerated type of interpolation chosen.
gsl_spline * p_interp
Currently active interpolator.