CGAL::sibson_c1_interpolation

Definition

The function sibson_c1_interpolation interpolates the function values and the gradients that are provided by functors following the method described in [Sib81].

Parameters

The template parameter Traits is to be instantiated with a model of InterpolationTraits. ForwardIterator::value_type is a pair associating a point to a (non-normalized) barycentric coordinate. norm is the normalization factor. The range [. first,beyond.) contains the barycentric coordinates for the query point p. The functor function_value allows to access the value of the interpolated function given a point. function_gradient allows to access the function gradient given a point.

#include <CGAL/interpolation_functions.h>

template < class ForwardIterator, class Functor, class GradFunctor, class Traits>
std::pair< typename Functor::result_type, bool>
sibson_c1_interpolation ( ForwardIterator first,
ForwardIterator beyond,
typename std::iterator_traits<ForwardIterator>::value_type::second_type norm,
typename std::iterator_traits<ForwardIterator>::value_type:: first_type p,
Functor function_value,
GradFunctor function_gradient,
Traits traits)
This function generates the interpolated function value at the point p using Sibson's Z1 interpolant [Sib81].
If the functor function_gradient cannot supply the gradient of a point, the function returns a pair where the boolean is set to false. If the interpolation was successful, the pair contains the interpolated function value as first and true as second value.
Precondition: norm 0. function_value(p).second == true for all points p of the point/coordinate pairs in the range [.first, beyond.).

Requirements

  1. Traits is a model of the concept InterpolationTraits .
  2. ForwardIterator::value_type is a point/coordinate pair. Precisely ForwardIterator::value_type::first_type is equivalent to Traits::Point_d and ForwardIterator::value_type::second_type is equivalent to Traits::FT.
  3. Functor::argument_type must be equivalent to Traits::Point_d and Functor::result_type is a pair of the function value type and a boolean. The function value type must provide a multiplication and addition operation with the type Traits::FT as well as a constructor with argument 0.
  4. GradFunctor::argument_type must be equivalent to Traits::Point_d and Functor::result_type is a pair of the function's gradient type and a boolean. The function gradient type must provide a multiplication operation with Traits::Vector_d.
  5. A model of the functor types Functor (resp. GradFunctor) is provided by the struct Data_access. It must be instantiated accordingly with an associative container (e.g. STL std::map) having the point type as key_type and the function value type (resp. function gradient type) as mapped_type.
  6. The number type FT provided by Traits must support the square root operation sqrt().

template < class ForwardIterator, class Functor, class GradFunctor, class Traits>
typename Functor::result_type
sibson_c1_interpolation_square ( ForwardIterator first,
ForwardIterator beyond,
typename std::iterator_traits<ForwardIterator>::value_type::second_type norm,
Functor function_value,
GradFunctor function_gradient,
Traits traits)
The same as above except that no square root operation is needed for FT.

See Also

InterpolationTraits
GradientFittingTraits
CGAL::Data_access<Map>
CGAL::sibson_gradient_fitting
CGAL::linear_interpolation
CGAL::Interpolation_traits_2<K>
CGAL::Interpolation_gradient_fitting_traits_2<K>
CGAL::natural_neighbor_coordinates_2
CGAL::regular_neighbor_coordinates_2
CGAL::surface_neighbor_coordinates_3