DGtal  1.3.beta
Public Types | Public Member Functions | Private Attributes
DGtal::concepts::CMetricSpace< T > Struct Template Reference

Aim: defines the concept of metric spaces. More...

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

Inheritance diagram for DGtal::concepts::CMetricSpace< T >:
[legend]

Public Types

typedef T::Point Point
 
typedef T::Space Space
 
typedef T::Value Value
 
typedef T::RawValue RawValue
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< Space >))
 
 BOOST_CONCEPT_ASSERT ((CQuantity< Value >))
 
 BOOST_CONCEPT_ASSERT ((CQuantity< RawValue >))
 
 BOOST_CONCEPT_USAGE (CMetricSpace)
 
void checkConstConstraints () const
 

Private Attributes

myX
 
Point myPoint
 
Point myPoint2
 
Point myPoint3
 
Value myValue
 
RawValue myRawValue
 
DGtal::Closest myClosest
 

Detailed Description

template<typename T>
struct DGtal::concepts::CMetricSpace< T >

Aim: defines the concept of metric spaces.

Description of concept 'CMetricSpace'

Models of metric spaces must satsify metric space conditions as described in Metric Spaces, Digital Metric Spaces and Related Concepts. For short, models must have a Point inner type and a distance Value type.

In addition, CMetricSpace models should implement a distance function (operator ()) on points satisfying the metric conditions:

Two additional methods must be implemented:

Refinement of

Associated types

Notation

Definitions

Valid expressions and semantics

Name Expression Type requirements Return type Precondition Semantics Post condition Complexity
distance computation x(aPoint,anotherPoint) aPoint and anotherPoint of type Point a value of type Value compute the distance between two points -
raw distance computation x.rawDistance(aPoint,anotherPoint) aPoint and anotherPoint of type Point a value of type RawValue compute the raw representation of the distance between two points -
closest point test closest(aOrigin, aP, aQ) aOrigin, aP,aQ of type aPoint a value of type Closest decide between aP and aQ which one is closer to the origin. This functions returns either DGtal::ClosestFIRST if aP is closer, DGtal::ClosestSECOND if aQ is closer and DGtal::ClosestBOTH if both are equidistant. -

Invariants

Models

LpMetric, ExactPredicateLpSeparableMetric, InexactPredicateLpSeparableMetric.

Notes

Template Parameters
Tthe type that should be a model of CMetricSpace.

Definition at line 124 of file CMetricSpace.h.

Member Typedef Documentation

◆ Point

template<typename T >
typedef T::Point DGtal::concepts::CMetricSpace< T >::Point

Definition at line 128 of file CMetricSpace.h.

◆ RawValue

template<typename T >
typedef T::RawValue DGtal::concepts::CMetricSpace< T >::RawValue

Definition at line 131 of file CMetricSpace.h.

◆ Space

template<typename T >
typedef T::Space DGtal::concepts::CMetricSpace< T >::Space

Definition at line 129 of file CMetricSpace.h.

◆ Value

template<typename T >
typedef T::Value DGtal::concepts::CMetricSpace< T >::Value

Definition at line 130 of file CMetricSpace.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/3]

template<typename T >
DGtal::concepts::CMetricSpace< T >::BOOST_CONCEPT_ASSERT ( (CQuantity< RawValue >)  )

◆ BOOST_CONCEPT_ASSERT() [2/3]

template<typename T >
DGtal::concepts::CMetricSpace< T >::BOOST_CONCEPT_ASSERT ( (CQuantity< Value >)  )

◆ BOOST_CONCEPT_ASSERT() [3/3]

template<typename T >
DGtal::concepts::CMetricSpace< T >::BOOST_CONCEPT_ASSERT ( (CSpace< Space >)  )

◆ BOOST_CONCEPT_USAGE()

template<typename T >
DGtal::concepts::CMetricSpace< T >::BOOST_CONCEPT_USAGE ( CMetricSpace< T >  )
inline

Definition at line 137 of file CMetricSpace.h.

138  {
140  }

References DGtal::concepts::CMetricSpace< T >::checkConstConstraints().

◆ checkConstConstraints()

template<typename T >
void DGtal::concepts::CMetricSpace< T >::checkConstConstraints ( ) const
inline

Field Documentation

◆ myClosest

template<typename T >
DGtal::Closest DGtal::concepts::CMetricSpace< T >::myClosest
private

◆ myPoint

template<typename T >
Point DGtal::concepts::CMetricSpace< T >::myPoint
private

◆ myPoint2

template<typename T >
Point DGtal::concepts::CMetricSpace< T >::myPoint2
private

◆ myPoint3

template<typename T >
Point DGtal::concepts::CMetricSpace< T >::myPoint3
private

◆ myRawValue

template<typename T >
RawValue DGtal::concepts::CMetricSpace< T >::myRawValue
private

◆ myValue

template<typename T >
Value DGtal::concepts::CMetricSpace< T >::myValue
private

◆ myX

template<typename T >
T DGtal::concepts::CMetricSpace< T >::myX
private

The documentation for this struct was generated from the following file:
DGtal::concepts::CMetricSpace::myValue
Value myValue
Definition: CMetricSpace.h:154
DGtal::concepts::CMetricSpace::myX
T myX
Definition: CMetricSpace.h:152
DGtal::concepts::CMetricSpace::checkConstConstraints
void checkConstConstraints() const
Definition: CMetricSpace.h:142
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal::concepts::CMetricSpace::myPoint3
Point myPoint3
Definition: CMetricSpace.h:153
DGtal::concepts::CMetricSpace::myClosest
DGtal::Closest myClosest
Definition: CMetricSpace.h:156
DGtal::concepts::CMetricSpace::myPoint2
Point myPoint2
Definition: CMetricSpace.h:153
DGtal::concepts::CMetricSpace::myPoint
Point myPoint
Definition: CMetricSpace.h:153
DGtal::concepts::CMetricSpace::myRawValue
RawValue myRawValue
Definition: CMetricSpace.h:155