2 #ifndef _PROTO_POINT_Ht__ 3 #define _PROTO_POINT_Ht__ 4 #include "Proto_cuda.H" 7 #include "Proto_PAssert.H" 34 CUDA_DECORATION
inline Point();
51 CUDA_DECORATION
inline Point(
const int (&a_tuple)[DIM]);
73 template<
typename... vals>
74 CUDA_DECORATION
inline explicit Point(vals... args) { unpack(0, args...); }
77 CUDA_DECORATION
inline Point(
const Point& a_pt);
90 inline static Point
Ones(
int a_scale=1);
103 inline static Point
Zeros();
126 inline static Point
Basis(
int a_dir,
int a_scale=1);
139 CUDA_DECORATION
inline const int&
operator[](
unsigned char a_index)
const;
147 CUDA_DECORATION
inline int&
operator[](
unsigned char a_index);
161 CUDA_DECORATION
inline Point&
operator=(
const Point& a_rhs);
173 CUDA_DECORATION
inline bool operator<(
const Point& a_rhs)
const;
182 CUDA_DECORATION
inline bool operator==(
const Point& a_pt)
const;
190 CUDA_DECORATION
inline bool operator!=(
const Point& a_pt)
const;
198 CUDA_DECORATION
inline Point
operator+(
const Point& a_rhs)
const;
207 CUDA_DECORATION
inline Point
operator-(
const Point& a_rhs)
const;
216 CUDA_DECORATION
inline Point
operator*(
const Point& a_pt)
const;
226 CUDA_DECORATION
inline Point
operator/(
const Point& a_pt)
const;
236 CUDA_DECORATION
inline Point
operator%(
const Point& a_pt)
const;
244 inline Point
operator+(
int a_nref)
const;
252 inline Point
operator-(
int a_nref)
const;
260 inline Point
operator*(
int a_nref)
const;
269 inline Point
operator/(
int a_nref)
const;
278 inline Point
operator%(
int a_nref)
const;
281 CUDA_DECORATION
inline void operator+=(
const Point& a_pt);
284 CUDA_DECORATION
inline void operator-=(
const Point& a_pt);
295 CUDA_DECORATION
inline void operator/=(
const Point& a_pt);
298 CUDA_DECORATION
inline void operator%=(
const Point& a_pt);
324 inline Point
coarsen(
unsigned int a_refRatio)
const;
328 inline size_t linearSize()
const 330 size_t retval = DIM*
sizeof(int);
334 inline void linearOut(
char* a_buf)
const 336 int* intbuf = (
int *) a_buf;
337 for(
int idir = 0; idir < DIM; idir++)
343 inline void linearIn(
const char* a_buf)
345 const int* intbuf = (
int *) a_buf;
346 for(
int idir = 0; idir < DIM; idir++)
356 inline int sum()
const;
362 inline int absSum()
const;
372 inline void print()
const;
380 template<
typename... vars>
381 CUDA_DECORATION
inline void unpack(
int D,
int i, vars... args)
386 unpack(D+1, args...);
393 inline void Point::unpack(
int D,
int i)
406 inline std::ostream&
operator <<(std::ostream& a_os,
const Point& a_pt)
409 for (
int dir = 0; dir < DIM; dir++)
428 return (a_pt*a_scale);
439 #include "implem/Proto_PointImplem.H" 441 #endif //end include guard CUDA_DECORATION void operator*=(const Point &a_pt)
In Place Componentwise Multiplication Operator.
Definition: Proto_Point.H:251
Definition: Proto_HDF5.H:9
Point coarsen(unsigned int a_refRatio) const
Coarsen Operator.
Definition: Proto_Point.H:292
CUDA_DECORATION void operator+=(const Point &a_pt)
In Place Componentwise Addition Operator.
Definition: Proto_Point.H:239
CUDA_DECORATION const int & operator[](unsigned char a_index) const
Get Component (Const)
Definition: Proto_Point.H:56
CUDA_DECORATION Point & operator=(const Point &a_rhs)
Asignment Operator.
Definition: Proto_Point.H:78
CUDA_DECORATION bool operator!=(const Point &a_pt) const
Inequality Operator.
Definition: Proto_Point.H:112
CUDA_DECORATION Point operator-(const Point &a_rhs) const
Componentwise Point Subtraction Operator.
Definition: Proto_Point.H:130
std::ostream & operator<<(std::ostream &a_os, const Box &a_box)
OStream Operator.
Definition: Proto_Box.H:850
CUDA_DECORATION Point operator%(const Point &a_pt) const
Componentwise Point Modulus Operator.
Definition: Proto_Point.H:184
CUDA_DECORATION Point operator+(const Point &a_rhs) const
Componentwise Point Addition Operator.
Definition: Proto_Point.H:118
CUDA_DECORATION Point(vals... args)
Variadic Constructor.
Definition: Proto_Point.H:74
static CUDA_DECORATION Point Zeros()
Get Zeros.
Definition: Proto_Point.H:37
CUDA_DECORATION Point operator/(const Point &a_pt) const
Componentwise Point Division Operator.
Definition: Proto_Point.H:153
static Point Zeroes()
Get Zeros (Pedantic Spelling)
Definition: Proto_Point.H:110
static CUDA_DECORATION Point Basis(int a_dir, int a_scale=1)
Get Basis.
Definition: Proto_Point.H:48
CUDA_DECORATION void operator/=(const Point &a_pt)
In Place Componentwise Division Operator.
Definition: Proto_Point.H:257
CUDA_DECORATION Point operator*(const Point &a_pt) const
Componentwise Point Multiplication Operator.
Definition: Proto_Point.H:142
static Point Zero()
Get Zeros (Alternate Spelling)
Definition: Proto_Point.H:116
CUDA_DECORATION bool operator==(const Point &a_pt) const
Equality Operator.
Definition: Proto_Point.H:101
CUDA_DECORATION Point()
Definition: Proto_Point.H:4
Definition: Proto_Box.H:11
Integer Valued Vector.
Definition: Proto_Point.H:21
static Point Ones(int a_scale=1)
Get Ones.
Definition: Proto_Point.H:25
CUDA_DECORATION bool operator<(const Point &a_rhs) const
Less-Than Operator.
Definition: Proto_Point.H:88
int sum() const
Sum Operator.
Definition: Proto_Point.H:304
CUDA_DECORATION void operator%=(const Point &a_pt)
In Place Componentwise Modulus Operator.
Definition: Proto_Point.H:263
CUDA_DECORATION void operator-=(const Point &a_pt)
In Place Componentwise Subtraction Operator.
Definition: Proto_Point.H:245
int absSum() const
Absolute Value Sum Operator.
Definition: Proto_Point.H:313
void print() const
Print Function.
Definition: Proto_Point.H:322
int m_tuple[DIM]
Integer coordinates of the Point.
Definition: Proto_Point.H:376
static Point Unit()
Get Unit Point.
Definition: Proto_Point.H:96