Multi-dimensional interpolation by inverse distance weighting. More...
This class performs interpolation on a multi-dimensional data set specified as a series of scattered points using the inverse distance-weighted average of the nearest three points. The function set_data() takes as input: the number of dimensions, the number of points which specify the data, and a "vector of vectors", e.g. std::vector<std::vector<double> >
which contains the data for all the points.
Definition at line 54 of file interpm_idw.h.
#include <interpm_idw.h>
Public Types | |
typedef boost::numeric::ublas::vector < double > | ubvector |
typedef boost::numeric::ublas::vector < size_t > | ubvector_size_t |
Public Member Functions | |
template<class vec_vec_t > | |
void | set_data (size_t dim, size_t n_points, vec_vec_t &vecs) |
Initialize the data for the interpolation. More... | |
template<class vec2_t > | |
double | operator() (vec2_t &x) const |
Perform the interpolation. | |
template<class vec2_t > | |
double | eval (vec2_t &x) const |
Perform the interpolation. | |
Data Fields | |
ubvector | scales |
Distance scales for each coordinate. | |
Protected Member Functions | |
template<class vec2_t > | |
double | dist (size_t index, vec2_t &x) const |
Compute the distance between x and the point at index index . | |
int | swap (size_t &index_1, double &dist_1, size_t &index_2, double &dist_2) const |
Swap points 1 and 2. | |
Protected Attributes | |
size_t | np |
The number of points. | |
size_t | nd |
The number of dimensions. | |
std::vector< vec_t * > | ptrs |
A vector of pointers holding the data. | |
bool | data_set |
True if the data has been specified. | |
|
inline |
The object vecs
should be a vector (of size dim+1
) of vectors (all of size n_points
). It may have any type for which the data can be accessed through operator[][]
.
Definition at line 78 of file interpm_idw.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).
Hosted at
.