DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue > Class Template Reference

#include <DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h>

Public Types

typedef TSpace Space
 Copy the space type.
 
typedef Space::Point Point
 Type for points.
 
typedef Point::Coordinate Abscissa
 Type for points.
 
typedef Space::Vector Vector
 Type for vectors.
 
typedef TRawValue RawValue
 Type for internal distance values.
 
typedef double Value
 Type for distance values.
 
typedef ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue > Self
 Self type.
 

Public Member Functions

 ExactPredicateLpSeparableMetric ()
 
 ~ExactPredicateLpSeparableMetric ()
 
 ExactPredicateLpSeparableMetric (const Self &other)
 
Selfoperator= (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
 

Detailed Description

template<typename TSpace, typename TRawValue>
class DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >

Definition at line 261 of file ExactPredicateLpSeparableMetric.h.

Member Typedef Documentation

◆ Abscissa

template<typename TSpace , typename TRawValue >
typedef Point::Coordinate DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Abscissa

Type for points.

Definition at line 271 of file ExactPredicateLpSeparableMetric.h.

◆ Point

template<typename TSpace , typename TRawValue >
typedef Space::Point DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Point

Type for points.

Definition at line 269 of file ExactPredicateLpSeparableMetric.h.

◆ RawValue

template<typename TSpace , typename TRawValue >
typedef TRawValue DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::RawValue

Type for internal distance values.

Definition at line 276 of file ExactPredicateLpSeparableMetric.h.

◆ Self

template<typename TSpace , typename TRawValue >
typedef ExactPredicateLpSeparableMetric<TSpace,2,TRawValue> DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Self

Self type.

Definition at line 282 of file ExactPredicateLpSeparableMetric.h.

◆ Space

template<typename TSpace , typename TRawValue >
typedef TSpace DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Space

Copy the space type.

Definition at line 267 of file ExactPredicateLpSeparableMetric.h.

◆ Value

template<typename TSpace , typename TRawValue >
typedef double DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Value

Type for distance values.

Definition at line 279 of file ExactPredicateLpSeparableMetric.h.

◆ Vector

template<typename TSpace , typename TRawValue >
typedef Space::Vector DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Vector

Type for vectors.

Definition at line 273 of file ExactPredicateLpSeparableMetric.h.

Constructor & Destructor Documentation

◆ ExactPredicateLpSeparableMetric() [1/2]

template<typename TSpace , typename TRawValue >
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::ExactPredicateLpSeparableMetric ( )

Constructor.

◆ ~ExactPredicateLpSeparableMetric()

template<typename TSpace , typename TRawValue >
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::~ExactPredicateLpSeparableMetric ( )

Destructor.

◆ ExactPredicateLpSeparableMetric() [2/2]

template<typename TSpace , typename TRawValue >
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::ExactPredicateLpSeparableMetric ( const Self & other)
inline

Copy constructor.

Parameters
otherthe object to clone (not used).

Definition at line 300 of file ExactPredicateLpSeparableMetric.h.

301 {
302 boost::ignore_unused_variable_warning( other );
303 }

Member Function Documentation

◆ binarySearchHidden()

template<typename TSpace , typename TRawValue >
Abscissa DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::binarySearchHidden ( const Abscissa & udim,
const Abscissa & vdim,
const RawValue & nu,
const RawValue & nv,
const Abscissa & lower,
const Abscissa & upper ) const
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.

Parameters
udimcoordinate of u along dimension dim
vdimcoordinate of v along dimension dim
nupartial distance of u (sum of |xj-x_i|^p) discarding the term along the dimension dim
nvpartial distance of v (sum of |xj-x_i|^p) discarding the term along the dimension dim
lowerinterval lower bound
upperinterval upper bound
Returns
the Voronoi boundary point coordinates along dimension dim.

◆ closest()

template<typename TSpace , typename TRawValue >
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.

Parameters
originthe origin
firstthe first point
secondthe second point
Returns
a Closest enum: FIRST, SECOND or BOTH.

◆ hiddenBy()

template<typename TSpace , typename TRawValue >
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.

Precondition
both voronoi cells associated with a and b must intersect the straight line.
Parameters
ua site
va site
wa site
startingPointstarting point of the segment
endPointend point of the segment
dimdirection of the straight line
Returns
true if (a,c) hides b.

◆ isValid()

template<typename TSpace , typename TRawValue >
bool DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ local()

template<typename TSpace , typename TRawValue >
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.

Parameters
aPa point.
aDira direction.
Returns
the distance between aP and aP+aDir.

◆ operator()()

template<typename TSpace , typename TRawValue >
Value DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::operator() ( const Point & aP,
const Point & aQ ) const

Compute the distance between aP and aQ.

Parameters
aPa first point.
aQa second point.
Returns
the distance between aP and aQ.

◆ operator=()

template<typename TSpace , typename TRawValue >
Self & DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::operator= ( const Self & other)
inline

Assignment.

Parameters
otherthe object to copy (unused).
Returns
a reference on 'this'.

Definition at line 310 of file ExactPredicateLpSeparableMetric.h.

311 {
312 boost::ignore_unused_variable_warning( other );
313 return *this;
314 }

◆ rawDistance()

template<typename TSpace , typename TRawValue >
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.

Parameters
aPa first point
aQa second point
Returns
the power p of the l_p distance between aP and aQ.

◆ selfDisplay()

template<typename TSpace , typename TRawValue >
void DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

The documentation for this class was generated from the following file: