DGtal 1.3.0
|
#include <DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h>
Public Types | |
typedef TSpace | Space |
Copy the space type. More... | |
typedef Space::Point | Point |
Type for points. More... | |
typedef Point::Coordinate | Abscissa |
Type for points. More... | |
typedef Space::Vector | Vector |
Type for vectors. More... | |
typedef TRawValue | RawValue |
Type for internal distance values. More... | |
typedef double | Value |
Type for distance values. More... | |
typedef ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue > | Self |
Self type. More... | |
Public Member Functions | |
ExactPredicateLpSeparableMetric () | |
~ExactPredicateLpSeparableMetric () | |
ExactPredicateLpSeparableMetric (const Self &other) | |
Self & | operator= (const Self &other) |
Value | local (const Point &aP, const Vector &aDir) const |
Value | operator() (const Point &aP, const Point &aQ) const |
Closest | closest (const Point &origin, const Point &first, const Point &second) const |
RawValue | rawDistance (const Point &aP, const Point &aQ) const |
bool | hiddenBy (const Point &u, const Point &v, const Point &w, const Point &startingPoint, const Point &endPoint, const typename Point::UnsignedComponent dim) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
Abscissa | binarySearchHidden (const Abscissa &udim, const Abscissa &vdim, const RawValue &nu, const RawValue &nv, const Abscissa &lower, const Abscissa &upper) const |
Definition at line 261 of file ExactPredicateLpSeparableMetric.h.
typedef Point::Coordinate DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Abscissa |
Type for points.
Definition at line 271 of file ExactPredicateLpSeparableMetric.h.
typedef Space::Point DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Point |
Type for points.
Definition at line 269 of file ExactPredicateLpSeparableMetric.h.
typedef TRawValue DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::RawValue |
Type for internal distance values.
Definition at line 276 of file ExactPredicateLpSeparableMetric.h.
typedef ExactPredicateLpSeparableMetric<TSpace,2,TRawValue> DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Self |
Self type.
Definition at line 282 of file ExactPredicateLpSeparableMetric.h.
typedef TSpace DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Space |
Copy the space type.
Definition at line 267 of file ExactPredicateLpSeparableMetric.h.
typedef double DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Value |
Type for distance values.
Definition at line 279 of file ExactPredicateLpSeparableMetric.h.
typedef Space::Vector DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Vector |
Type for vectors.
Definition at line 273 of file ExactPredicateLpSeparableMetric.h.
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::ExactPredicateLpSeparableMetric | ( | ) |
Constructor.
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::~ExactPredicateLpSeparableMetric | ( | ) |
Destructor.
|
inline |
Copy constructor.
other | the object to clone (not used). |
Definition at line 300 of file ExactPredicateLpSeparableMetric.h.
|
private |
Perform a binary search on the interval [lower,upper] to detect the mid-point between u and v according to the l_p distance.
udim | coordinate of u along dimension dim |
vdim | coordinate of v along dimension dim |
nu | partial distance of u (sum of |xj-x_i|^p) discarding the term along the dimension dim |
nv | partial distance of v (sum of |xj-x_i|^p) discarding the term along the dimension dim |
lower | interval lower bound |
upper | interval upper bound |
Closest DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::closest | ( | const Point & | origin, |
const Point & | first, | ||
const Point & | second | ||
) | const |
Given an origin and two points, this method decides which one is closest to the origin. This method should be faster than comparing distance values.
origin | the origin |
first | the first point |
second | the second point |
bool DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::hiddenBy | ( | const Point & | u, |
const Point & | v, | ||
const Point & | w, | ||
const Point & | startingPoint, | ||
const Point & | endPoint, | ||
const typename Point::UnsignedComponent | dim | ||
) | const |
Given three sites (a,b,c) and a straight segment [startingPoint,endPoint] along dimension dim, we detect if the voronoi cells of a and c hide the voronoi cell of c on the straight line.
u | a site |
v | a site |
w | a site |
startingPoint | starting point of the segment |
endPoint | end point of the segment |
dim | direction of the straight line |
bool DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Value DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::local | ( | const Point & | aP, |
const Vector & | aDir | ||
) | const |
Compute the local distance between aP and its displacement along the direction aDir.
aP | a point. |
aDir | a direction. |
Value DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::operator() | ( | const Point & | aP, |
const Point & | aQ | ||
) | const |
Compute the distance between aP and aQ.
aP | a first point. |
aQ | a second point. |
|
inline |
Assignment.
other | the object to copy (unused). |
Definition at line 310 of file ExactPredicateLpSeparableMetric.h.
RawValue DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::rawDistance | ( | const Point & | aP, |
const Point & | aQ | ||
) | const |
Compute an exact representation of Lp distances. We just return the sum of powers without computing the last 1/p power. I.e. only \( \sum |p_i- q_i|^p\) is given.
aP | a first point |
aQ | a second point |
void DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |