ProteoWizard
Public Member Functions | Private Member Functions | Private Attributes | List of all members
pwiz::analysis::CubicHermiteSpline Class Reference

An implementation of the IInterpolation interface that acts as a wrapper for a cSpline. More...

#include <CubicHermiteSpline.hpp>

Inheritance diagram for pwiz::analysis::CubicHermiteSpline:
IInterpolation

Public Member Functions

 CubicHermiteSpline (const std::vector< double > &points, const std::vector< double > &values)
 Constructs a CubicHermiteSpline using standard vectors.
 
 CubicHermiteSpline (const Eigen::VectorXd &points, const Eigen::VectorXd &values)
 Constructs a CubicHermiteSpline using Eigen vectors.
 
virtual ~CubicHermiteSpline ()
 
IInterpolation interface
bool IsDifferentiable () override
 Indicates whether the algorithm can provide an interpolated derivative.
 
bool IsIntegrable () override
 Indicates whether the algorithm can provide an interpolated integral.
 
double Differentiate (double x) override
 Derivative at the point x.
 
double Integrate (double a, double b) override
 Definite integral between points a and b over function f.
 
double Interpolate (double x) override
 Interpolate at point x.
 
- Public Member Functions inherited from IInterpolation
virtual ~IInterpolation ()
 

Private Member Functions

void CheckForError () const
 Checks for errors and throws exception if cSpline initialization resulted in an error.
 

Private Attributes

cSpline * cSpline_
 The class containing the algorithm for constructing splines and retrieving interpolated values.
 

Detailed Description

An implementation of the IInterpolation interface that acts as a wrapper for a cSpline.

Definition at line 33 of file CubicHermiteSpline.hpp.

Constructor & Destructor Documentation

◆ CubicHermiteSpline() [1/2]

pwiz::analysis::CubicHermiteSpline::CubicHermiteSpline ( const std::vector< double > &  points,
const std::vector< double > &  values 
)

Constructs a CubicHermiteSpline using standard vectors.

Parameters
pointsThe independent values as a monotonically increasing series
valuesThe dependent values
Precondition
points must be sorted in order of increasing value with no duplicates
points and values must be of the same size

◆ CubicHermiteSpline() [2/2]

pwiz::analysis::CubicHermiteSpline::CubicHermiteSpline ( const Eigen::VectorXd &  points,
const Eigen::VectorXd &  values 
)

Constructs a CubicHermiteSpline using Eigen vectors.

Parameters
pointsThe independent values as a monotonically increasing series
valuesThe dependent values
Precondition
points must be sorted in order of increasing value with no duplicates
points and values must be of the same size

◆ ~CubicHermiteSpline()

virtual pwiz::analysis::CubicHermiteSpline::~CubicHermiteSpline ( )
virtual

Member Function Documentation

◆ IsDifferentiable()

bool pwiz::analysis::CubicHermiteSpline::IsDifferentiable ( )
overridevirtual

Indicates whether the algorithm can provide an interpolated derivative.

Implements IInterpolation.

Referenced by CubicHermiteSplineTest::DiffAndIntegrateTest().

◆ IsIntegrable()

bool pwiz::analysis::CubicHermiteSpline::IsIntegrable ( )
overridevirtual

Indicates whether the algorithm can provide an interpolated integral.

Implements IInterpolation.

Referenced by CubicHermiteSplineTest::DiffAndIntegrateTest().

◆ Differentiate()

double pwiz::analysis::CubicHermiteSpline::Differentiate ( double  x)
overridevirtual

Derivative at the point x.

Parameters
xPoint at which to integrate.
Returns
Value of interpolated derivative.

Implements IInterpolation.

Referenced by CubicHermiteSplineTest::DiffAndIntegrateTest().

◆ Integrate()

double pwiz::analysis::CubicHermiteSpline::Integrate ( double  a,
double  b 
)
overridevirtual

Definite integral between points a and b over function f.

Parameters
[in]aLower bound of the integration interval [a, b].
[in]bUpper bound of the integration interval [a, b].
Returns
Value of the interpolated integral.

Implements IInterpolation.

Referenced by CubicHermiteSplineTest::DiffAndIntegrateTest().

◆ Interpolate()

double pwiz::analysis::CubicHermiteSpline::Interpolate ( double  x)
overridevirtual

Interpolate at point x.

Implements IInterpolation.

Referenced by CubicHermiteSplineTest::InterpolationTest().

◆ CheckForError()

void pwiz::analysis::CubicHermiteSpline::CheckForError ( ) const
private

Checks for errors and throws exception if cSpline initialization resulted in an error.

Member Data Documentation

◆ cSpline_

cSpline* pwiz::analysis::CubicHermiteSpline::cSpline_
private

The class containing the algorithm for constructing splines and retrieving interpolated values.

Definition at line 68 of file CubicHermiteSpline.hpp.


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