DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CCommutativeRing.h
1
16
17
#pragma once
18
32
33
#if defined(CCommutativeRing_RECURSES)
34
#error Recursive header files inclusion detected in CCommutativeRing.h
35
#else
// defined(CCommutativeRing_RECURSES)
37
#define CCommutativeRing_RECURSES
38
39
#if !defined CCommutativeRing_h
41
#define CCommutativeRing_h
42
44
// Inclusions
45
#include <iostream>
46
#include "DGtal/base/Common.h"
47
#include "DGtal/kernel/CSignedNumber.h"
48
#include "DGtal/kernel/NumberTraits.h"
50
51
namespace
DGtal
52
{
53
namespace
concepts
54
{
56
// class CCommutativeRing
99
template
<
typename
T>
100
struct
CCommutativeRing
:
concepts::CSignedNumber
<T>
101
{
102
// ----------------------- Concept checks ------------------------------
103
public
:
104
105
BOOST_CONCEPT_USAGE
(
CCommutativeRing
)
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
}
118
// ------------------------- Internals ------------------------------------
119
private
:
120
T
a
,
b
,
c
;
121
122
};
123
}
124
}
// namespace DGtal
125
126
127
// //
129
130
#endif
// !defined CCommutativeRing_h
131
132
#undef CCommutativeRing_RECURSES
133
#endif
// else defined(CCommutativeRing_RECURSES)
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition
ConceptUtils.h:117
DGtal::concepts
Aim: Gathers several functions useful for concept checks.
Definition
CPositiveIrreducibleFraction.h:54
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::concepts::CCommutativeRing
Aim: Defines the mathematical concept equivalent to a unitary commutative ring.
Definition
CCommutativeRing.h:101
DGtal::concepts::CCommutativeRing::c
T c
Definition
CCommutativeRing.h:120
DGtal::concepts::CCommutativeRing::a
T a
Definition
CCommutativeRing.h:120
DGtal::concepts::CCommutativeRing::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CCommutativeRing)
Definition
CCommutativeRing.h:105
DGtal::concepts::CCommutativeRing::b
T b
Definition
CCommutativeRing.h:120
DGtal::concepts::CSignedNumber
Aim: Concept checking for Signed Numbers. Models of this concept should be listed in NumberTraits cla...
Definition
CSignedNumber.h:98
src
DGtal
kernel
CCommutativeRing.h
Generated on
for DGtal by
1.18.0