|
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) | |
| CubicInterpolationTable (std::vector< T > x, 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 |
| double | get_hi () const |
| double | get_lo () const |
| T | operator() (double y) const |
Static Public Attributes | |
| static int | min_npts_per_task_default |
| minimum # of points per task | |
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() - 1, World *world_ptr=nullptr) |
Static Protected Member Functions | |
| static void | cubic_fit (const double *x, const T *f, T *a) |
| Grid points. Only stored if not evenly spaced. Empty otherwise. | |
Protected Attributes | |
| std::vector< T > | a |
| double | h |
| Below variables meaningful if user does specifies uniform spacing. | |
| double | hi |
| Interpolation is in range [lo,hi]. | |
| double | lo |
| Interpolation is in range [lo,hi]. | |
| int | npt |
| No. of grid points. | |
| std::vector< double > | pts_ |
| Below variables meaningful if user provides grid points. | |
| double | rh |
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 a, madness::WorldTaskQueue::add(), madness::f, madness::WorldTaskQueue::fence(), h, hi, lo, make_interpolation(), npt, p(), rh, madness::ThreadPool::size(), task(), and madness::World::taskq.
Referenced by CubicInterpolationTable(), and CubicInterpolationTable().
|
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 |
References CubicInterpolationTable(), madness::f, hi, lo, and npt.
|
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 References CubicInterpolationTable(), madness::f, hi, lo, min_npts_per_task_default, and npt.
|
inline |
|
inline |
|
inlinevirtual |
|
inlinestaticprotected |
Grid points. Only stored if not evenly spaced. Empty otherwise.
References a, and madness::f.
Referenced by make_interpolation().
|
inline |
|
inline |
References hi.
|
inline |
References lo.
|
inlineprotected |
References a, cubic_fit(), npt, p(), and task().
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), and CubicInterpolationTable().
|
inline |
|
protected |
(1+4)*npt vector of x and polynomial coefficients
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), cubic_fit(), make_interpolation(), and operator()().
|
protected |
Below variables meaningful if user does specifies uniform spacing.
Grid spacing.
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), and err().
|
protected |
Interpolation is in range [lo,hi].
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), get_hi(), and operator()().
|
protected |
Interpolation is in range [lo,hi].
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), err(), get_lo(), and operator()().
|
static |
minimum # of points per task
Referenced by CubicInterpolationTable().
|
protected |
No. of grid points.
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), err(), make_interpolation(), and operator()().
|
protected |
Below variables meaningful if user provides grid points.
Referenced by CubicInterpolationTable(), err(), and operator()().
|
protected |
1/h
Referenced by CubicInterpolationTable(), CubicInterpolationTable(), CubicInterpolationTable(), and operator()().