fpmas
1.6
src
fpmas
model
spatial
moore_range.h
Go to the documentation of this file.
1
#ifndef FPMAS_MOORE_RANGE_H
2
#define FPMAS_MOORE_RANGE_H
3
8
#include "
moore.h
"
9
#include "
von_neumann.h
"
10
11
namespace
fpmas
{
namespace
model {
20
template
<
typename
Gr
id
Config>
21
struct
MooreRangePerimeter
{};
22
32
template
<
typename
Gr
id
Config>
33
using
MooreRangeConfig
=
GridRangeConfig<ChebyshevDistance, MooreRangePerimeter<GridConfig>
>;
34
39
template
<
typename
CellType>
40
struct
MooreRangePerimeter
<
VonNeumannGrid
<CellType>> {
56
DiscretePoint
operator()
(
57
const
GridRange
<
VonNeumannGrid<CellType>
,
58
MooreRangeConfig
<
VonNeumannGrid<CellType>
>>& range)
const
{
59
return
{std::max(range.getSize(), 0l), std::max(range.getSize(), 0l)};
60
}
61
};
62
67
template
<
typename
CellType>
68
struct
MooreRangePerimeter
<
MooreGrid
<CellType>> {
83
DiscretePoint
operator()
(
84
const
GridRange
<
MooreGrid<CellType>
,
85
MooreRangeConfig
<
MooreGrid<CellType>
>>& range)
const
{
86
return
{0, std::max(range.getSize(), 0l)};
87
}
88
};
89
115
template
<
typename
Gr
id
Config>
116
using
MooreRange
=
GridRange<GridConfig, MooreRangeConfig<GridConfig>
>;
117
118
119
}}
120
#endif
fpmas::model::GridRange
Definition:
grid.h:623
moore.h
fpmas
Definition:
fpmas.cpp:3
fpmas::api::model::DiscretePoint
Definition:
grid.h:21
fpmas::model::GridConfig
Definition:
grid.h:507
fpmas::model::GridRangeConfig
Definition:
grid.h:548
fpmas::model::MooreRangePerimeter< MooreGrid< CellType > >::operator()
DiscretePoint operator()(const GridRange< MooreGrid< CellType >, MooreRangeConfig< MooreGrid< CellType > > > &range) const
Definition:
moore_range.h:83
fpmas::model::MooreRangePerimeter< VonNeumannGrid< CellType > >::operator()
DiscretePoint operator()(const GridRange< VonNeumannGrid< CellType >, MooreRangeConfig< VonNeumannGrid< CellType > > > &range) const
Definition:
moore_range.h:56
fpmas::model::MooreRangePerimeter
Definition:
moore_range.h:21
von_neumann.h
Generated by
1.9.3