DGtal  1.3.beta
ModuloComputer.h
1 
17 #pragma once
18 
31 #if defined(ModuloComputer_RECURSES)
32 #error Recursive header files inclusion detected in ModuloComputer.h
33 #else // defined(ModuloComputer_RECURSES)
34 
35 #define ModuloComputer_RECURSES
36 
37 #if !defined ModuloComputer_h
38 
39 #define ModuloComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/NumberTraits.h"
46 #include "DGtal/kernel/CInteger.h"
48 
49 namespace DGtal
50 {
51 
53  // template class ModuloComputer
78  template <typename TInteger>
80  {
81  public:
82  typedef TInteger Integer;
84 
87 
89 
95 
100  void increment( UnsignedInteger & i ) const;
101 
106  void decrement( UnsignedInteger & i ) const;
107 
113 
119 
126 
136 
145 
146  public:
151  void selfDisplay ( std::ostream & out ) const;
152 
157  bool isValid() const;
158 
159  // ------------------------- Private Datas --------------------------------
160  private:
165 
166  // ------------------------- Hidden services ------------------------------
167  protected:
168 
173  ModuloComputer();
174 
175  private:
176 
182  ModuloComputer ( const ModuloComputer & other );
183 
190  ModuloComputer & operator= ( const ModuloComputer & other );
191 
192  // ------------------------- Internals ------------------------------------
193  private:
194 
195  }; // end of class ModuloComputer
196 
204  template <typename T>
205  std::ostream&
206  operator<< ( std::ostream & out,
207  const ModuloComputer<T> & object )
208  {
209  object.selfDisplay( out );
210  return out;
211  }
212 
213 } // namespace DGtal
214 
215 
217 // Includes inline functions.
218 #include "DGtal/arithmetic/ModuloComputer.ih"
219 
220 // //
222 
223 #endif // !defined ModuloComputer_h
224 
225 #undef ModuloComputer_RECURSES
226 #endif // else defined(ModuloComputer_RECURSES)
DGtal::ModuloComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
DGtal::ModuloComputer::IntegerParamType
NumberTraits< Integer >::ParamType IntegerParamType
Definition: ModuloComputer.h:83
DGtal::KhalimskySpaceND::uCell
Cell uCell(const PreCell &c) const
From an unsigned cell, returns an unsigned cell lying into this Khalismky space.
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
DGtal::FMM::initFromBelsRange
static void initFromBelsRange(const KSpace &aK, const TIteratorOnBels &itb, const TIteratorOnBels &ite, Image &aImg, AcceptedPointSet &aSet, const Value &aValue, bool aFlagIsPositive=true)
insert
void insert(VContainer1 &c1, LContainer2 &c2, unsigned int idx, double v)
Definition: testIndexedListWithBlocks.cpp:52
DGtal::NumberTraits
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:562
DGtal::KhalimskySpaceND::init
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
DGtal::KhalimskySpaceND::sCell
SCell sCell(const SPreCell &c) const
From a signed cell, returns a signed cell lying into this Khalismky space.
DGtal::ModuloComputer::UnsignedIntegerParamType
NumberTraits< UnsignedInteger >::ParamType UnsignedIntegerParamType
Definition: ModuloComputer.h:86
DGtal::ModuloComputer::k
UnsignedInteger k
Definition: ModuloComputer.h:164
K
KSpace K
Definition: testCubicalComplex.cpp:62
SCell
Z3i::SCell SCell
Definition: fullConvexityShortestPaths3D.cpp:83
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:208
DGtal::ModuloComputer::isValid
bool isValid() const
DGtal::ModuloComputer::posDiff
UnsignedInteger posDiff(UnsignedIntegerParamType j, UnsignedIntegerParamType i) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::KhalimskyPreSpaceND
Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell compl...
Definition: KhalimskyPreSpaceND.h:61
DGtal::FMM::initFromPointsRange
static void initFromPointsRange(const TIteratorOnPoints &itb, const TIteratorOnPoints &ite, Image &aImg, AcceptedPointSet &aSet, const Value &aValue)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::ModuloComputer::operator=
ModuloComputer & operator=(const ModuloComputer &other)
DGtal::ModuloComputer::Integer
TInteger Integer
Definition: ModuloComputer.h:82
DGtal::FMM::initFromIncidentPointsRange
static void initFromIncidentPointsRange(const TIteratorOnPairs &itb, const TIteratorOnPairs &ite, Image &aImg, AcceptedPointSet &aSet, const Value &aValue, bool aFlagIsPositive=true)
DGtal::ModuloComputer::cast
UnsignedInteger cast(IntegerParamType i) const
DGtal::ModuloComputer::less
bool less(UnsignedIntegerParamType i, UnsignedIntegerParamType j) const
DGtal::ModuloComputer::decrement
void decrement(UnsignedInteger &i) const
DGtal::ModuloComputer::next
UnsignedInteger next(UnsignedIntegerParamType i) const
DGtal::ModuloComputer::increment
void increment(UnsignedInteger &i) const
DGtal::ModuloComputer::ModuloComputer
ModuloComputer()
DGtal::Z2i::KPreSpace
KhalimskyPreSpaceND< 2, Integer > KPreSpace
Definition: StdDefs.h:83
DGtal::ModuloComputer::selfDisplay
void selfDisplay(std::ostream &out) const
Cell
KSpace::Cell Cell
Definition: testCubicalComplex.cpp:56
DGtal::ModuloComputer
implements basic functions on modular arithmetic.
Definition: ModuloComputer.h:79
DGtal::NumberTraitsImpl< std::decay< T >::type >::ParamType
boost::call_traits< std::decay< T >::type >::param_type ParamType
Defines a type that represents the "best" way to pass a parameter of type T to a function.
Definition: NumberTraits.h:96
DGtal::ModuloComputer::UnsignedInteger
NumberTraits< TInteger >::UnsignedVersion UnsignedInteger
Definition: ModuloComputer.h:85
DGtal::ModuloComputer::previous
UnsignedInteger previous(UnsignedIntegerParamType i) const
DGtal::KhalimskyCell< dim, Integer >
DGtal::KhalimskySpaceND
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
Definition: KhalimskySpaceND.h:64