DGtal  1.5.beta
DGtal::concepts::CCommutativeRing< T > Struct Template Reference

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

#include <DGtal/kernel/CCommutativeRing.h>

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

Public Member Functions

 BOOST_CONCEPT_USAGE (CCommutativeRing)
 
- Public Member Functions inherited from DGtal::concepts::CSignedNumber< T >
 BOOST_CONCEPT_USAGE (CSignedNumber)
 

Private Attributes

a
 
b
 
c
 

Detailed Description

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

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

Description of concept 'CCommutativeRing'

Refinement of

  • CSignedNumber<T>

Associated types

Notation

Definitions

Valid expressions and semantics

Name Expression Type requirements Return type Precondition Semantics Postcondition Complexity
Construction from basic integer type X( i ) X represents the integer i
Should have a 0 X(0) Neutral element for addition
Should have a 1 X(1) Neutral element for multiplication
Addition x + y X addition of two numbers
Substraction x - y X substraction of two numbers
Multiplication x * y X multiplication of two numbers
Addition x + y X addition of two numbers
Opposite operator - x X opposite of a number

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 100 of file CCommutativeRing.h.

Member Function Documentation

◆ BOOST_CONCEPT_USAGE()

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

The 0 and 1 neutral elements should be tested.

Definition at line 105 of file CCommutativeRing.h.

106  {
107  ConceptUtils::sameType( c, T( 25 ) );
108  ConceptUtils::sameType( c, T( -25 ) );
109  ConceptUtils::sameType( c, T( a+b ) );
110  ConceptUtils::sameType( c, T( -a ) );
111  ConceptUtils::sameType( c, T( a-b ) );
112  ConceptUtils::sameType( c, T( a*b ) );
113  ConceptUtils::sameType( c, T( 0 ) );
114  ConceptUtils::sameType( c, T( 1 ) );
115 
117  }
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117

References DGtal::concepts::ConceptUtils::sameType().

Field Documentation

◆ a

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

Definition at line 120 of file CCommutativeRing.h.

◆ b

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

Definition at line 120 of file CCommutativeRing.h.

◆ c

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

Definition at line 120 of file CCommutativeRing.h.


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