\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.9 - 2D and Surface Function Interpolation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Sibson gradient fitting functions

These functions approximate the gradient of a function at a point p given natural neighbor coordinates for p and its neighbors' function values.

The approximation method is described in [9]. Further functions are provided to fit the gradient for all data points that lie inside the convex hull of the data points. One function exists for each type of natural neighbor coordinates.

Requirements

  1. The value type of ForwardIterator is a pair of point/coordinate value, thus std::iterator_traits<ForwardIterator>::value_type::first_type is equivalent to a point and std::iterator_traits<ForwardIterator>::value_type::second_type is a number type.
  2. Functor::argument_type must be equivalent to std::iterator_traits<ForwardIterator>::value_type::first_type and Functor::result_type is the function value type. It must provide a multiplication and addition operation with the type std::iterator_traits<ForwardIterator>::value_type::second_type.
  3. Traits is a model of the concept GradientFittingTraits.
See Also
CGAL::linear_interpolation()
CGAL::sibson_c1_interpolation()
CGAL::farin_c1_interpolation()
CGAL::quadratic_interpolation()
CGAL::Interpolation_gradient_fitting_traits_2<K>
CGAL::natural_neighbor_coordinates_2()
CGAL::regular_neighbor_coordinates_2()
3D Surface Neighbor Coordinates Functions

Implementation

This function implements Sibson's gradient estimation method based on natural neighbor coordinates [9].

Functions

template<class ForwardIterator , class Functor , class Traits >
Traits::Vector_d CGAL::sibson_gradient_fitting (ForwardIterator first, ForwardIterator beyond, const typename std::iterator_traits< ForwardIterator >::value_type::second_type &norm, const typename std::iterator_traits< ForwardIterator >::value_type::first_type &p, Functor f, const Traits &traits)
 estimates the gradient of a function at the point p given natural neighbor coordinates of p in the range [first, beyond) and the function values of the neighbors provided by the functor f. More...
 
template<class Dt , class OutputIterator , class Functor , class Traits >
OutputIterator CGAL::sibson_gradient_fitting_nn_2 (const Dt &dt, OutputIterator out, Functor f, const Traits &traits)
 estimates the function gradients at all vertices of dt that lie inside the convex hull using the coordinates computed by the function PkgInterpolationNaturalNeighborCoordinates2. More...
 
template<class Rt , class OutputIterator , class Functor , class Traits >
OutputIterator CGAL::sibson_gradient_fitting_rn_2 (const Rt &rt, OutputIterator out, Functor f, const Traits &traits)
 estimates the function gradients at all vertices of rt that lie inside the convex hull using the coordinates computed by the functions PkgInterpolationRegularNeighborCoordinates2. More...
 

Function Documentation

template<class ForwardIterator , class Functor , class Traits >
Traits::Vector_d CGAL::sibson_gradient_fitting ( ForwardIterator  first,
ForwardIterator  beyond,
const typename std::iterator_traits< ForwardIterator >::value_type::second_type &  norm,
const typename std::iterator_traits< ForwardIterator >::value_type::first_type &  p,
Functor  f,
const Traits &  traits 
)

estimates the gradient of a function at the point p given natural neighbor coordinates of p in the range [first, beyond) and the function values of the neighbors provided by the functor f.

norm is the normalization factor of the barycentric coordinates.

#include <CGAL/sibson_gradient_fitting.h>

template<class Dt , class OutputIterator , class Functor , class Traits >
OutputIterator CGAL::sibson_gradient_fitting_nn_2 ( const Dt &  dt,
OutputIterator  out,
Functor  f,
const Traits &  traits 
)

estimates the function gradients at all vertices of dt that lie inside the convex hull using the coordinates computed by the function PkgInterpolationNaturalNeighborCoordinates2.

The value type of OutputIterator is a pair associating a point to a vector. The sequence of point/gradient pairs computed by this function is placed starting at out. The function returns an iterator that is placed past-the-end of the resulting sequence. The requirements are the same as above. The template class Dt must be equivalent to Delaunay_triangulation_2<Gt, Tds>.

#include <CGAL/sibson_gradient_fitting.h>

Examples:
Interpolation/sibson_interpolation_2.cpp.
template<class Rt , class OutputIterator , class Functor , class Traits >
OutputIterator CGAL::sibson_gradient_fitting_rn_2 ( const Rt &  rt,
OutputIterator  out,
Functor  f,
const Traits &  traits 
)

estimates the function gradients at all vertices of rt that lie inside the convex hull using the coordinates computed by the functions PkgInterpolationRegularNeighborCoordinates2.

The value type of OutputIterator is a pair associating a point to a vector. The sequence of point/gradient pairs computed by this function is placed starting at out. The function returns an iterator that is placed past-the-end of the resulting sequence. The requirements are the same as above. The template class Rt must be equivalent to Regular_triangulation_2<Gt, Tds>.

#include <CGAL/sibson_gradient_fitting.h>