DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ConstExpressions.h
1
16
17
#pragma once
18
30
31
#if defined(ConstExpressions_RECURSES)
32
#error Recursive header files inclusion detected in ConstExpressions.h
33
#else
// defined(ConstExpressions_RECURSES)
35
#define ConstExpressions_RECURSES
36
37
#if !defined ConstExpressions_h
39
#define ConstExpressions_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
46
47
namespace
DGtal
48
{
49
50
namespace
functions
{
59
template
<
typename
T >
60
constexpr
T
const_pow
( T b,
unsigned
int
e) {
61
return
e == 0 ? T(1) : b *
const_pow
( b, e - 1 );
62
}
63
74
template
<
typename
T >
75
constexpr
T
const_middle
( T
K
,
unsigned
int
e ) {
76
return
e <= 1
77
? T(
K
)
78
:
K
*
const_pow
( 2 *
K
+ 1, e - 1 ) +
const_middle
(
K
, e - 1 );
79
}
80
}
// namespace functions
81
82
}
// namespace DGtal
83
84
85
// //
87
88
#endif
// !defined ConstExpressions_h
89
90
#undef ConstExpressions_RECURSES
91
#endif
// else defined(ConstExpressions_RECURSES)
DGtal::functions
functions namespace gathers all DGtal functionsxs.
Definition
ConstExpressions.h:50
DGtal::functions::const_pow
constexpr T const_pow(T b, unsigned int e)
Definition
ConstExpressions.h:60
DGtal::functions::const_middle
constexpr T const_middle(T K, unsigned int e)
Definition
ConstExpressions.h:75
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
K
KSpace K
Definition
testCubicalComplex.cpp:62
src
DGtal
base
ConstExpressions.h
Generated on
for DGtal by
1.18.0