Hex  1.0
Hydrogen-electron collision solver
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
interpolate.h File Reference
#include <algorithm>
#include <gsl/gsl_interp.h>
#include "arrays.h"
Include dependency graph for interpolate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
NumberArray< T > interpolate (rArray const &x0, NumberArray< T > const &y0, rArray const &x)
 Return linearly interpolated values. More...
 
rArray interpolate_real (rArray const &x0, rArray const &y0, rArray const &x, const gsl_interp_type *interpolation)
 Return values interpolated by O₂scl. More...
 

Function Documentation

template<typename T >
NumberArray<T> interpolate ( rArray const &  x0,
NumberArray< T > const &  y0,
rArray const &  x 
)

Returns an array of interpolates of the array y0 for every value of x.

Parameters
x0X-values for the discrete samples.
y0Discrete samples
xEvaluation (interpolation) points.
rArray interpolate_real ( rArray const &  x0,
rArray const &  y0,
rArray const &  x,
const gsl_interp_type *  interpolation 
)
inline

Returns an array of interpolates of the array y0 for every value of x.

Parameters
x0X-values for the discrete samples.
y0Discrete samples
xEvaluation (interpolation) points.
interpolationInterpolation type.
  • gsl_interp_linear : Linear interpolation. This interpolation method does not require any additional memory.
  • gsl_interp_polynomial : Polynomial interpolation. This method should only be used for interpolating small numbers of points because polynomial interpolation introduces large oscillations, even for well-behaved datasets. The number of terms in the interpolating polynomial is equal to the number of points.
  • gsl_interp_cspline : Cubic spline with natural boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data-points. The second derivative is chosen to be zero at the first point and last point.
  • gsl_interp_cspline_periodic : Cubic spline with periodic boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data-points. The derivatives at the first and last points are also matched. Note that the last point in the data must have the same y-value as the first point, otherwise the resulting periodic interpolation will have a discontinuity at the boundary.
  • gsl_interp_akima : Non-rounded Akima spline with natural boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.
  • gsl_interp_akima_periodic : Non-rounded Akima spline with periodic boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.