DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
DGtal::Filtered2x2DetComputer< TDetComputer > Class Template Reference

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/Filtered2x2DetComputer.h>

Public Types

typedef TDetComputer::ArgumentInteger ArgumentInteger
 
typedef ArgumentInteger Integer
 
typedef ArgumentInteger argument_type
 
typedef TDetComputer::ResultInteger ResultInteger
 
typedef ResultInteger Value
 
typedef ResultInteger result_type
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((C2x2DetComputer< TDetComputer >))
 
 BOOST_STATIC_ASSERT ((std::numeric_limits< ArgumentInteger >::is_iec559))
 
void init (const ArgumentInteger &aA, const ArgumentInteger &aB)
 
ResultInteger operator() (const ArgumentInteger &aX, const ArgumentInteger &aY) 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 Attributes

ArgumentInteger myA
 
ArgumentInteger myB
 
TDetComputer myDetComputer
 

Detailed Description

template<typename TDetComputer>
class DGtal::Filtered2x2DetComputer< TDetComputer >

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} \)

The coefficients must be integers, with an absolute value less than 2^53, of type 'double'.

It returns:

If the result of \( ay - bx \) is not null, the IEC-559 / IEEE-754 standard guarantees that the result is not zero (filtering step). Otherwise, we use another method to conclude.

This class is a model of C2x2DetComputer.

Template Parameters
TDetComputerany model of C2x2DetComputer
Examples
geometry/tools/determinant/exampleInHalfPlane.cpp.

Definition at line 83 of file Filtered2x2DetComputer.h.

Member Typedef Documentation

◆ argument_type

template<typename TDetComputer >
typedef ArgumentInteger DGtal::Filtered2x2DetComputer< TDetComputer >::argument_type

STL alias of type ArgumentInteger

Definition at line 104 of file Filtered2x2DetComputer.h.

◆ ArgumentInteger

template<typename TDetComputer >
typedef TDetComputer::ArgumentInteger DGtal::Filtered2x2DetComputer< TDetComputer >::ArgumentInteger

Type of integer for the input coefficients of the 2x2 matrix

Definition at line 92 of file Filtered2x2DetComputer.h.

◆ Integer

template<typename TDetComputer >
typedef ArgumentInteger DGtal::Filtered2x2DetComputer< TDetComputer >::Integer

DGtal alias of type ArgumentInteger

Definition at line 100 of file Filtered2x2DetComputer.h.

◆ result_type

template<typename TDetComputer >
typedef ResultInteger DGtal::Filtered2x2DetComputer< TDetComputer >::result_type

STL alias of type ResultInteger

Definition at line 117 of file Filtered2x2DetComputer.h.

◆ ResultInteger

template<typename TDetComputer >
typedef TDetComputer::ResultInteger DGtal::Filtered2x2DetComputer< TDetComputer >::ResultInteger

Type of integer for the returned determinant

Definition at line 109 of file Filtered2x2DetComputer.h.

◆ Value

template<typename TDetComputer >
typedef ResultInteger DGtal::Filtered2x2DetComputer< TDetComputer >::Value

DGtal alias type of ResultInteger

Definition at line 113 of file Filtered2x2DetComputer.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TDetComputer >
DGtal::Filtered2x2DetComputer< TDetComputer >::BOOST_CONCEPT_ASSERT ( (C2x2DetComputer< TDetComputer >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TDetComputer >
DGtal::Filtered2x2DetComputer< TDetComputer >::BOOST_STATIC_ASSERT ( (std::numeric_limits< ArgumentInteger >::is_iec559)  )

◆ init()

template<typename TDetComputer >
void DGtal::Filtered2x2DetComputer< TDetComputer >::init ( const ArgumentInteger aA,
const ArgumentInteger aB 
)

Initialisation.

Parameters
aA0-component of the first column vector
aB1-component of the first column vector
See also
operator()

◆ isValid()

template<typename TDetComputer >
bool DGtal::Filtered2x2DetComputer< TDetComputer >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator()() [1/2]

template<typename TDetComputer >
ResultInteger DGtal::Filtered2x2DetComputer< TDetComputer >::operator() ( const ArgumentInteger aA,
const ArgumentInteger aB,
const ArgumentInteger aX,
const ArgumentInteger aY 
)

Operator.

Parameters
aA0-component of the first column vector
aB1-component of the first column vector
aX0-component of the second column vector
aY1-component of the second column vector
Returns
determinant of the 2x2 matrix that consists of the two above column vectors, ie. aA . aY - aB . aX

◆ operator()() [2/2]

template<typename TDetComputer >
ResultInteger DGtal::Filtered2x2DetComputer< TDetComputer >::operator() ( const ArgumentInteger aX,
const ArgumentInteger aY 
) const

Incremental operator.

Precondition
init must be called before
Parameters
aX0-component of the second column vector
aY1-component of the second column vector
Returns
the 2x2 matrix determinant, ie. myAX . aY - myBY . aX

◆ selfDisplay()

template<typename TDetComputer >
void DGtal::Filtered2x2DetComputer< TDetComputer >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myA

template<typename TDetComputer >
ArgumentInteger DGtal::Filtered2x2DetComputer< TDetComputer >::myA
private

Data member used to store the 0-component of the first column vector, ie. a.

Definition at line 176 of file Filtered2x2DetComputer.h.

◆ myB

template<typename TDetComputer >
ArgumentInteger DGtal::Filtered2x2DetComputer< TDetComputer >::myB
private

Data member used to store the 1-component of the first column vector, ie. b.

Definition at line 181 of file Filtered2x2DetComputer.h.

◆ myDetComputer

template<typename TDetComputer >
TDetComputer DGtal::Filtered2x2DetComputer< TDetComputer >::myDetComputer
mutableprivate

Object that can return (the sign of) the determinant, after the filtering.

Definition at line 186 of file Filtered2x2DetComputer.h.


The documentation for this class was generated from the following file: