OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ippl
src
Utility
RNGAssignDefs.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
/***************************************************************************
3
*
4
* The IPPL Framework
5
*
6
*
7
* Visit http://people.web.psi.ch/adelmann/ for more details
8
*
9
***************************************************************************/
10
11
#ifndef RNG_ASSIGN_DEFS_H
12
#define RNG_ASSIGN_DEFS_H
13
14
// include files
15
#include "
PETE/IpplExpressions.h
"
16
#include "
Field/AssignTags.h
"
17
18
19
// interactions for basic tags
20
22
//
23
// Evaluation functor.
24
//
26
27
template
<
class
GT>
28
inline
typename
SequenceGen<GT>::Return_t
29
for_each
(
const
SequenceGen<GT>
& p,
EvalFunctor_0
)
30
{
31
return
p();
32
}
33
35
//
36
// Count the elements in an expression.
37
//
39
40
template
<
class
GT,
class
C>
41
inline
int
42
for_each
(
const
SequenceGen<GT>
&,
PETE_CountElems
, C)
43
{
44
// just return a code value
45
return
-1;
46
}
47
49
//
50
// Increment the pointers in an expression.
51
//
53
54
template
<
class
GT,
class
C>
55
inline
int
56
for_each
(
const
SequenceGen<GT>
&,
PETE_Increment
, C)
57
{
58
// just return (increment happens automatically after evaluation!)
59
return
0;
60
}
61
62
63
// Field-specific tag interactions
64
65
67
//
68
// Go to beginning of LField
69
//
71
72
template
<
class
GT,
class
C>
73
inline
int
74
for_each
(
const
SequenceGen<GT>
&,
BeginLField
, C)
75
{
76
// just return
77
return
0;
78
}
79
81
//
82
// Go on to the next LField
83
//
85
86
template
<
class
GT,
class
C>
87
inline
int
88
for_each
(
const
SequenceGen<GT>
&,
NextLField
, C)
89
{
90
// just return
91
return
0;
92
}
93
94
//
95
// If there is an RNG in the expr, it can't have the same ID.
96
//
97
template
<
class
GT,
class
C>
98
inline
bool
99
for_each
(
const
SequenceGen<GT>
&,
SameFieldID
, C)
100
{
101
return
false
;
102
}
103
104
//
105
// for plugbase, just return true for RNG
106
//
107
template
<
unsigned
D>
struct
PlugBase
;
108
109
template
<
class
GT,
class
C,
unsigned
D>
110
inline
bool
111
for_each
(
const
SequenceGen<GT>
&,
const
PlugBase<D>
&, C)
112
{
113
return
true
;
114
}
115
116
//
117
// RNG objects are not compressed!
118
//
119
template
<
class
GT,
class
C>
120
inline
bool
121
for_each
(
const
SequenceGen<GT>
&,
IsCompressed
, C)
122
{
123
return
false
;
124
}
125
127
//
128
// Evaluation functors with arguments
129
//
131
132
template
<
class
GT>
133
inline
typename
SequenceGen<GT>::Return_t
134
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_1
&)
135
{
136
return
p();
137
}
138
139
template
<
class
GT>
140
inline
typename
SequenceGen<GT>::Return_t
141
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_2
&)
142
{
143
return
p();
144
}
145
146
template
<
class
GT>
147
inline
typename
SequenceGen<GT>::Return_t
148
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_3
&)
149
{
150
return
p();
151
}
152
153
//
154
// Does it have unit stride?
155
// Not really a sensible question, but it is safe to say it does.
156
//
157
158
template
<
class
GT,
class
C>
159
inline
bool
160
for_each
(
const
SequenceGen<GT>
& p,
HasUnitStride
, C)
161
{
162
return
true
;
163
}
164
165
166
//
167
// RNG ignores step functor
168
//
169
template
<
class
GT,
class
C>
170
inline
int
171
for_each
(
const
SequenceGen<GT>
&,
StepFunctor
, C)
172
{
173
return
0;
174
}
175
176
//
177
// RNG ignores rewind functor
178
//
179
template
<
class
GT,
class
C>
180
inline
int
181
for_each
(
const
SequenceGen<GT>
&,
RewindFunctor
, C)
182
{
183
return
0;
184
}
185
186
// RNG ignores filling guard cells question
187
template
<
class
GT,
class
C,
unsigned
int
D,
class
T1>
188
inline
int
189
for_each
(
const
SequenceGen<GT>
&,
190
const
FillGCIfNecessaryTag<D,T1>
&, C)
191
{
192
return
0;
193
}
194
195
196
#endif // RNG_ASSIGN_DEFS_H
197
198
/***************************************************************************
199
* $RCSfile: RNGAssignDefs.h,v $ $Author: adelmann $
200
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
201
* IPPL_VERSION_ID: $Id: RNGAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
202
***************************************************************************/
203
EvalFunctor_1
Definition:
AssignTags.h:42
BeginLField
Definition:
AssignTags.h:78
HasUnitStride
Definition:
AssignTags.h:121
IsCompressed
Definition:
AssignTags.h:31
SequenceGen
Definition:
SequenceGen.h:75
StepFunctor
Definition:
AssignTags.h:102
EvalFunctor_0
Definition:
PETE.h:198
SequenceGen::Return_t
GT::Return_t Return_t
Definition:
SequenceGen.h:89
PETE_CountElems
Definition:
PETE.h:221
FillGCIfNecessaryTag
Definition:
AssignTags.h:134
EvalFunctor_3
Definition:
AssignTags.h:64
AssignTags.h
NextLField
Definition:
AssignTags.h:91
EvalFunctor_2
Definition:
AssignTags.h:53
PlugBase
Definition:
AssignDefs.h:69
IpplExpressions.h
PETE_Increment
Definition:
PETE.h:209
for_each
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition:
AssignDefs.h:30
SameFieldID
Definition:
AssignTags.h:23
RewindFunctor
Definition:
AssignTags.h:109
Generated on Sat Jan 4 2020 14:47:40 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5