DGtal  1.3.beta
Filtered2x2DetComputer.h
1 
17 #pragma once
18 
31 #if defined(Filtered2x2DetComputer_RECURSES)
32 #error Recursive header files inclusion detected in Filtered2x2DetComputer.h
33 #else // defined(Filtered2x2DetComputer_RECURSES)
34 
35 #define Filtered2x2DetComputer_RECURSES
36 
37 #if !defined Filtered2x2DetComputer_h
38 
39 #define Filtered2x2DetComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/geometry/tools/determinant/C2x2DetComputer.h"
48 
49 namespace DGtal
50 {
51 
53  // template class Filtered2x2DetComputer
82  template <typename TDetComputer>
84  {
85  // ----------------------- Types ------------------------------------
86  public:
88 
92  typedef typename TDetComputer::ArgumentInteger ArgumentInteger;
93  //NB. TDetComputer should take input coefficients of type float, double or long double
94  //this type must adhere to IEC-559 / IEEE-754 standard.
95  BOOST_STATIC_ASSERT(( std::numeric_limits<ArgumentInteger>::is_iec559 ));
96 
105 
109  typedef typename TDetComputer::ResultInteger ResultInteger;
118 
119  // ----------------------- Standard services ------------------------------
120  public:
121 
128  void init(const ArgumentInteger& aA, const ArgumentInteger& aB);
129 
138  ResultInteger operator()(const ArgumentInteger& aX, const ArgumentInteger& aY) const;
139 
150  const ArgumentInteger& aX, const ArgumentInteger& aY);
151 
152  // ----------------------- Interface --------------------------------------
153  public:
154 
159  void selfDisplay ( std::ostream & out ) const;
160 
165  bool isValid() const;
166 
167  // ------------------------- Protected Datas ------------------------------
168  private:
169  // ------------------------- Private Datas --------------------------------
170  private:
171 
186  mutable TDetComputer myDetComputer;
187 
188  // ------------------------- Internals ------------------------------------
189  private:
190 
191  }; // end of class Filtered2x2DetComputer
192 
193 
200  template <typename T>
201  std::ostream&
202  operator<< ( std::ostream & out, const Filtered2x2DetComputer<T> & object );
203 
204 } // namespace DGtal
205 
206 
208 // Includes inline functions.
209 #include "DGtal/geometry/tools/determinant/Filtered2x2DetComputer.ih"
210 
211 // //
213 
214 #endif // !defined Filtered2x2DetComputer_h
215 
216 #undef Filtered2x2DetComputer_RECURSES
217 #endif // else defined(Filtered2x2DetComputer_RECURSES)
DGtal::Filtered2x2DetComputer::ArgumentInteger
TDetComputer::ArgumentInteger ArgumentInteger
Definition: Filtered2x2DetComputer.h:92
DGtal::Filtered2x2DetComputer::Value
ResultInteger Value
Definition: Filtered2x2DetComputer.h:113
DGtal::Filtered2x2DetComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((C2x2DetComputer< TDetComputer >))
DGtal::Filtered2x2DetComputer::argument_type
ArgumentInteger argument_type
Definition: Filtered2x2DetComputer.h:104
DGtal::Filtered2x2DetComputer
Aim: Class that provides a way of computing the sign of the determinant of a 2x2 matrix from its four...
Definition: Filtered2x2DetComputer.h:83
DGtal::Filtered2x2DetComputer::init
void init(const ArgumentInteger &aA, const ArgumentInteger &aB)
DGtal::Filtered2x2DetComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((std::numeric_limits< ArgumentInteger >::is_iec559))
DGtal::Filtered2x2DetComputer::Integer
ArgumentInteger Integer
Definition: Filtered2x2DetComputer.h:100
DGtal::Filtered2x2DetComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::Filtered2x2DetComputer::myA
ArgumentInteger myA
Definition: Filtered2x2DetComputer.h:176
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::Filtered2x2DetComputer::myB
ArgumentInteger myB
Definition: Filtered2x2DetComputer.h:181
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::Filtered2x2DetComputer::ResultInteger
TDetComputer::ResultInteger ResultInteger
Definition: Filtered2x2DetComputer.h:109
DGtal::Filtered2x2DetComputer::result_type
ResultInteger result_type
Definition: Filtered2x2DetComputer.h:117
DGtal::C2x2DetComputer
Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 ...
Definition: C2x2DetComputer.h:107
DGtal::Filtered2x2DetComputer::operator()
ResultInteger operator()(const ArgumentInteger &aX, const ArgumentInteger &aY) const
DGtal::Filtered2x2DetComputer::isValid
bool isValid() const
DGtal::Filtered2x2DetComputer::myDetComputer
TDetComputer myDetComputer
Definition: Filtered2x2DetComputer.h:186