Proto
|
Integer Valued Vector. More...
#include <Proto_Point.H>
Public Member Functions | |
Constructors | |
CUDA_DECORATION | Point () |
CUDA_DECORATION | Point (const int(&a_tuple)[DIM]) |
C Array Constructor. More... | |
template<typename... vals> | |
CUDA_DECORATION | Point (vals... args) |
Variadic Constructor. More... | |
CUDA_DECORATION | Point (const Point &a_pt) |
Copy Constructor. | |
Accessors | |
CUDA_DECORATION const int & | operator[] (unsigned char a_index) const |
Get Component (Const) More... | |
CUDA_DECORATION int & | operator[] (unsigned char a_index) |
Get Component (Non-Const) More... | |
Operators | |
CUDA_DECORATION Point & | operator= (const Point &a_rhs) |
Asignment Operator. More... | |
CUDA_DECORATION bool | operator< (const Point &a_rhs) const |
Less-Than Operator. More... | |
CUDA_DECORATION bool | operator== (const Point &a_pt) const |
Equality Operator. More... | |
CUDA_DECORATION bool | operator!= (const Point &a_pt) const |
Inequality Operator. More... | |
CUDA_DECORATION Point | operator+ (const Point &a_rhs) const |
Componentwise Point Addition Operator. More... | |
CUDA_DECORATION Point | operator- (const Point &a_rhs) const |
Componentwise Point Subtraction Operator. More... | |
CUDA_DECORATION Point | operator* (const Point &a_pt) const |
Componentwise Point Multiplication Operator. More... | |
CUDA_DECORATION Point | operator/ (const Point &a_pt) const |
Componentwise Point Division Operator. More... | |
CUDA_DECORATION Point | operator% (const Point &a_pt) const |
Componentwise Point Modulus Operator. More... | |
Point | operator+ (int a_nref) const |
Scalar Addition Operator. More... | |
Point | operator- (int a_nref) const |
Scalar Subtraction Operator. More... | |
Point | operator* (int a_nref) const |
Scalar Multiplication Operator. More... | |
Point | operator/ (int a_nref) const |
Scalar Division Operator. More... | |
Point | operator% (int a_nref) const |
Scalar Modulus Operator. More... | |
CUDA_DECORATION void | operator+= (const Point &a_pt) |
In Place Componentwise Addition Operator. | |
CUDA_DECORATION void | operator-= (const Point &a_pt) |
In Place Componentwise Subtraction Operator. | |
CUDA_DECORATION void | operator*= (const Point &a_pt) |
In Place Componentwise Multiplication Operator. | |
CUDA_DECORATION void | operator/= (const Point &a_pt) |
In Place Componentwise Division Operator. More... | |
CUDA_DECORATION void | operator%= (const Point &a_pt) |
In Place Componentwise Modulus Operator. | |
void | operator+= (int a_n) |
In Place Scalar Addition Operator. | |
void | operator-= (int a_n) |
In Place Scalar Subtraction Operator. | |
void | operator*= (int a_n) |
In Place Scalar Multiplication Operator. | |
void | operator/= (int a_n) |
In Place Scalar Division Operator. More... | |
void | operator%= (int a_n) |
In Place Scalar Modulus Operator. | |
Point | coarsen (unsigned int a_refRatio) const |
Coarsen Operator. More... | |
size_t | linearSize () const |
void | linearOut (char *a_buf) const |
void | linearIn (const char *a_buf) |
int | sum () const |
Sum Operator. More... | |
int | absSum () const |
Absolute Value Sum Operator. More... | |
Utility | |
void | print () const |
Print Function. More... | |
Static Public Member Functions | |
Static Methods | |
static Point | Ones (int a_scale=1) |
Get Ones. More... | |
static Point | Unit () |
Get Unit Point. More... | |
static CUDA_DECORATION Point | Zeros () |
Get Zeros. More... | |
static Point | Zeroes () |
Get Zeros (Pedantic Spelling) More... | |
static Point | Zero () |
Get Zeros (Alternate Spelling) More... | |
static CUDA_DECORATION Point | Basis (int a_dir, int a_scale=1) |
Get Basis. More... | |
Data Fields | |
int | m_tuple [DIM] |
Integer coordinates of the Point. | |
Integer Valued Vector.
An element of
|
inline |
Default Constructor Returns the zero Point (0,0,...,0)
|
inline |
|
inlineexplicit |
Variadic Constructor.
Builds a Point from the first DIM arguments given to this. Any trailing arguments are ignored. This constructor is very useful for building dimensionally independent test code.
Example:
args | at least DIM integer arguments representing a Point |
|
inline |
Absolute Value Sum Operator.
Computes the sum of the absolute values of the entries in *this
|
inlinestatic |
Get Basis.
Returns an axis-aligned Point .
a_dir | A spatial axis (0 for x, 1 for y, etc.) |
a_scale | (Optional) value to scale the unit vector by (default: no scaling) |
|
inline |
Coarsen Operator.
Returns a new Point coarsened by a_refRatio. This function is identical to any of the division operators.
a_refRatio | A non-zero refinement ratio. |
|
inlinestatic |
Get Ones.
Returns the unit Point scale*(1,1,...,1)
a_scale | (Optional) value to scale the vector by (default: 1) |
|
inline |
|
inline |
Scalar Modulus Operator.
Creates a new point by taking the modulus of each component of *this by nref. Quotients are rounded down. Modulo of any component by 0 yields an error.
a_nref | An Integer scalar |
|
inline |
Scalar Multiplication Operator.
Creates a new point by multiplying each component of *this by nref.
a_nref | An Integer scalar |
|
inline |
Scalar Addition Operator.
Creates a new point by adding nref to each component of *this.
a_nref | An Integer scalar |
|
inline |
Scalar Subtraction Operator.
Creates a new point by subtracting nref to each component of *this.
a_nref | An Integer scalar |
|
inline |
Scalar Division Operator.
Creates a new point by dividing each component of *this by nref. Quotients are rounded down. Division of any component by 0 yields an error.
a_nref | An Integer scalar |
|
inline |
In Place Componentwise Division Operator.
Quotients are rounded down. Division of any component by 0 yields an error.
a_pt | Another Point |
|
inline |
In Place Scalar Division Operator.
Quotients are rounded down. Division of any component by 0 yields an error.
|
inline |
Less-Than Operator.
Used to define an ordering for placing Points in maps etc. Do not use to actually compare Points. Uses Lexical comparison. Note that Chombo lexLT is also lexical but uses the dimensions in the opposite way. Both work for maps and so on.
a_rhs | Another Point |
|
inline |
|
inline |
Get Component (Const)
Returns a const reference to the a_index component of *this
a_index | Index in [0,DIM) |
|
inline |
Get Component (Non-Const)
Returns a mutable reference to the a_index component of *this
a_index | Index in [0,DIM) |
|
inline |
Print Function.
Output is formatted: (p1,p2,...)
|
inline |
Sum Operator.
Computes the sum of the entries in *this
|
inlinestatic |
Get Zeros (Alternate Spelling)
Identical to Zeros() but with alternative spelling.
|
inlinestatic |
Get Zeros (Pedantic Spelling)
Identical to Zeros() but with alternative spelling.
|
inlinestatic |
Get Zeros.
Returns the zero Point (0,0,...,0)