IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
PRegion.h
Go to the documentation of this file.
1//
2// Class PRegion
3// PRegion represents a (possibly continuous) numeric interval. It is
4// similar to Index, with the following differences:
5// 1. It is templated on the data type; Index always uses integers
6// 2. A PRegion is defined between two endpoints A and B; the PRegion
7// includes values X where A <= X < B (i.e., X in [A,B) )
8// 3. PRegion does not keep track of a base Index, and does not
9// supply the plugBase operation. It is not designed for use in
10// Field operations like Index is, it is meant instead for use in
11// Particle construction and usage.
12//
13// PRegion<T>() --> make a PRegion on [0,1)
14// PRegion<T>(B) --> make a PRegion on [0,B)
15// PRegion<T>(A,B) --> make a PRegion on [A,B)
16//
17#ifndef IPPL_PREGION_H
18#define IPPL_PREGION_H
19
20namespace ippl {
25 template <typename T>
26 class PRegion {
27 public:
31 KOKKOS_FUNCTION
32 PRegion();
33
37 KOKKOS_FUNCTION
38 PRegion(T b);
39
43 KOKKOS_FUNCTION
44 PRegion(T a, T b);
45
46 KOKKOS_DEFAULTED_FUNCTION
47 ~PRegion() = default;
48
49 KOKKOS_FUNCTION
50 PRegion(const PRegion<T>&);
51
52 KOKKOS_INLINE_FUNCTION PRegion<T>& operator=(const PRegion<T>& rhs);
53
57 KOKKOS_INLINE_FUNCTION T min() const noexcept;
58
62 KOKKOS_INLINE_FUNCTION T max() const noexcept;
63
67 KOKKOS_INLINE_FUNCTION T length() const noexcept;
68
72 KOKKOS_INLINE_FUNCTION bool empty() const noexcept;
73
74 KOKKOS_INLINE_FUNCTION PRegion<T>& operator+=(T t) noexcept;
75
76 KOKKOS_INLINE_FUNCTION PRegion<T>& operator-=(T t) noexcept;
77
78 KOKKOS_INLINE_FUNCTION PRegion<T>& operator*=(T t) noexcept;
79
80 KOKKOS_INLINE_FUNCTION PRegion<T>& operator/=(T t) noexcept;
81
82 private:
85
88 };
89} // namespace ippl
90
91#include "PRegion.hpp"
92
93#endif
Definition Archive.h:20
KOKKOS_INLINE_FUNCTION T max() const noexcept
Definition PRegion.hpp:57
KOKKOS_INLINE_FUNCTION T min() const noexcept
Definition PRegion.hpp:52
T b_m
Interval end point.
Definition PRegion.h:87
KOKKOS_FUNCTION PRegion()
Definition PRegion.hpp:24
KOKKOS_INLINE_FUNCTION PRegion< T > & operator=(const PRegion< T > &rhs)
Definition PRegion.hpp:45
KOKKOS_DEFAULTED_FUNCTION ~PRegion()=default
T a_m
Interval start point.
Definition PRegion.h:84
KOKKOS_INLINE_FUNCTION bool empty() const noexcept
Definition PRegion.hpp:67
KOKKOS_INLINE_FUNCTION T length() const noexcept
Definition PRegion.hpp:62