DGtal  0.9.2
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.
126  Value myValue;
127  Weight myW1,myW2, myW3;
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)
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
void checkConstConstraints() const
Definition: CPowerMetric.h:117
void sameType(const T &t1, const T &t2)
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines...
Definition: CSpace.h:105
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
Aim: defines the concept of quantity in DGtal.
Definition: CQuantity.h:92
BOOST_CONCEPT_ASSERT((CSpace< Space >))
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: defines the concept of special weighted metrics, so called power metrics.
Definition: CPowerMetric.h:98
Closest
Definition: Common.h:123