Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Spline2d< ValType > Class Template Reference

Wrapper for Spline interpolation. More...

#include <OpenMS/MATH/MISC/Spline2d.h>

Public Types

typedef ValType value_type
 

Public Member Functions

 Spline2d (unsigned degree, const std::vector< ValType > &x, const std::vector< ValType > &y)
 
 Spline2d (unsigned degree, const std::map< ValType, ValType > &m)
 
 Spline2d (unsigned degree, const MatrixT &raw_values)
 
ValType eval (ValType x) const
 
ValType derivatives (ValType x, unsigned order) const
 

Private Types

typedef Eigen::Matrix< ValType, Eigen::Dynamic, Eigen::Dynamic > MatrixT
 
typedef Eigen::Matrix< ValType, Eigen::Dynamic, 1 > VectorT
 

Private Member Functions

ValType getNormIndex (ValType x) const
 
void initialize (unsigned degree, const MatrixT &raw_values)
 

Private Attributes

Eigen::Spline< ValType, 2 > spline_
 
ValType minXCoeff_
 
ValType maxXCoeff_
 

Detailed Description

template<typename ValType = double>
class OpenMS::Spline2d< ValType >

Wrapper for Spline interpolation.

Member Typedef Documentation

typedef Eigen::Matrix< ValType, Eigen::Dynamic, Eigen::Dynamic > MatrixT
private
typedef ValType value_type
typedef Eigen::Matrix< ValType, Eigen::Dynamic, 1 > VectorT
private

Constructor & Destructor Documentation

Spline2d ( unsigned  degree,
const std::vector< ValType > &  x,
const std::vector< ValType > &  y 
)
inline

create a spline from two vectors.

One vector holds the x-coordinates the other the y-coordinates. Coordinates must match by index. Vectors must be the same size. Vectors must be sorted by x-coordinate.

References Spline2d< ValType >::initialize().

Spline2d ( unsigned  degree,
const std::map< ValType, ValType > &  m 
)
inline

create a spline from a std::map

References Spline2d< ValType >::initialize().

Spline2d ( unsigned  degree,
const MatrixT raw_values 
)
inline

factory method to create a spline from a Eigen::Matrix

References Spline2d< ValType >::initialize().

Member Function Documentation

ValType derivatives ( ValType  x,
unsigned  order 
) const
inline

evaluates the spline derivative of the given order

References Spline2d< ValType >::getNormIndex(), and Spline2d< ValType >::spline_.

ValType eval ( ValType  x) const
inline

evaluate spline at position x

References Spline2d< ValType >::getNormIndex(), and Spline2d< ValType >::spline_.

Referenced by TOFCalibration::calibrate().

ValType getNormIndex ( ValType  x) const
inlineprivate

calculate the normalized index ([0,1]) for Eigen spline access

References Spline2d< ValType >::minXCoeff_.

Referenced by Spline2d< ValType >::derivatives(), Spline2d< ValType >::eval(), and Spline2d< ValType >::initialize().

void initialize ( unsigned  degree,
const MatrixT raw_values 
)
inlineprivate

Member Data Documentation

ValType maxXCoeff_
private
ValType minXCoeff_
private
Eigen::Spline<ValType,2> spline_
private

OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 12:49:30 using doxygen 1.8.11