DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CCommutativeRing.h
1 
17 #pragma once
18 
33 #if defined(CCommutativeRing_RECURSES)
34 #error Recursive header files inclusion detected in CCommutativeRing.h
35 #else // defined(CCommutativeRing_RECURSES)
36 
37 #define CCommutativeRing_RECURSES
38 
39 #if !defined CCommutativeRing_h
40 
41 #define CCommutativeRing_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/kernel/CSignedInteger.h"
48 #include "DGtal/kernel/NumberTraits.h"
49 
51 
52 namespace DGtal
53 {
54 
56  // class CCommutativeRing
170  template <typename T>
171  struct CCommutativeRing : boost::Assignable<T>,
172  boost::EqualityComparable<T>, boost::LessThanComparable<T>
173  {
174  // ----------------------- Concept checks ------------------------------
175  public:
176 
178  {
179  ConceptUtils::sameType( c, T( 25 ) );
180  ConceptUtils::sameType( c, T( -25 ) );
181  ConceptUtils::sameType( c, T( a+b ) );
182  ConceptUtils::sameType( c, T( -a ) );
183  ConceptUtils::sameType( c, T( a-b ) );
184  ConceptUtils::sameType( c, T( a*b ) );
185  ConceptUtils::sameType( c, T( 0 ) );
186  ConceptUtils::sameType( c, T( 1 ) );
187 
189  }
190  // ------------------------- Internals ------------------------------------
191  private:
192  T a,b,c;
193 
194  };
195 } // namespace DGtal
196 
197 
198 // //
200 
201 #endif // !defined CCommutativeRing_h
202 
203 #undef CCommutativeRing_RECURSES
204 #endif // else defined(CCommutativeRing_RECURSES)