PCL
|
Akima subspline interpolation algorithm. More...
#include <AkimaInterpolation.h>
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 |
AkimaInterpolation & | operator= (AkimaInterpolation &&)=default |
AkimaInterpolation & | operator= (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) |
int | Length () const |
bool | UsingImplicitX () const |
const vector_type & | X () const |
const vector_type & | Y () const |
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.
Definition at line 96 of file AkimaInterpolation.h.
using pcl::AkimaInterpolation< T >::coefficient_vector = vector_type |
Represents a vector of interpolation coefficients.
Definition at line 108 of file AkimaInterpolation.h.
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.
|
default |
Constructs an AkimaInterpolation object.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inlineoverride |
Destroys an AkimaInterpolation object.
Definition at line 138 of file AkimaInterpolation.h.
|
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().
|
inlineoverride |
Initializes a new interpolation.
x | Vector of x-values:
|
y | Vector 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.
|
inlineoverridevirtual |
Returns true iff this interpolation is valid, i.e. if it has been correctly initialized and is ready to interpolate function values.
Reimplemented from pcl::UnidimensionalInterpolation< double >.
Definition at line 313 of file AkimaInterpolation.h.
|
inlineoverridevirtual |
Returns an interpolated function value at x location.
Implements pcl::UnidimensionalInterpolation< double >.
Definition at line 255 of file AkimaInterpolation.h.
|
default |
Move assignment operator. Returns a reference to this object.
|
default |
Copy assignment operator. Returns a reference to this object.