DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CPowerMetric.h
1
16
17
#pragma once
18
30
31
#if defined(CPowerMetric_RECURSES)
32
#error Recursive header files inclusion detected in CPowerMetric.h
33
#else
// defined(CPowerMetric_RECURSES)
35
#define CPowerMetric_RECURSES
36
37
#if !defined CPowerMetric_h
39
#define CPowerMetric_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/kernel/CSpace.h"
46
#include "DGtal/base/CQuantity.h"
48
49
namespace
DGtal
50
{
51
namespace
concepts
52
{
53
55
// class CPowerMetric
97
template
<
typename
T>
98
struct
CPowerMetric
:
boost::CopyConstructible
<T>,
boost::Assignable
<T>
99
{
100
// ----------------------- Concept checks ------------------------------
101
public
:
102
typedef
typename
T::Space
Space
;
103
typedef
typename
T::Weight
Weight
;
104
typedef
typename
T::Value
Value
;
105
typedef
typename
T::Point
Point
;
106
107
BOOST_CONCEPT_ASSERT
((
CSpace< Space >
));
108
BOOST_CONCEPT_ASSERT
((
CQuantity< Value >
));
109
BOOST_CONCEPT_ASSERT
((
CQuantity< Weight >
));
110
111
112
BOOST_CONCEPT_USAGE
(
CPowerMetric
)
113
{
114
checkConstConstraints
();
115
}
116
117
void
checkConstConstraints
()
const
118
{
119
ConceptUtils::sameType
(
myW3
,
myX
.powerDistance(
myPoint
,
myPoint2
,
myW1
) );
120
ConceptUtils::sameType
(
aclosest
,
myX
.closestPower(
myPoint
,
myPoint2
,
myW2
,
myPoint3
,
myW3
) );
121
}
122
// ------------------------- Private Data --------------------------------
123
private
:
124
T
myX
;
// do not require T to be default constructible.
125
Point
myPoint
,
myPoint2
,
myPoint3
;
126
Value
myValue
;
127
Weight
myW1
,
myW2
,
myW3
;
128
DGtal::Closest
aclosest
;
129
// ------------------------- Internals ------------------------------------
130
private
:
131
132
};
// end of concept CPowerMetric
133
}
134
}
// namespace DGtal
135
136
// //
138
139
#endif
// !defined CPowerMetric_h
140
141
#undef CPowerMetric_RECURSES
142
#endif
// else defined(CPowerMetric_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::Closest
Closest
Definition
Common.h:129
DGtal::concepts::CPowerMetric
Aim: defines the concept of special weighted metrics, so called power metrics.
Definition
CPowerMetric.h:99
DGtal::concepts::CPowerMetric::myW2
Weight myW2
Definition
CPowerMetric.h:127
DGtal::concepts::CPowerMetric::myPoint
Point myPoint
Definition
CPowerMetric.h:125
DGtal::concepts::CPowerMetric::Space
T::Space Space
Definition
CPowerMetric.h:102
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CSpace< Space >))
DGtal::concepts::CPowerMetric::Point
T::Point Point
Definition
CPowerMetric.h:105
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CPowerMetric)
Definition
CPowerMetric.h:112
DGtal::concepts::CPowerMetric::myW3
Weight myW3
Definition
CPowerMetric.h:127
DGtal::concepts::CPowerMetric::Value
T::Value Value
Definition
CPowerMetric.h:104
DGtal::concepts::CPowerMetric::aclosest
DGtal::Closest aclosest
Definition
CPowerMetric.h:128
DGtal::concepts::CPowerMetric::myPoint3
Point myPoint3
Definition
CPowerMetric.h:125
DGtal::concepts::CPowerMetric::checkConstConstraints
void checkConstConstraints() const
Definition
CPowerMetric.h:117
DGtal::concepts::CPowerMetric::Weight
T::Weight Weight
Definition
CPowerMetric.h:103
DGtal::concepts::CPowerMetric::myPoint2
Point myPoint2
Definition
CPowerMetric.h:125
DGtal::concepts::CPowerMetric::myValue
Value myValue
Definition
CPowerMetric.h:126
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CQuantity< Weight >))
DGtal::concepts::CPowerMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CQuantity< Value >))
DGtal::concepts::CPowerMetric::myX
T myX
Definition
CPowerMetric.h:124
DGtal::concepts::CPowerMetric::myW1
Weight myW1
Definition
CPowerMetric.h:127
DGtal::concepts::CQuantity
Aim: defines the concept of quantity in DGtal.
Definition
CQuantity.h:93
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition
CSpace.h:106
boost::Assignable
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition
Boost.dox:32
boost::CopyConstructible
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition
Boost.dox:34
src
DGtal
geometry
volumes
distance
CPowerMetric.h
Generated on
for DGtal by
1.18.0