CGAL 4.8.2 - dD Spatial Searching
|
#include <CGAL/Weighted_Minkowski_distance.h>
The class Weighted_Minkowski_distance
provides an implementation of the concept OrthogonalDistance
, with a weighted Minkowski metric on d-dimensional points defined by lp(w)(r,q)=(Σi=di=1wi(ri−qi)p)1/p for 0<p<∞ and defined by l∞(w)(r,q)=max{wi|ri−qi|∣1≤i≤d}.
For the purpose of the distance computations it is more efficient to compute the transformed distance σi=di=1wi(ri−qi)p instead of the actual distance.
Traits | must be a model of the concept SearchTraits , for example Search_traits_2 . |
OrthogonalDistance
CGAL::Euclidean_distance<Traits>
Types | |
typedef Traits::Dimension | D |
Dimension tag. | |
typedef Traits::FT | FT |
Number type. | |
typedef Traits::Point_d | Point_d |
Point type. | |
Creation | |
Weighted_Minkowski_distance (int d, Traits t=Traits()) | |
Constructor implementing l2 metric for d-dimensional points. | |
template<class InputIterator > | |
Weighted_Minkowski_distance (FT power, int dim, InputIterator wb, InputIterator we, Traits t=Traits()) | |
Constructor implementing the lpower(weights) metric. More... | |
Operations | |
FT | transformed_distance (Point_d q, Point_d r) const |
Returns dpower, where d denotes the distance between q and r . | |
FT | min_distance_to_rectangle (Point_d q, Kd_tree_rectangle< FT, D > r) const |
Returns dpower, where d denotes the distance between the query item q and the point on the boundary of r closest to q . | |
FT | min_distance_to_rectangle (Point_d q, Kd_tree_rectangle< FT, D > r, vector< FT > &dists) |
Returns dpower, where d denotes the distance between the query item q and the point on the boundary of r closest to q . More... | |
FT | max_distance_to_rectangle (Point_d q, Kd_tree_rectangle< FT, D > r) const |
Returns dpower, where d denotes the distance between the query item q and the point on the boundary of r farthest to q . | |
FT | max_distance_to_rectangle (Point_d q, Kd_tree_rectangle< FT, D > r, vector< FT > &dists) |
Returns dpower, where d denotes the distance between the query item q and the point on the boundary of r farthest to q . More... | |
FT | new_distance (FT dist, FT old_off, FT new_off, int cutting_dimension) const |
Updates dist incrementally and returns the updated distance. | |
FT | transformed_distance (FT d) const |
Returns dp for 0<p<∞ . More... | |
FT | inverse_of_transformed_distance (FT d) const |
Returns d1/p for 0<p<∞. More... | |
CGAL::Weighted_Minkowski_distance< Traits >::Weighted_Minkowski_distance | ( | FT | power, |
int | dim, | ||
InputIterator | wb, | ||
InputIterator | we, | ||
Traits | t = Traits() |
||
) |
Constructor implementing the lpower(weights) metric.
power≤0 denotes the l∞(weights) metric. The values in the iterator range [wb,we)
are the weight.
FT CGAL::Weighted_Minkowski_distance< Traits >::inverse_of_transformed_distance | ( | FT | d) | const |
Returns d1/p for 0<p<∞.
Returns d for p=∞.
FT CGAL::Weighted_Minkowski_distance< Traits >::max_distance_to_rectangle | ( | Point_d | q, |
Kd_tree_rectangle< FT, D > | r, | ||
vector< FT > & | dists | ||
) |
Returns dpower, where d denotes the distance between the query item q
and the point on the boundary of r
farthest to q
.
Stores the distances in each dimension in dists
.
FT CGAL::Weighted_Minkowski_distance< Traits >::min_distance_to_rectangle | ( | Point_d | q, |
Kd_tree_rectangle< FT, D > | r, | ||
vector< FT > & | dists | ||
) |
Returns dpower, where d denotes the distance between the query item q
and the point on the boundary of r
closest to q
.
Stores the distances in each dimension in dists
.
FT CGAL::Weighted_Minkowski_distance< Traits >::transformed_distance | ( | FT | d) | const |
Returns dp for 0<p<∞ .
Returns d for p=∞ .