DGtal 1.3.0
|
Aim: Class that provides a way of computing the sign of the determinant of a 2x2 matrix from its four coefficients, ie. More...
#include <DGtal/geometry/tools/determinant/AvnaimEtAl2x2DetSignComputer.h>
Public Types | |
typedef TInteger | ArgumentInteger |
typedef ArgumentInteger | Integer |
typedef ArgumentInteger | argument_type |
typedef Integer | ResultInteger |
typedef ResultInteger | Value |
typedef ResultInteger | result_type |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CEuclideanRing< ArgumentInteger >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CBoundedNumber< ArgumentInteger >)) | |
BOOST_STATIC_CONSTANT (unsigned int, base=std::numeric_limits< Integer >::radix) | |
BOOST_STATIC_CONSTANT (unsigned int, exponent=std::numeric_limits< Integer >::digits) | |
AvnaimEtAl2x2DetSignComputer () | |
void | init (const ArgumentInteger &aA, const ArgumentInteger &aB) |
ResultInteger | operator() (const ArgumentInteger &aU, const ArgumentInteger &aV) const |
ResultInteger | operator() (const ArgumentInteger &aA, const ArgumentInteger &aB, const ArgumentInteger &aX, const ArgumentInteger &aY) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
int | quadrant (const Integer &aX, const Integer &aY) const |
Integer | computation (const Integer &aA, const Integer &aB, const Integer &aX, const Integer &aY) const |
Integer | recursiveComputation (const Integer &aA, const Integer &aB, const Integer &aX, const Integer &aY) const |
Private Attributes | |
Integer | myA |
Integer | myB |
Integer | myMax |
Aim: Class that provides a way of computing the sign of the determinant of a 2x2 matrix from its four coefficients, ie.
\( \begin{vmatrix} a & x \\ b & y \end{vmatrix} \)
It returns:
If the coefficients are coded with b bits, the computation only uses numbers coded with b bits too without any overflows [Avnaim et.al., 1997 : [8]].
This class is a model of C2x2DetComputer.
TInteger | both a model of CEuclideanRing (it has the usual arithmetic operators) and a model of CBoundedNumber. It can be DGtal::int8_t, DGtal::int16_t, DGtal::int32_t, DGtal::int64_t as well as float and double. |
Definition at line 144 of file AvnaimEtAl2x2DetSignComputer.h.
typedef ArgumentInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::argument_type |
STL alias of type ArgumentInteger
Definition at line 162 of file AvnaimEtAl2x2DetSignComputer.h.
typedef TInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::ArgumentInteger |
Type of integer for the input coefficients of the 2x2 matrix
Definition at line 151 of file AvnaimEtAl2x2DetSignComputer.h.
typedef ArgumentInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::Integer |
DGtal alias of type ArgumentInteger
Definition at line 158 of file AvnaimEtAl2x2DetSignComputer.h.
typedef ResultInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::result_type |
STL alias of type ResultInteger
Definition at line 176 of file AvnaimEtAl2x2DetSignComputer.h.
typedef Integer DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::ResultInteger |
Type of integer for the returned determinant, which is an alias of type ArgumentInteger
Definition at line 168 of file AvnaimEtAl2x2DetSignComputer.h.
typedef ResultInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::Value |
DGtal alias type of ResultInteger
Definition at line 172 of file AvnaimEtAl2x2DetSignComputer.h.
DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::AvnaimEtAl2x2DetSignComputer | ( | ) |
Default constructor
DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::BOOST_CONCEPT_ASSERT | ( | (concepts::CBoundedNumber< ArgumentInteger >) | ) |
DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::BOOST_CONCEPT_ASSERT | ( | (concepts::CEuclideanRing< ArgumentInteger >) | ) |
DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::BOOST_STATIC_CONSTANT | ( | unsigned int | , |
base | = std::numeric_limits< Integer >::radix |
||
) |
Data member storing the number of the base (radix) of the representation, 2 usually
DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::BOOST_STATIC_CONSTANT | ( | unsigned int | , |
exponent | = std::numeric_limits< Integer >::digits |
||
) |
Data member storing the number of non-sign bits in the representation, eg. b-1 for signed integer coded with b bits.
|
private |
Method that computes the sign of the determinant for strictly positive coefficients.
aA | 0-component of the first column vector |
aB | 1-component of the first column vector |
aX | 0-component of the second column vector |
aY | 1-component of the second column vector |
void DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::init | ( | const ArgumentInteger & | aA, |
const ArgumentInteger & | aB | ||
) |
Initialisation.
aA | 0-component of the first column vector |
aB | 1-component of the first column vector |
bool DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
ResultInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::operator() | ( | const ArgumentInteger & | aA, |
const ArgumentInteger & | aB, | ||
const ArgumentInteger & | aX, | ||
const ArgumentInteger & | aY | ||
) |
Operator.
aA | 0-component of the first column vector |
aB | 1-component of the first column vector |
aX | 0-component of the second column vector |
aY | 1-component of the second column vector |
ResultInteger DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::operator() | ( | const ArgumentInteger & | aU, |
const ArgumentInteger & | aV | ||
) | const |
Incremental operator.
aU | 0-component of the second column vector |
aV | 1-component of the second column vector |
|
private |
Returns the quadrant where a given vector lies
aX | x-component of the vector |
aY | y-component of the vector |
|
private |
Method that computes the sign of the determinant for strictly positive coefficients
aA, aB, aX, aY such that aB < aY.
aA | 0-component of the first column vector |
aB | 1-component of the first column vector |
aX | 0-component of the second column vector |
aY | 1-component of the second column vector |
void DGtal::AvnaimEtAl2x2DetSignComputer< TInteger >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
private |
Data member used to store the 0-component of the first column vector, ie. a.
Definition at line 301 of file AvnaimEtAl2x2DetSignComputer.h.
|
private |
Data member used to store the 1-component of the first column vector, ie. b.
Definition at line 306 of file AvnaimEtAl2x2DetSignComputer.h.
|
private |
Data member storing the maximal representable integer, ie. 2 ^ b if the type of integer that is used is coded with b bits.
Definition at line 311 of file AvnaimEtAl2x2DetSignComputer.h.