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'
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
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
- 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 |
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.
Simple2x2DetComputer, SimpleIncremental2x2DetComputer, AvnaimEtAl2x2DetSignComputer, Filtered2x2DetComputer
- Template Parameters
Definition at line 107 of file C2x2DetComputer.h.