Go to the documentation of this file.
28 int constexpr
COLON = std::numeric_limits<int>::min();
40 template <
class T,
int rank,
int myMem=memDefault,
int myStyle=styleDefault>
class Array;
129 for (
int i=0; i < rank; i++) { data[i] = dims[i]; }
132 if (
this == &dims) {
return *
this; }
134 for (
int i=0; i < rank; i++) { data[i] = dims[i]; }
139 for (
int i=0; i < rank; i++) { data[i] = dims[i]; }
142 if (
this == &dims) {
return *
this; }
144 for (
int i=0; i < rank; i++) { data[i] = dims[i]; }
149 template <class INT, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
150 Dims(std::vector<INT>
const dims) {
152 for (
int i=0; i < rank; i++) { data[i] = dims[i]; }
156 template <class INT, unsigned int RANK, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
159 for (
int i=0; i < rank; i++) { data[i] = dims(i); }
212 l[0] = b0.l; u[0] = b0.u;
217 l[0] = b0.l; u[0] = b0.u;
218 l[1] = b1.l; u[1] = b1.u;
223 l[0] = b0.l; u[0] = b0.u;
224 l[1] = b1.l; u[1] = b1.u;
225 l[2] = b2.l; u[2] = b2.u;
230 l[0] = b0.l; u[0] = b0.u;
231 l[1] = b1.l; u[1] = b1.u;
232 l[2] = b2.l; u[2] = b2.u;
233 l[3] = b3.l; u[3] = b3.u;
238 l[0] = b0.l; u[0] = b0.u;
239 l[1] = b1.l; u[1] = b1.u;
240 l[2] = b2.l; u[2] = b2.u;
241 l[3] = b3.l; u[3] = b3.u;
242 l[4] = b4.l; u[4] = b4.u;
247 l[0] = b0.l; u[0] = b0.u;
248 l[1] = b1.l; u[1] = b1.u;
249 l[2] = b2.l; u[2] = b2.u;
250 l[3] = b3.l; u[3] = b3.u;
251 l[4] = b4.l; u[4] = b4.u;
252 l[5] = b5.l; u[5] = b5.u;
257 l[0] = b0.l; u[0] = b0.u;
258 l[1] = b1.l; u[1] = b1.u;
259 l[2] = b2.l; u[2] = b2.u;
260 l[3] = b3.l; u[3] = b3.u;
261 l[4] = b4.l; u[4] = b4.u;
262 l[5] = b5.l; u[5] = b5.u;
263 l[6] = b6.l; u[6] = b6.u;
268 l[0] = b0.l; u[0] = b0.u;
269 l[1] = b1.l; u[1] = b1.u;
270 l[2] = b2.l; u[2] = b2.u;
271 l[3] = b3.l; u[3] = b3.u;
272 l[4] = b4.l; u[4] = b4.u;
273 l[5] = b5.l; u[5] = b5.u;
274 l[6] = b6.l; u[6] = b6.u;
275 l[7] = b7.l; u[7] = b7.u;
280 for (
int i=0; i < rank; i++) { l[i] = bnds.l[i]; u[i] = bnds.u[i]; }
283 if (
this == &bnds) {
return *
this; }
285 for (
int i=0; i < rank; i++) { l[i] = bnds.l[i]; u[i] = bnds.u[i]; }
290 for (
int i=0; i < rank; i++) { l[i] = bnds.l[i]; u[i] = bnds.u[i]; }
293 if (
this == &bnds) {
return *
this; }
295 for (
int i=0; i < rank; i++) { l[i] = bnds.l[i]; u[i] = bnds.u[i]; }
299 Bnds(std::vector<Bnd>
const bnds) {
301 for (
int i=0; i < rank; i++) { l[i] = bnds[i].l; u[i] = bnds[i].u; }
304 template <class INT, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
305 Bnds(std::vector<INT>
const bnds) {
307 for (
int i=0; i < rank; i++) { l[i] = 1; u[i] = bnds[i]; }
312 template <class INT, unsigned int RANK, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
315 for (
int i=0; i < rank; i++) { l[i] = 1; u[i] = dims(i); }
320 template <class INT, int LOWER, int UPPER, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
322 rank = UPPER-LOWER+1;
323 for (
int i=LOWER; i <= UPPER; i++) { l[i] = 1; u[i] = dims(i); }
328 template <class INT, int LOWER1, int UPPER1, int LOWER2, int UPPER2, typename std::enable_if< std::is_integral<INT>::value ,
bool>::type =
false>
330 static_assert( UPPER1-LOWER1+1 == UPPER2-LOWER2+1 ,
"ERROR: lbounds and ubounds sizes are not equal" );
331 rank = UPPER1-LOWER1+1;
332 for (
int i=LOWER1; i <= UPPER1; i++) { l[i] = lbounds(i); }
333 for (
int i=LOWER2; i <= UPPER2; i++) { u[i] = ubounds(i); }
YAKL_INLINE Dims(int i0, int i1, int i2, int i3)
Construct a 4-D Dims object)
Definition: YAKL_Array.h:77
Bnds(std::vector< INT > const bnds)
Allows an initializer list or std::vector to be converted to a yakl::Bnds object.
Definition: YAKL_Array.h:305
YAKL_INLINE Dims(Dims const &dims)
Definition: YAKL_Array.h:127
YAKL_INLINE int size() const
Get the number of dimensions.
Definition: YAKL_Array.h:340
YAKL_INLINE Dims(int i0, int i1)
Construct a 2-D Dims object)
Definition: YAKL_Array.h:64
Dims(std::vector< INT > const dims)
This constructor allows converting a std::vector or initializer list to a yakl::Dims object.
Definition: YAKL_Array.h:150
Bnds(CSArray< INT, 1, RANK > const dims)
Allows CSArray object to be converted to a yakl::Bnds object if default lower bounds of 1 are desired...
Definition: YAKL_Array.h:313
YAKL_INLINE Bnds(Bnds const &bnds)
Definition: YAKL_Array.h:278
Dims(CSArray< INT, 1, RANK > const dims)
This constructor allows converting a CSArray object to a yakl::Dims object.
Definition: YAKL_Array.h:157
Bnds(FSArray< INT, 1, SB< LOWER, UPPER >> const dims)
Allows FSArray object to be converted to a yakl::Bnds object if default lower bounds of 1 are desired...
Definition: YAKL_Array.h:321
YAKL_INLINE Bnds & operator=(Bnds &&bnds)
Definition: YAKL_Array.h:292
YAKL_INLINE Dims & operator=(Dims &&dims)
Definition: YAKL_Array.h:141
YAKL_INLINE Dims & operator=(Dims const &dims)
Definition: YAKL_Array.h:131
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2, Bnd b3, Bnd b4)
Construct an 5-D Dims object)
Definition: YAKL_Array.h:237
Bnds(std::vector< Bnd > const bnds)
Allows an initializer list or std::vector to be converted to a yakl::Bnds object.
Definition: YAKL_Array.h:299
YAKL_INLINE Bnds & operator=(Bnds const &bnds)
Definition: YAKL_Array.h:282
YAKL_INLINE Dims(int i0, int i1, int i2, int i3, int i4, int i5)
Construct a 6-D Dims object)
Definition: YAKL_Array.h:94
YAKL_INLINE Bnd(int l_in, int u_in)
Create a dimension bound with a lower limit of l_in and an upper limit of u_in.
Definition: YAKL_Array.h:188
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2)
Construct an 3-D Dims object)
Definition: YAKL_Array.h:222
constexpr int styleDefault
Default style is C-style for yakl::Array objects.
Definition: YAKL_Array.h:24
#define __YAKL_NAMESPACE_WRAPPER_END__
Definition: YAKL.h:20
YAKL_INLINE Bnds(Bnd b0)
Construct an 1-D Dims object)
Definition: YAKL_Array.h:211
YAKL_INLINE Bnds()
Definition: YAKL_Array.h:209
YAKL_INLINE Bnds(Bnd b0, Bnd b1)
Construct an 2-D Dims object)
Definition: YAKL_Array.h:216
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2, Bnd b3, Bnd b4, Bnd b5)
Construct an 6-D Dims object)
Definition: YAKL_Array.h:246
This specifies a set of bounds for a dimension when declaring a yakl::FSArray.
Definition: YAKL_FSArray.h:18
YAKL_INLINE Dims()
Definition: YAKL_Array.h:57
YAKL_INLINE Bnd(int u_in)
Create a dimension bound with a lower limit of 1 and an upper limit of u_in.
Definition: YAKL_Array.h:186
constexpr int COLON
This is just a convenience syntax for slicing yakl::Array objects to make it clear in the user level ...
Definition: YAKL_Array.h:28
#define __YAKL_NAMESPACE_WRAPPER_BEGIN__
Definition: YAKL.h:19
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2, Bnd b3, Bnd b4, Bnd b5, Bnd b6)
Construct an 7-D Dims object)
Definition: YAKL_Array.h:256
YAKL_INLINE Dims(Dims &&dims)
Definition: YAKL_Array.h:137
Describes a single bound for creating Fortran-style yakl::Array objects.
Definition: YAKL_Array.h:177
#define YAKL_INLINE
Used to decorate functions called from kernels (parallel_for and parallel_outer) or from CPU function...
Definition: YAKL_defines.h:140
Bnds(FSArray< INT, 1, SB< LOWER1, UPPER1 >> const lbounds, FSArray< INT, 1, SB< LOWER2, UPPER2 >> const ubounds)
Allows two FSArray objects (one for lower bounds, one for upper bounds) to be converted to a yakl::Bn...
Definition: YAKL_Array.h:329
YAKL_INLINE int size() const
Get the number of dimensions.
Definition: YAKL_Array.h:166
YAKL_INLINE Bnds(Bnds &&bnds)
Definition: YAKL_Array.h:288
YAKL_INLINE Dims(int i0, int i1, int i2)
Construct a 3-D Dims object)
Definition: YAKL_Array.h:70
YAKL_INLINE Dims(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7)
Construct an 8-D Dims object)
Definition: YAKL_Array.h:115
YAKL_INLINE Bnd operator[](int i) const
These objects are always indexed with square bracket notation like a std::vector or std::array.
Definition: YAKL_Array.h:337
constexpr int styleC
Template parameter for yakl::Array that specifies it should follow C-style behavior.
Definition: YAKL_Array.h:20
YAKL_INLINE int operator[](int i) const
These objects are always indexed with square bracket notation like a std::vector or std::array.
Definition: YAKL_Array.h:163
YAKL_INLINE Dims(int i0, int i1, int i2, int i3, int i4, int i5, int i6)
Construct a 7-D Dims object)
Definition: YAKL_Array.h:104
This class holds C-style dimensions for using in yakl::Array objects.
Definition: YAKL_Array.h:50
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2, Bnd b3, Bnd b4, Bnd b5, Bnd b6, Bnd b7)
Construct an 8-D Dims object)
Definition: YAKL_Array.h:267
YAKL_INLINE Dims(int i0, int i1, int i2, int i3, int i4)
Construct a 5-D Dims object)
Definition: YAKL_Array.h:85
This declares the yakl::Array class. Please see the yakl::styleC and yakl::styleFortran template spec...
Definition: YAKL_Array.h:40
YAKL_INLINE Bnds(Bnd b0, Bnd b1, Bnd b2, Bnd b3)
Construct an 4-D Dims object)
Definition: YAKL_Array.h:229
C-style array on the stack similar in nature to, e.g., float arr[ny][nx];
Definition: YAKL_CSArray.h:30
YAKL_INLINE Bnd()
Create a dimension bound with a lower limit of 1 and an upper limit of 1.
Definition: YAKL_Array.h:184
constexpr int styleFortran
Template parameter for yakl::Array that specifies it should follow Fortran-style behavior.
Definition: YAKL_Array.h:22
YAKL_INLINE Dims(int i0)
Construct a 1-D Dims object)
Definition: YAKL_Array.h:59
This class holds Fortran-style dimensions for using in creating yakl::Array objects.
Definition: YAKL_Array.h:200
Fortran-style array on the stack similar in nature to, e.g., float arr[ny][nx];
Definition: YAKL_FSArray.h:53