DGtal  1.2.0
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)
35 #define Simple2x2DetComputer_RECURSES
36 
37 #if !defined Simple2x2DetComputer_h
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;
109 
113  typedef TResultInteger ResultInteger;
115 
124 
125  // ----------------------- Standard services ------------------------------
126  public:
127 
132 
138 
145 
150 
151  // ----------------------- Interface --------------------------------------
152  public:
153 
160  void init(const ArgumentInteger& aA, const ArgumentInteger& aB);
161 
171 
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:
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)
Aim: Small class useful to compute the determinant of a 2x2 matrix from its four coefficients,...
Simple2x2DetComputer(const Simple2x2DetComputer &other)
ResultInteger operator()(const ArgumentInteger &aA, const ArgumentInteger &aB, const ArgumentInteger &aX, const ArgumentInteger &aY)
ResultInteger operator()(const ArgumentInteger &aX, const ArgumentInteger &aY) const
Simple2x2DetComputer & operator=(const Simple2x2DetComputer &other)
void selfDisplay(std::ostream &out) const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< ArgumentInteger >))
void init(const ArgumentInteger &aA, const ArgumentInteger &aB)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...