PCL
pcl::AkimaInterpolation< T > Class Template Reference

Akima subspline interpolation algorithm. More...

#include <AkimaInterpolation.h>

+ Inheritance diagram for pcl::AkimaInterpolation< T >:

Public Types

using coefficient_vector = vector_type
 
using vector_type = typename UnidimensionalInterpolation< T >::vector_type
 
- Public Types inherited from pcl::UnidimensionalInterpolation< double >
using vector_type = GenericVector< double >
 

Public Member Functions

 AkimaInterpolation ()=default
 
 AkimaInterpolation (AkimaInterpolation &&)=default
 
 AkimaInterpolation (const AkimaInterpolation &)=default
 
 ~AkimaInterpolation () override
 
void Clear () override
 
void Initialize (const vector_type &x, const vector_type &y) override
 
bool IsValid () const override
 
PCL_HOT_FUNCTION double operator() (double x) const override
 
AkimaInterpolationoperator= (AkimaInterpolation &&)=default
 
AkimaInterpolationoperator= (const AkimaInterpolation &)=default
 
- Public Member Functions inherited from pcl::UnidimensionalInterpolation< double >
 UnidimensionalInterpolation ()=default
 
 UnidimensionalInterpolation (const UnidimensionalInterpolation &)=default
 
virtual ~UnidimensionalInterpolation ()
 
void Initialize (const double *x, const double *y, int n)
 
virtual void Initialize (const vector_type &x, const vector_type &y)
 
virtual bool IsValid () const
 
int Length () const
 
bool UsingImplicitX () const
 
const vector_typeX () const
 
const vector_typeY () const
 

Detailed Description

template<typename T = double>
class pcl::AkimaInterpolation< T >

References

Hiroshi Akima, A new method of interpolation and smooth curve fitting based on local procedures, Journal of the ACM, Vol. 17, No. 4, October 1970, pages 589-602.

Implementation

Our implementation is based on the book Numerical Algorithms with C, by G. Engeln-Mullges and F. Uhlig (Springer, 1996), section 13.1.

We properly represent corners when a data point lies between two adjacent straight lines with different slopes. This means that our implementation does not impose continuous differentiability, which deviates from the original work by Akima. Supporting the accurate representation of corners has several practical advantages in our opinion; one of them is the enhanced flexibility for the application of Akima interpolation to graphical representations of curves given by a set of prescribed x,y data points.

See also
CubicSplineInterpolation, LinearInterpolation

Definition at line 96 of file AkimaInterpolation.h.

Member Typedef Documentation

◆ coefficient_vector

template<typename T = double>
using pcl::AkimaInterpolation< T >::coefficient_vector = vector_type

Represents a vector of interpolation coefficients.

Definition at line 108 of file AkimaInterpolation.h.

◆ vector_type

template<typename T = double>
using pcl::AkimaInterpolation< T >::vector_type = typename UnidimensionalInterpolation<T>::vector_type

Represents a vector of independent and dependent variable values.

Definition at line 103 of file AkimaInterpolation.h.

Constructor & Destructor Documentation

◆ AkimaInterpolation() [1/3]

template<typename T = double>
pcl::AkimaInterpolation< T >::AkimaInterpolation ( )
default

Constructs an AkimaInterpolation object.

◆ AkimaInterpolation() [2/3]

template<typename T = double>
pcl::AkimaInterpolation< T >::AkimaInterpolation ( const AkimaInterpolation< T > &  )
default

Copy constructor.

◆ AkimaInterpolation() [3/3]

template<typename T = double>
pcl::AkimaInterpolation< T >::AkimaInterpolation ( AkimaInterpolation< T > &&  )
default

Move constructor.

◆ ~AkimaInterpolation()

template<typename T = double>
pcl::AkimaInterpolation< T >::~AkimaInterpolation ( )
inlineoverride

Destroys an AkimaInterpolation object.

Definition at line 138 of file AkimaInterpolation.h.

Member Function Documentation

◆ Clear()

template<typename T = double>
void pcl::AkimaInterpolation< T >::Clear ( )
inlineoverridevirtual

Frees internal data structures in this AkimaInterpolation object.

Reimplemented from pcl::UnidimensionalInterpolation< double >.

Definition at line 301 of file AkimaInterpolation.h.

References pcl::UnidimensionalInterpolation< T >::Clear().

◆ Initialize()

template<typename T = double>
void pcl::AkimaInterpolation< T >::Initialize ( const vector_type x,
const vector_type y 
)
inlineoverride

Initializes a new interpolation.

Parameters
xVector of x-values:

  • If x is not empty: Must be a vector of monotonically increasing, distinct values: x[0] < x[1] < ... < x[n-1].
  • If x is empty: The interpolation will use implicit x[i] = i for i = {0,1,...,n-1}.
yVector of function values for i = {0,1,...,n-1}.

The length of the y vector (and also the length of a nonempty x vector) must be n >= 5. This is because Akima subspline interpolation requires at least 4 subintervals.

Definition at line 158 of file AkimaInterpolation.h.

◆ IsValid()

template<typename T = double>
bool pcl::AkimaInterpolation< T >::IsValid ( ) const
inlineoverride

Returns true iff this interpolation is valid, i.e. if it has been correctly initialized and is ready to interpolate function values.

Definition at line 313 of file AkimaInterpolation.h.

◆ operator()()

template<typename T = double>
PCL_HOT_FUNCTION double pcl::AkimaInterpolation< T >::operator() ( double  x) const
inlineoverridevirtual

Returns an interpolated function value at x location.

Note
Akima subsplines cannot be used for extrapolation. If the specified interpolation point x lies outside the range of interpolation defined upon initialization, this function returns zero conventionally.

Implements pcl::UnidimensionalInterpolation< double >.

Definition at line 255 of file AkimaInterpolation.h.

◆ operator=() [1/2]

template<typename T = double>
AkimaInterpolation& pcl::AkimaInterpolation< T >::operator= ( AkimaInterpolation< T > &&  )
default

Move assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

template<typename T = double>
AkimaInterpolation& pcl::AkimaInterpolation< T >::operator= ( const AkimaInterpolation< T > &  )
default

Copy assignment operator. Returns a reference to this object.


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