DGtal  1.3.beta
CPowerMetric.h
1 
17 #pragma once
18 
31 #if defined(CPowerMetric_RECURSES)
32 #error Recursive header files inclusion detected in CPowerMetric.h
33 #else // defined(CPowerMetric_RECURSES)
34 
35 #define CPowerMetric_RECURSES
36 
37 #if !defined CPowerMetric_h
38 
39 #define CPowerMetric_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/CSpace.h"
46 #include "DGtal/base/CQuantity.h"
48 
49 namespace DGtal
50 {
51 namespace concepts
52 {
53 
55 // class CPowerMetric
97 template <typename T>
99 {
100  // ----------------------- Concept checks ------------------------------
101 public:
102  typedef typename T::Space Space;
103  typedef typename T::Weight Weight;
104  typedef typename T::Value Value;
105  typedef typename T::Point Point;
106 
110 
111 
113  {
115  }
116 
118  {
119  ConceptUtils::sameType( myW3, myX.powerDistance( myPoint, myPoint2, myW1 ) );
121  }
122  // ------------------------- Private Datas --------------------------------
123 private:
124  T myX; // do not require T to be default constructible.
129  // ------------------------- Internals ------------------------------------
130 private:
131 
132 }; // end of concept CPowerMetric
133 }
134 } // namespace DGtal
135 
136 // //
138 
139 #endif // !defined CPowerMetric_h
140 
141 #undef CPowerMetric_RECURSES
142 #endif // else defined(CPowerMetric_RECURSES)
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:105
DGtal::concepts::CPowerMetric::aclosest
DGtal::Closest aclosest
Definition: CPowerMetric.h:128
DGtal::concepts::CPowerMetric::myPoint2
Point myPoint2
Definition: CPowerMetric.h:125
DGtal::concepts::CPowerMetric::myValue
Value myValue
Definition: CPowerMetric.h:126
DGtal::concepts::CPowerMetric::myPoint3
Point myPoint3
Definition: CPowerMetric.h:125
DGtal::concepts::CPowerMetric::myW1
Weight myW1
Definition: CPowerMetric.h:127
DGtal::concepts::CPowerMetric::Space
T::Space Space
Definition: CPowerMetric.h:102
DGtal::Closest
Closest
Definition: Common.h:147
DGtal::concepts::CPowerMetric
Aim: defines the concept of special weighted metrics, so called power metrics.
Definition: CPowerMetric.h:98
DGtal::concepts::CPowerMetric::myW2
Weight myW2
Definition: CPowerMetric.h:127
DGtal::concepts::CPowerMetric::checkConstConstraints
void checkConstConstraints() const
Definition: CPowerMetric.h:117
DGtal::concepts::CPowerMetric::myW3
Weight myW3
Definition: CPowerMetric.h:127
DGtal::concepts::CPowerMetric::Point
T::Point Point
Definition: CPowerMetric.h:105
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::CopyConstructible
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal::concepts::CQuantity
Aim: defines the concept of quantity in DGtal.
Definition: CQuantity.h:92
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CSpace< Space >))
DGtal::concepts::CPowerMetric::myPoint
Point myPoint
Definition: CPowerMetric.h:125
DGtal::concepts::CPowerMetric::myX
T myX
Definition: CPowerMetric.h:124
Space
SpaceND< 2 > Space
Definition: testSimpleRandomAccessRangeFromPoint.cpp:42
DGtal::concepts::CPowerMetric::Value
T::Value Value
Definition: CPowerMetric.h:104
boost::Assignable
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CPowerMetric)
Definition: CPowerMetric.h:112
DGtal::concepts::CPowerMetric::Weight
T::Weight Weight
Definition: CPowerMetric.h:103
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38