DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes
DGtal::CCommutativeRing< T > Struct Template Reference

#include <CCommutativeRing.h>

Inheritance diagram for DGtal::CCommutativeRing< T >:
Inheritance graph
[legend]
Collaboration diagram for DGtal::CCommutativeRing< T >:
Collaboration graph
[legend]

Public Member Functions

 BOOST_CONCEPT_USAGE (CCommutativeRing)

Private Attributes

a
b
c

Detailed Description

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

Aim: Defines the mathematical concept equivalent to a unitary commutative ring.

Description of concept 'CCommutativeRing'

Refinement of boost::Assignable<T>,

boost::EqualityComparable<T>, boost::LessThanComparable<T>

Associated types :

Notation

Definitions

Valid expressions and

Name Expression Type requirements Return type Precondition Semantics Postcondition Complexity
Construction from basic integer type X( i ) X represents the integer i
Addition x + y X addition of two numbers
Subtraction x - y X subtraction of two numbers
Multiplication x - y X subtraction of two numbers
Opposite operator - x X defines the opposite of x ( x + -x = 0)
X should have a 0 (neutral element for addition) X( 0 ) X the value 0
X should have a 1 (neutral element for multiplication) X ( 1 ) X the value 1

Invariants

Models

DGtal::int32_t, DGtal::int64_t, DGtal::int8_t, float, double, long double, DGtal::BigInteger

Notes

Template Parameters:
Tthe type that should be a model of commutative ring.

Definition at line 171 of file CCommutativeRing.h.


Member Function Documentation

template<typename T >
DGtal::CCommutativeRing< T >::BOOST_CONCEPT_USAGE ( CCommutativeRing< T >  )
inline

The 0 and 1 neutral elements should be tested.

Definition at line 177 of file CCommutativeRing.h.

References DGtal::ConceptUtils::sameType().

{
ConceptUtils::sameType( c, T( 25 ) );
ConceptUtils::sameType( c, T( -25 ) );
ConceptUtils::sameType( c, T( a+b ) );
ConceptUtils::sameType( c, T( -a ) );
ConceptUtils::sameType( c, T( a-b ) );
ConceptUtils::sameType( c, T( a*b ) );
ConceptUtils::sameType( c, T( 0 ) );
ConceptUtils::sameType( c, T( 1 ) );
}

Field Documentation

template<typename T >
T DGtal::CCommutativeRing< T >::a
private

Reimplemented in DGtal::CEuclideanRing< T >.

Definition at line 192 of file CCommutativeRing.h.

template<typename T >
T DGtal::CCommutativeRing< T >::b
private

Reimplemented in DGtal::CEuclideanRing< T >.

Definition at line 192 of file CCommutativeRing.h.

template<typename T >
T DGtal::CCommutativeRing< T >::c
private

Reimplemented in DGtal::CEuclideanRing< T >.

Definition at line 192 of file CCommutativeRing.h.


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