DGtal  0.9.2
Simple2x2DetComputer.h
1 
17 #pragma once
18 
31 #if defined(Simple2x2DetComputer_RECURSES)
32 #error Recursive header files inclusion detected in Simple2x2DetComputer.h
33 #else // defined(Simple2x2DetComputer_RECURSES)
34 
35 #define Simple2x2DetComputer_RECURSES
36 
37 #if !defined Simple2x2DetComputer_h
38 
39 #define Simple2x2DetComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/kernel/NumberTraits.h"
47 #include "DGtal/kernel/CEuclideanRing.h"
49 
50 namespace DGtal
51 {
52 
54  // template class Simple2x2DetComputer
91  template <typename TArgumentInteger, typename TResultInteger = TArgumentInteger>
93  {
94  // ----------------------- Types ------------------------------------
95  public:
99  typedef TArgumentInteger ArgumentInteger;
104  typedef ArgumentInteger Integer;
108  typedef ArgumentInteger argument_type;
109 
113  typedef TResultInteger ResultInteger;
115 
119  typedef ResultInteger Value;
123  typedef ResultInteger result_type;
124 
125  // ----------------------- Standard services ------------------------------
126  public:
127 
132 
137  Simple2x2DetComputer ( const Simple2x2DetComputer & other );
138 
145 
150 
151  // ----------------------- Interface --------------------------------------
152  public:
153 
160  void init(const ArgumentInteger& aA, const ArgumentInteger& aB);
161 
170  ResultInteger operator()(const ArgumentInteger& aX, const ArgumentInteger& aY) const;
171 
181  ResultInteger operator()(const ArgumentInteger& aA, const ArgumentInteger& aB,
182  const ArgumentInteger& aX, const ArgumentInteger& aY);
183 
188  void selfDisplay ( std::ostream & out ) const;
189 
194  bool isValid() const;
195 
196  // ------------------------- Private Datas --------------------------------
197  private:
202  ResultInteger myA;
207  ResultInteger myB;
211  mutable ResultInteger myAY;
215  mutable ResultInteger myBX;
216 
217  // ------------------------- Hidden services ------------------------------
218  protected:
219 
220 
221  // ------------------------- Internals ------------------------------------
222  private:
223 
224  }; // end of class Simple2x2DetComputer
225 
226 
233  template <typename TI, typename TO>
234  std::ostream&
235  operator<< ( std::ostream & out, const Simple2x2DetComputer<TI,TO> & object );
236 
237 } // namespace DGtal
238 
239 
241 // Includes inline functions.
242 #include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.ih"
243 
244 // //
246 
247 #endif // !defined Simple2x2DetComputer_h
248 
249 #undef Simple2x2DetComputer_RECURSES
250 #endif // else defined(Simple2x2DetComputer_RECURSES)
void selfDisplay(std::ostream &out) const
Simple2x2DetComputer & operator=(const Simple2x2DetComputer &other)
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...
Aim: Small class useful to compute the determinant of a 2x2 matrix from its four coefficients, ie. .
DGtal is the top-level namespace which contains all DGtal functions and types.
void init(const ArgumentInteger &aA, const ArgumentInteger &aB)
ResultInteger operator()(const ArgumentInteger &aX, const ArgumentInteger &aY) const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< ArgumentInteger >))