MADNESS
0.10.1
|
An class for 1-D data interpolation based on cubic polynomials. More...
#include <interpolation_1d.h>
Public Member Functions | |
CubicInterpolationTable () | |
template<typename functionT > | |
CubicInterpolationTable (double lo, double hi, int npt, const functionT &f) | |
CubicInterpolationTable (double lo, double hi, int npt, const std::vector< T > &y) | |
template<typename functionT > | |
CubicInterpolationTable (World &world, double lo, double hi, int npt, const functionT &f, const int min_npts_per_task=min_npts_per_task_default) | |
virtual | ~CubicInterpolationTable () |
template<typename functionT > | |
double | err (const functionT &f) const |
T | operator() (double y) const |
Static Public Attributes | |
static int | min_npts_per_task_default = 1024 |
minimum # of points per task More... | |
Protected Member Functions | |
template<typename functionT > | |
CubicInterpolationTable (World *world_ptr, double lo, double hi, int npt, const functionT &f, const int min_npts_per_task=std::numeric_limits< double >::max()) | |
void | make_interpolation (const std::vector< double > &x, const std::vector< T > &p, const int npts_per_task=std::numeric_limits< int >::max(), World *world_ptr=nullptr) |
Static Protected Member Functions | |
static void | cubic_fit (const double *x, const T *f, T *a) |
Protected Attributes | |
std::vector< T > | a |
(1+4)*npt vector of x and polynomial coefficients More... | |
double | h |
Grid spacing. More... | |
double | hi |
Interpolation is in range [lo,hi]. More... | |
double | lo |
Interpolation is in range [lo,hi]. More... | |
int | npt |
No. of grid points. More... | |
double | rh |
1/h More... | |
An class for 1-D data interpolation based on cubic polynomials.
Needs to be passed the endpoints of the interpolation: [lo,hi] and the number of grid points.
Two methods for generating the interpolation are presently supported: 1) Pass in a std::vector containing the y-points. 2) Pass in some object that provides an appropriate () operator, perhaps a function pointer.
|
inlineprotected |
constructs the interpolation table using optional tasking
world_ptr | pointer to the World object whose local taskq to use for tasking; if null, will compute serially | |
lo | the lower bound of the interpolation interval | |
up | the upper bound of the interpolation interval | |
npt | the number of interpolation points | |
[in] | f | a T(T) callable; should be reentrant if npt is less than min_npts_per_task |
[in] | min_npts_per_task | if npt is greater than this and there is more than 1 thread will use tasks |
world
has more than 1 rank References madness::WorldTaskQueue::add(), madness::f, madness::WorldTaskQueue::fence(), madness::CubicInterpolationTable< T >::h, madness::CubicInterpolationTable< T >::make_interpolation(), max, madness::CubicInterpolationTable< T >::npt, p(), madness::ThreadPool::size(), task(), and madness::World::taskq.
|
inline |
|
inline |
constructs the interpolation table serially
lo | the lower bound of the interpolation interval | |
up | the upper bound of the interpolation interval | |
npt | the number of interpolation points | |
[in] | f | a T(T) callable; should be reentrant if npt is less than min_npts_per_task |
[in] | min_npts_per_task | if npt is greater than this and there is more than 1 thread will use tasks |
|
inline |
constructs the interpolation table using optional tasking
world | the World object whose local taskq to use for tasking | |
lo | the lower bound of the interpolation interval | |
up | the upper bound of the interpolation interval | |
npt | the number of interpolation points | |
[in] | f | a T(T) callable; should be reentrant if npt is less than min_npts_per_task |
[in] | min_npts_per_task | if npt is greater than this and there is more than 1 thread will use tasks |
world
has more than 1 rank
|
inline |
|
inlinevirtual |
|
inlinestaticprotected |
References madness::CubicInterpolationTable< T >::a, and madness::f.
Referenced by madness::CubicInterpolationTable< T >::make_interpolation().
|
inline |
|
inlineprotected |
|
inline |
|
protected |
(1+4)*npt vector of x and polynomial coefficients
Referenced by madness::CubicInterpolationTable< T >::cubic_fit(), madness::CubicInterpolationTable< T >::make_interpolation(), and madness::CubicInterpolationTable< T >::operator()().
|
protected |
Grid spacing.
Referenced by madness::CubicInterpolationTable< T >::CubicInterpolationTable(), and madness::CubicInterpolationTable< T >::err().
|
protected |
Interpolation is in range [lo,hi].
|
protected |
Interpolation is in range [lo,hi].
Referenced by madness::CubicInterpolationTable< T >::CubicInterpolationTable(), madness::CubicInterpolationTable< T >::err(), and madness::CubicInterpolationTable< T >::operator()().
|
static |
minimum # of points per task
|
protected |
|
protected |
1/h
Referenced by madness::CubicInterpolationTable< T >::operator()().