DGtal  1.3.beta
CVectorSpace.h
1 
17 #pragma once
18 
31 #if defined(CVectorSpace_RECURSES)
32 #error Recursive header files inclusion detected in CVectorSpace.h
33 #else // defined(CVectorSpace_RECURSES)
34 
35 #define CVectorSpace_RECURSES
36 
37 #if !defined CVectorSpace_h
38 
39 #define CVectorSpace_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/CEuclideanRing.h"
47 
48 namespace DGtal
49 {
50  namespace concepts
51  {
53  // class CVectorSpace
92  template <typename T>
94  {
95  // ----------------------- Concept checks ------------------------------
96  public:
97  typedef typename T::Scalar Scalar;
98 
100 
102  {
103  z.clear();
104  z = x + y;
105  z = x - y;
106  z = a * x;
107  }
108  // ------------------------- Private Datas --------------------------------
109  private:
110  const T x,y;
111  T z;
113 
114  // ------------------------- Internals ------------------------------------
115  private:
116 
117  }; // end of concept CVectorSpace
118  }
119 } // namespace DGtal
120 
121 // //
123 
124 #endif // !defined CVectorSpace_h
125 
126 #undef CVectorSpace_RECURSES
127 #endif // else defined(CVectorSpace_RECURSES)
DGtal::concepts::CVectorSpace::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CVectorSpace)
Definition: CVectorSpace.h:101
DGtal::concepts::CVectorSpace::Scalar
T::Scalar Scalar
Definition: CVectorSpace.h:97
DGtal::concepts::CVectorSpace::z
T z
Definition: CVectorSpace.h:111
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::concepts::CEuclideanRing
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...
Definition: CEuclideanRing.h:87
DGtal::concepts::CVectorSpace::a
Scalar a
Definition: CVectorSpace.h:112
DGtal::concepts::CVectorSpace::x
const T x
Definition: CVectorSpace.h:110
DGtal::concepts::CVectorSpace::y
const T y
Definition: CVectorSpace.h:110
DGtal::concepts::CVectorSpace::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< Scalar >))
boost::Assignable
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
DGtal::concepts::CVectorSpace
Aim: Base concept for vector space structure.
Definition: CVectorSpace.h:93