|
enum | Style {
UNKNOWN = -1,
CONSTANT = 0,
LINEAR = 1,
NATURAL_SPLINE = 2,
CUBIC_SPLINE = 3,
CUBIC_SPLINE_PERIODIC = 4,
AKIMA_SPLINE = 5,
AKIMA_SPLINE_PERIODIC = 6,
NUM_STYLES
} |
|
| Interpolate (std::vector< double > const &x, std::vector< double > const &y, Interpolate::Style const style=UNKNOWN) |
|
| Interpolate (std::pair< std::vector< double >, std::vector< double > > const xy, Interpolate::Style const style=UNKNOWN) |
|
std::vector< double > const | _x |
|
std::vector< double > const | _y |
|
Interpolate::Style const | _style |
|
Definition at line 174 of file Interpolate.cc.
lsst.afw.math::InterpolateGsl::~InterpolateGsl |
( |
| ) |
|
|
virtual |
Definition at line 218 of file Interpolate.cc.
220 ::gsl_interp_accel_free(
_acc);
::gsl_interp_accel * _acc
lsst.afw.math::InterpolateGsl::InterpolateGsl |
( |
std::vector< double > const & |
x, |
|
|
std::vector< double > const & |
y, |
|
|
Interpolate::Style const |
style |
|
) |
| |
|
private |
- Parameters
-
x | the x-values of points |
y | the values at x[] |
style | desired interpolator |
Definition at line 188 of file Interpolate.cc.
194 _acc = ::gsl_interp_accel_alloc();
196 throw LSST_EXCEPT(pex::exceptions::MemoryError,
"gsl_interp_accel_alloc failed");
201 throw LSST_EXCEPT(pex::exceptions::OutOfRangeError,
202 str(
boost::format(
"Failed to initialise spline for type %s, length %d")
210 int const status = ::gsl_interp_init(
_interp, &x[0], &y[0],
_y.size());
214 % ::gsl_strerror(status) % status));
std::vector< double > const _y
::gsl_interp_accel * _acc
::gsl_interp_type const * _interpType
#define LSST_EXCEPT(type,...)
Interpolate(std::vector< double > const &x, std::vector< double > const &y, Interpolate::Style const style=UNKNOWN)
double lsst.afw.math::InterpolateGsl::interpolate |
( |
double const |
x | ) |
const |
|
virtual |
Implements lsst.afw.math::Interpolate.
Definition at line 223 of file Interpolate.cc.
228 if ((xInterp <
_x.front() || (xInterp >
_x.back()))) {
239 if (xInterp <
_x.front()) {
249 double d2 = ::gsl_interp_eval_deriv2(
_interp, &
_x[0], &
_y[0], x0,
_acc);
250 return y0 + (xInterp -
x0)*d + 0.5*(xInterp - x0)*(xInterp -
x0)*d2;
252 assert(xInterp >=
_x.front());
253 assert(xInterp <=
_x.back());
std::vector< double > const _y
::gsl_interp_accel * _acc
std::vector< double > const _x
boost::shared_ptr< Interpolate > makeInterpolate |
( |
std::vector< double > const & |
x, |
|
|
std::vector< double > const & |
y, |
|
|
Interpolate::Style const |
style |
|
) |
| |
|
friend |
A factory function to make Interpolate objects
::gsl_interp_accel* lsst.afw.math::InterpolateGsl::_acc |
|
private |
::gsl_interp* lsst.afw.math::InterpolateGsl::_interp |
|
private |
::gsl_interp_type const* lsst.afw.math::InterpolateGsl::_interpType |
|
private |
The documentation for this class was generated from the following file: