CGAL 4.6 - 2D and Surface Function Interpolation
|
Modules | |
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. | |
Classes | |
class | CGAL::Interpolation_gradient_fitting_traits_2< K > |
Interpolation_gradient_fitting_traits_2 is a model for the concepts InterpolationTraits and GradientFittingTraits . More... | |
class | CGAL::Interpolation_traits_2< K > |
Interpolation_traits_2 is a model for the concept InterpolationTraits and can be used to instantiate the geometric traits class of interpolation methods applied on a bivariate function over a two-dimensional domain. More... | |
Functions | |
template<class RandomAccessIterator , class Functor , class GradFunctor , class Traits > | |
Functor::result_type | CGAL::farin_c1_interpolation (RandomAccessIterator first, RandomAccessIterator beyond, const typename std::iterator_traits< RandomAccessIterator >::value_type::second_type &norm, const typename std::iterator_traits< ForwardIterator >::value_type::first_type &p, Functor function_value, GradFunctor function_gradient, const Traits &traits) |
generates the interpolated function value computed by Farin's interpolant. More... | |
template<class ForwardIterator , class Functor > | |
Functor::result_type::first_type | CGAL::linear_interpolation (ForwardIterator first, ForwardIterator beyond, const typename std::iterator_traits< ForwardIterator >::value_type::second_type &norm, Functor function_values) |
The function linear_interpolation() computes the weighted sum of the function values which must be provided via a functor. More... | |
template<class ForwardIterator , class Functor , class GradFunctor , class Traits > | |
Functor::result_type | CGAL::quadratic_interpolation (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 function_value, GradFunctor function_gradient, const Traits &traits) |
The function quadratic_interpolation() generates the interpolated function value as the weighted sum of the values plus a linear term in the gradient for each point of the point/coordinate pairs in the range [first, beyond) . More... | |
template<class ForwardIterator , class Functor , class GradFunctor , class Traits > | |
std::pair< typename Functor::result_type, bool > | CGAL::sibson_c1_interpolation (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 function_value, GradFunctor function_gradient, const Traits &traits) |
The function sibson_c1_interpolation() generates the interpolated function value at the point p , using functors for the function values and the gradients, by applying Sibson's \( Z^1\) interpolant. More... | |
template<class ForwardIterator , class Functor , class GradFunctor , class Traits > | |
Functor::result_type | CGAL::sibson_c1_interpolation_square (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 function_value, GradFunctor function_gradient, const Traits &traits) |
The same as sibson_c1_interpolation() except that no square root operation is needed for FT. | |
Functor::result_type CGAL::farin_c1_interpolation | ( | RandomAccessIterator | first, |
RandomAccessIterator | beyond, | ||
const typename std::iterator_traits< RandomAccessIterator >::value_type::second_type & | norm, | ||
const typename std::iterator_traits< ForwardIterator >::value_type::first_type & | p, | ||
Functor | function_value, | ||
GradFunctor | function_gradient, | ||
const Traits & | traits | ||
) |
generates the interpolated function value computed by Farin's interpolant.
norm
\( \neq0\). function_value(p).second == true
for all points p
of the point/coordinate pairs in the range [first, beyond)
. [first, beyond)
contains either one or more than three elements. The function farin_c1_interpolation()
interpolates the function values and the gradients that are provided by functors using the method described in [4].Parameters
The value type of RandomAccessIterator
is a pair associating a point to a (non-normalized) barycentric coordinate. See sibson_c1_interpolation()
for the other parameters.
Requirements
Same requirements as for sibson_c1_interpolation()
only the iterator must provide random access and Traits::FT
does not need to provide the square root operation.
CGAL::Data_access<Map>
CGAL::linear_interpolation()
CGAL::sibson_c1_interpolation()
CGAL::Interpolation_traits_2<K>
CGAL::natural_neighbor_coordinates_2()
CGAL::regular_neighbor_coordinates_2()
#include <CGAL/interpolation_functions.h>
Functor::result_type::first_type CGAL::linear_interpolation | ( | ForwardIterator | first, |
ForwardIterator | beyond, | ||
const typename std::iterator_traits< ForwardIterator >::value_type::second_type & | norm, | ||
Functor | function_values | ||
) |
The function linear_interpolation()
computes the weighted sum of the function values which must be provided via a functor.
ForwardIterator | must have as value type a pair associating a point to a (non-normalized) barycentric coordinate, that is std::iterator_traits<ForwardIterator>::value_type::first_type is equivalent to a point and std::iterator_traits<ForwardIterator>::value_type::second_type is a field number type. |
Functor | The type Functor::argument_type must be equivalent to std::iterator_traits<ForwardIterator>::value_type::first_type and Functor::result_type is a pair of the function value type and a Boolean value. The function value type must provide a multiplication and addition operation with the field number type std::iterator_traits<ForwardIterator>::value_type::second_type and a constructor with argument 0 . |
A model of the functor is provided by the struct Data_access
. It must be instantiated accordingly with an associative container (e.g. std::map
) having the point type as key_type
and the function value type as mapped_type
.
first,beyond | are the iterator range for the weighted input points. |
norm | is the normalization factor. norm \( \neq0\). |
function_values | is a functor that allows to access a pair of a function value and a Boolean for a given point. The Boolean indicates whether the function value could be retrieved correctly. This function generates the interpolated function value as the weighted sum of the values corresponding to each point of the point/coordinate pairs in the range [first, beyond) . function_value(q).second == true for all points q of the point/coordinate pairs in the range [first, beyond) . |
CGAL::Data_access<Map>
CGAL::natural_neighbor_coordinates_2()
CGAL::regular_neighbor_coordinates_2()
#include <CGAL/interpolation_functions.h>
Functor::result_type CGAL::quadratic_interpolation | ( | 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 | function_value, | ||
GradFunctor | function_gradient, | ||
const Traits & | traits | ||
) |
The function quadratic_interpolation()
generates the interpolated function value as the weighted sum of the values plus a linear term in the gradient for each point of the point/coordinate pairs in the range [first, beyond)
.
Parameters and Template Parameters
The same as for sibson_c1_interpolation()
only that Traits::FT
does not need to provide the square root operation.
InterpolationTraits
GradientFittingTraits
CGAL::Data_access<Map>
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()
#include <CGAL/interpolation_functions.h>
std::pair< typename Functor::result_type,bool> CGAL::sibson_c1_interpolation | ( | 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 | function_value, | ||
GradFunctor | function_gradient, | ||
const Traits & | traits | ||
) |
The function sibson_c1_interpolation()
generates the interpolated function value at the point p
, using functors for the function values and the gradients, by applying Sibson's \( Z^1\) interpolant.
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.
Traits | must be a model of InterpolationTraits . The number type FT provided by Traits must support the square root operation sqrt() . |
ForwardIterator | must have as value type a pair associating a point to a (non-normalized) barycentric coordinate. More precisely, std::iterator_traits<ForwardIterator>::value_type::first_type is equivalent to Traits::Point_d and std::iterator_traits<ForwardIterator>::value_type::second_type is equivalent to Traits::FT . |
Functor | must be a functor where 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 . |
GradFunctor | must be a functor where 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 . |
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. std::map
) having the point type as key_type
and the function value type (resp. function gradient type) as mapped_type
.
first,beyond | is the iterator range of the barycentric coordinates for the query point p . |
norm | is the normalization factor. norm \( \neq0\). |
p | is the point at which the interpolated function value is generated |
function_value | is a functor that allows to access the value of the interpolated function given a point. function_value(q).second == true for all points q of the point/coordinate pairs in the range [first, beyond) |
function_gradient | is a functor that allows to access the function gradient given a point. |
traits | is an instance of the traits class |
InterpolationTraits
GradientFittingTraits
CGAL::Data_access<Map>
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()
#include <CGAL/interpolation_functions.h>