DGtal  1.5.beta
DGtal::C2x2DetComputer< T > Struct Template Reference

Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 matrix with integral entries. More...

#include <DGtal/geometry/tools/determinant/C2x2DetComputer.h>

Inheritance diagram for DGtal::C2x2DetComputer< T >:
[legend]

Public Types

typedef T::ArgumentInteger ArgumentType
 
typedef T::ResultInteger ResultType
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanRing< ArgumentType >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSignedNumber< ResultType >))
 
 BOOST_CONCEPT_USAGE (C2x2DetComputer)
 

Private Attributes

myX
 
ArgumentType myA
 
ArgumentType myB
 
ArgumentType myC
 
ArgumentType myD
 
ResultType myR
 

Detailed Description

template<typename T>
struct DGtal::C2x2DetComputer< T >

Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 matrix with integral entries.

Description of concept 'C2x2DetComputer'

Invariant

The returned value, which is a model of CSignedNumber, is guaranteed to be:

  • strictly positive if the determinant is strictly positive
  • striclty negative if the determinant is strictly negative
  • zero if the determinant is null

Refinement of

boost::DefaultConstructible<T>, boost::CopyConstructible<T>, boost::Assignable<T>

Associated types

  • ArgumentInteger : integral type of the four entries, at least a model of CEuclideanRing
  • ResultInteger : integral type of the result, at least a model of CSignedNumber

Notation

  • X : A type that is a model of C2x2DetComputer
  • x : object of type X
  • a, b, c, d : integral entries of type ArgumentInteger
  • r : result to type ResultInteger

Valid expressions and semantics

Name Expression Type requirements Return type Precondition Semantics Post condition Complexity
full operator() r = x(a, b, c, d) ResultInteger (sign of) ad - bc model dependent
initialization x.init(a,b) void memorizes a and b constant
partial operator() r = x(c, d) ResultInteger (sign of) ad - bc model dependent

Notes

In addition to the full operator(), this concept allows another way to compute the quantity ad - bc in two steps:

  • first, we set the first column vector, ie a and b.
  • then, we compute the quantity ad - bc from a given column vector, ie c and d with the memorized values of a and b.
    This feature is a way of accepting models that incrementally computes many determinants of matrices whose first column vector, ie a and b, is constant and whose second column vector, ie c and d, slightly varies from one computation to the next one. See for instance, SimpleIncremental2x2DetComputer.

Models

Simple2x2DetComputer, SimpleIncremental2x2DetComputer, AvnaimEtAl2x2DetSignComputer, Filtered2x2DetComputer

Template Parameters
Tthe type that should be a model of C2x2DetComputer.

Definition at line 107 of file C2x2DetComputer.h.

Member Typedef Documentation

◆ ArgumentType

template<typename T >
typedef T::ArgumentInteger DGtal::C2x2DetComputer< T >::ArgumentType

Definition at line 111 of file C2x2DetComputer.h.

◆ ResultType

template<typename T >
typedef T::ResultInteger DGtal::C2x2DetComputer< T >::ResultType

Definition at line 114 of file C2x2DetComputer.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename T >
DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanRing< ArgumentType >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename T >
DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_ASSERT ( (concepts::CSignedNumber< ResultType >)  )

◆ BOOST_CONCEPT_USAGE()

Field Documentation

◆ myA

template<typename T >
ArgumentType DGtal::C2x2DetComputer< T >::myA
private

Definition at line 126 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().

◆ myB

template<typename T >
ArgumentType DGtal::C2x2DetComputer< T >::myB
private

Definition at line 126 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().

◆ myC

template<typename T >
ArgumentType DGtal::C2x2DetComputer< T >::myC
private

Definition at line 126 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().

◆ myD

template<typename T >
ArgumentType DGtal::C2x2DetComputer< T >::myD
private

Definition at line 126 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().

◆ myR

template<typename T >
ResultType DGtal::C2x2DetComputer< T >::myR
private

Definition at line 127 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().

◆ myX

template<typename T >
T DGtal::C2x2DetComputer< T >::myX
private

Definition at line 125 of file C2x2DetComputer.h.

Referenced by DGtal::C2x2DetComputer< T >::BOOST_CONCEPT_USAGE().


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