DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted > Class Template Reference

#include <DGtal/geometry/volumes/distance/ExactPredicateLpPowerSeparableMetric.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 TPromoted Promoted
 Type for internal distance values. More...
 
typedef TPromoted Weight
 Type for internal distance values. More...
 
typedef TPromoted Value
 Type for Value (alias) More...
 

Public Member Functions

 ExactPredicateLpPowerSeparableMetric ()
 
 ~ExactPredicateLpPowerSeparableMetric ()
 
 ExactPredicateLpPowerSeparableMetric (const ExactPredicateLpPowerSeparableMetric &)
 
ExactPredicateLpPowerSeparableMetricoperator= (const ExactPredicateLpPowerSeparableMetric &)
 
Weight powerDistance (const Point &aPoint, const Point &aQ, const Weight &aWq) const
 
DGtal::Closest closestPower (const Point &origin, const Point &first, const Weight &wF, const Point &second, const Weight &wS) const
 
Promoted exactDistanceRepresentation (const Point &aP, const Point &aQ) const
 
bool hiddenByPower (const Point &u, const Weight &wu, const Point &v, const Weight &wv, const Point &w, const Weight &ww, 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 Promoted &nu, const Promoted &nv, const Abscissa &lower, const Abscissa &upper) const
 

Detailed Description

template<typename TSpace, typename TPromoted>
class DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >

Definition at line 280 of file ExactPredicateLpPowerSeparableMetric.h.

Member Typedef Documentation

◆ Abscissa

template<typename TSpace , typename TPromoted >
typedef Point::Coordinate DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Abscissa

Type for points.

Definition at line 290 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Point

template<typename TSpace , typename TPromoted >
typedef Space::Point DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Point

Type for points.

Definition at line 288 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Promoted

template<typename TSpace , typename TPromoted >
typedef TPromoted DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Promoted

Type for internal distance values.

Definition at line 295 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Space

template<typename TSpace , typename TPromoted >
typedef TSpace DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Space

Copy the space type.

Definition at line 286 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Value

template<typename TSpace , typename TPromoted >
typedef TPromoted DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Value

Type for Value (alias)

Definition at line 301 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Vector

template<typename TSpace , typename TPromoted >
typedef Space::Vector DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Vector

Type for vectors.

Definition at line 292 of file ExactPredicateLpPowerSeparableMetric.h.

◆ Weight

template<typename TSpace , typename TPromoted >
typedef TPromoted DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Weight

Type for internal distance values.

Definition at line 298 of file ExactPredicateLpPowerSeparableMetric.h.

Constructor & Destructor Documentation

◆ ExactPredicateLpPowerSeparableMetric() [1/2]

template<typename TSpace , typename TPromoted >
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::ExactPredicateLpPowerSeparableMetric ( )

Constructor.

◆ ~ExactPredicateLpPowerSeparableMetric()

template<typename TSpace , typename TPromoted >
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::~ExactPredicateLpPowerSeparableMetric ( )

Destructor.

◆ ExactPredicateLpPowerSeparableMetric() [2/2]

template<typename TSpace , typename TPromoted >
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::ExactPredicateLpPowerSeparableMetric ( const ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted > &  )
inline

Copy constructor.

Definition at line 317 of file ExactPredicateLpPowerSeparableMetric.h.

317{}

Member Function Documentation

◆ binarySearchHidden()

template<typename TSpace , typename TPromoted >
Abscissa DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::binarySearchHidden ( const Abscissa udim,
const Abscissa vdim,
const Promoted nu,
const Promoted 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.

◆ closestPower()

template<typename TSpace , typename TPromoted >
DGtal::Closest DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::closestPower ( const Point origin,
const Point first,
const Weight wF,
const Point second,
const Weight wS 
) const

Given an origin and two weighted 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
wFthe first point weight
secondthe second point
wSthe second point weight $
Returns
a Closest enum: FIRST, SECOND or BOTH.

◆ exactDistanceRepresentation()

template<typename TSpace , typename TPromoted >
Promoted DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::exactDistanceRepresentation ( 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.

◆ hiddenByPower()

template<typename TSpace , typename TPromoted >
bool DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::hiddenByPower ( const Point u,
const Weight wu,
const Point v,
const Weight wv,
const Point w,
const Weight ww,
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
wua weight
va site
wva weight
wa site
wwa weight
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 TPromoted >
bool DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ operator=()

template<typename TSpace , typename TPromoted >
ExactPredicateLpPowerSeparableMetric & DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::operator= ( const ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted > &  )
inline

Assignment.

Returns
a reference on 'this'.

Definition at line 323 of file ExactPredicateLpPowerSeparableMetric.h.

324 { return *this;}

◆ powerDistance()

template<typename TSpace , typename TPromoted >
Weight DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::powerDistance ( const Point aPoint,
const Point aQ,
const Weight aWq 
) const

Return the power distance of a point aPoint and a weighted point (aQ,aWq)

Parameters
aPointaPoint
aQanother point
aWqwieght of øa aQ
Returns
the power distance

◆ selfDisplay()

template<typename TSpace , typename TPromoted >
void DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::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: