ug4
|
Class for inverse distance weighting based on a general data type. More...
#include <invdist_user_data.h>
Public Types | |
typedef TData | data_type |
type of the data to extrapolate More... | |
typedef TPntIterator | t_pnt_iter |
type of the interpolation point iterator More... | |
Static Public Member Functions | |
static void | compute (data_type &res, const MathVector< dim > &pos, number R, t_pnt_iter pnt_beg, t_pnt_iter pnt_end, number order, number small_dist=1e-7) |
computes the interpolation basing on the interpolation points in a given ball More... | |
static void | compute (data_type &res, const MathVector< dim > &pos, t_pnt_iter pnt_beg, t_pnt_iter pnt_end, number order, number small_dist=1e-7) |
computes the interpolation basing on all the interpolation points More... | |
Static Public Attributes | |
static const int | dim = WDim |
dimensionality of the space (i.e. of the coordinate vectors) More... | |
Class for inverse distance weighting based on a general data type.
The static functions in the class compute the field given by the IDW interpolation of a given order for given interpolation points and values. Type of the values specified by the template parameter (and may be a scalar or a tensor arithmetic type).
Having a set of interpolation points \( \mathbf{x}_i \) with values \( u_i \) at them, the interpolated value \( u \) at point \( \mathbf{x} \not\in \{ \mathbf{x}_i \} \) is computed as
\begin{eqnarray*} u = \frac {\sum_i w_i \cdot u_i} {\sum_i w_i}, \end{eqnarray*}
where
\begin{eqnarray*} w_i := \frac{1}{\| \mathbf{x} - \mathbf{x}_i \|_2^p} \end{eqnarray*}
( \( p \) being the order of the interpolation). For \( \mathbf{x} = \mathbf{x}_i \) (up to some numerical precision), we set \( u = u_i \).
To loop the interpolation points, iterators of the templated type TPntIterator are used. Every element of the reference elements should have two members: pos and value: TPntIterator ptr; ptr->pos is a MathVector<WDim> object with the coordinates of the interpolation point; ptr->value is a TData object of the value at that point.
WDim | dimensionality of the space |
TPntIterator | interpolation point iterator type |
TData | type of the values to interpolate |
typedef TData ug::IDWInterpolation< WDim, TPntIterator, TData >::data_type |
type of the data to extrapolate
typedef TPntIterator ug::IDWInterpolation< WDim, TPntIterator, TData >::t_pnt_iter |
type of the interpolation point iterator
|
static |
computes the interpolation basing on the interpolation points in a given ball
Computes the interpolation basing on the interpolation points in a given ball.
res | interpolated value |
pos | geometric position where to interpolate |
R | radius of the ball (if 0 then the whole space) |
pnt_beg | the first interpolation point |
pnt_end | delimiter of the iterpolation points |
order | order of the interpolation |
small_dist | distance at which we do not distinguish the points |
References ug::IDWInterpolation< WDim, TPntIterator, TData >::compute(), UG_THROW, and ug::VecDistance().
|
static |
computes the interpolation basing on all the interpolation points
Computes the interpolation basing on all the interpolation point.
res | interpolated value |
pos | geometric position where to interpolate |
pnt_beg | the first interpolation point |
pnt_end | delimiter of the iterpolation points |
order | order of the interpolation |
small_dist | distance at which we do not distinguish the points |
References UG_THROW, and ug::VecDistance().
Referenced by ug::IDWInterpolation< WDim, TPntIterator, TData >::compute(), and ug::IDWUserData< WDim, TData >::evaluate().
|
static |
dimensionality of the space (i.e. of the coordinate vectors)