Proto
3.2
|
Integer Valued Vector. More...
#include <Proto_Point.H>
Public Member Functions | |
template<typename... vars> | |
ACCEL_DECORATION void | unpack (int D, int i, vars... args) |
template<> | |
ACCEL_DECORATION void | unpack (int D, int i) |
Constructors | |
ACCEL_DECORATION | Point () |
ACCEL_DECORATION | Point (const int(&a_tuple)[DIM]) |
C-Array Constructor. More... | |
template<typename... vals> | |
ACCEL_DECORATION | Point (vals... args) |
Variadic Constructor. More... | |
ACCEL_DECORATION | Point (const Point &a_pt) |
Copy Constructor. More... | |
Accessors | |
ACCEL_DECORATION const int & | operator[] (unsigned int a_index) const |
Get Component (Const) More... | |
ACCEL_DECORATION int & | operator[] (unsigned int a_index) |
Get Component (Non-Const) More... | |
Operators | |
ACCEL_DECORATION Point & | operator= (const Point &a_rhs) |
Asignment Operator. More... | |
ACCEL_DECORATION bool | operator< (const Point &a_rhs) const |
Less-Than Operator. More... | |
ACCEL_DECORATION bool | operator== (const Point &a_pt) const |
Equality Operator. More... | |
ACCEL_DECORATION bool | operator!= (const Point &a_pt) const |
Inequality Operator. More... | |
ACCEL_DECORATION Point | operator+ (const Point &a_rhs) const |
Componentwise Point Addition Operator. More... | |
ACCEL_DECORATION Point | operator- (const Point &a_rhs) const |
Componentwise Point Subtraction Operator. More... | |
ACCEL_DECORATION Point | operator* (const Point &a_pt) const |
Componentwise Point Multiplication Operator. More... | |
ACCEL_DECORATION Point | operator/ (const Point &a_pt) const |
Componentwise Point Division Operator. More... | |
ACCEL_DECORATION Point | operator% (const Point &a_pt) const |
Componentwise Point Modulus Operator. More... | |
Point | operator+ (int a_value) const |
Scalar Addition Operator. More... | |
Point | operator- (int a_value) const |
Scalar Subtraction Operator. More... | |
Point | operator* (int a_value) const |
Scalar Multiplication Operator. More... | |
Point | operator/ (int a_value) const |
Scalar Division Operator. More... | |
Point | operator% (int a_value) const |
Scalar Modulus Operator. More... | |
ACCEL_DECORATION void | operator+= (const Point &a_pt) |
In Place Componentwise Addition Operator. More... | |
ACCEL_DECORATION void | operator-= (const Point &a_pt) |
In Place Componentwise Subtraction Operator. More... | |
ACCEL_DECORATION void | operator*= (const Point &a_pt) |
In Place Componentwise Multiplication Operator. More... | |
ACCEL_DECORATION void | operator/= (const Point &a_pt) |
In Place Componentwise Division Operator. More... | |
ACCEL_DECORATION void | operator%= (const Point &a_pt) |
In Place Componentwise Modulus Operator. More... | |
void | operator+= (int a_n) |
In Place Scalar Addition Operator. More... | |
void | operator-= (int a_n) |
In Place Scalar Subtraction Operator. More... | |
void | operator*= (int a_n) |
In Place Scalar Multiplication Operator. More... | |
void | operator/= (int a_n) |
In Place Scalar Division Operator. More... | |
void | operator%= (int a_n) |
In Place Scalar Modulus Operator. More... | |
int | dot (const Point &a_rhs) const |
Compute Dot Product. More... | |
Point | coarsen (unsigned int a_refRatio) const |
Coarsen Operator. More... | |
ACCEL_DECORATION int | sum () const |
Sum Operator. More... | |
int | sumAbs () const |
Absolute Value Sum Operator. More... | |
int | min () const |
int | max () const |
Point | abs () const |
bool | isotropic () const |
Isotropic Query. More... | |
int | codim () const |
Query Codimension. More... | |
std::array< Point, DIM > | parallelUnit () const |
Parallel Unit Vectors. More... | |
std::array< Point, DIM > | perpUnit () const |
Perpendicular Unit Vectors. More... | |
int | firstNonZeroIndex () const |
int | lastNonZeroIndex () const |
std::vector< int > | coords () const |
Coordinates of non-zero entries. More... | |
std::vector< int > | perpCoords () const |
Coordinates of zero entries. More... | |
std::vector< Point > | split () const |
Scaled Unit Vectors. More... | |
std::vector< Point > | subset () const |
Point | dir () const |
Convert Point to Direction. More... | |
size_t | linearSize () const |
Linear Size. More... | |
void | linearOut (char *a_buf) const |
Linear Out. More... | |
void | linearIn (const char *a_buf) |
Linear In. More... | |
Utility | |
void | print () const |
Print Function. More... | |
std::string | str () const |
Static Public Member Functions | |
Static Methods | |
static ACCEL_DECORATION Point | Ones (int a_scale=1) |
Get Ones. More... | |
static ACCEL_DECORATION Point | Unit () |
Get Unit Point. More... | |
static ACCEL_DECORATION Point | Zeros () |
Get Zeros. More... | |
static ACCEL_DECORATION Point | Zeroes () |
Get Zeros (Pedantic Spelling) More... | |
static ACCEL_DECORATION Point | Zero () |
Get Zeros (Alternate Spelling) More... | |
static ACCEL_DECORATION Point | Basis (int a_dir, int a_scale=1) |
Get Basis. More... | |
static ACCEL_DECORATION Point | Basis (int a_dir, const Side::LoHiSide a_side) |
Get Basis (Side Argument) More... | |
static ACCEL_DECORATION Point | X () |
static ACCEL_DECORATION Point | Y () |
static ACCEL_DECORATION Point | Z () |
static std::set< Point > | Directions () |
static std::set< Point > | DirectionsOfCodim (int a_codim) |
Public Attributes | |
int | m_tuple [DIM] |
Integer coordinates of the Point. More... | |
Integer Valued Vector.
An element \(\mathbf{p}\in\mathbb{Z}^{DIM}\)
|
inline |
|
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 |
References ACCEL_DECORATION, Ones(), Point(), and unpack().
|
inline |
|
inlinestatic |
Get Ones.
Returns the unit Point scale*(1,1,...,1)
a_scale | (Optional) value to scale the vector by (default: 1) |
Referenced by Proto::Shift::Ones(), Point(), and Unit().
|
inlinestatic |
|
inlinestatic |
Get Zeros.
Returns the zero Point (0,0,...,0)
Referenced by Proto::AMROp< OPType, T, MEM >::auxGhost(), Proto::LevelOp< OpType, T, BCType, MEM >::auxGhost(), Proto::CompositeOp< NDOMAINS >::ghost(), Proto::MBDataPoint::inBoundary(), Unit(), Zero(), Zeroes(), and Proto::Shift::Zeros().
|
inlinestatic |
|
inlinestatic |
Get Zeros (Alternate Spelling)
Identical to Zeros() but with alternative spelling.
References ACCEL_DECORATION, Basis(), and Zeros().
|
inlinestatic |
Get Basis.
Returns an axis-aligned Point \(\bf{p}: \bf{p}[k] = scale*\delta_{dir}^k\).
a_dir | A coordinate axis. |
a_scale | (Optional) value to scale the unit vector by (default: 1) |
Referenced by Proto::Shift::Basis(), Proto::Register< T, C, MEM >::dir(), Proto::Box::faceBox(), X(), Y(), Z(), and Zero().
|
inlinestatic |
|
inlinestatic |
References Basis().
Referenced by Proto::Shift::X().
|
inlinestatic |
References Basis().
Referenced by Proto::Shift::Y().
|
inlinestatic |
References abs(), ACCEL_DECORATION, Basis(), coarsen(), codim(), coords(), dir(), Directions(), DirectionsOfCodim(), dot(), firstNonZeroIndex(), isotropic(), lastNonZeroIndex(), linearIn(), linearOut(), linearSize(), max(), min(), operator!=(), operator%(), operator%=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator=(), operator==(), operator[](), parallelUnit(), perpCoords(), perpUnit(), print(), split(), str(), subset(), sum(), and sumAbs().
Referenced by Proto::Shift::Z().
|
inlinestatic |
Referenced by Proto::CoarseFineBoundary< P >::CoarseFineBoundary(), and Z().
|
inline |
Get Component (Const)
Returns a const reference to the a_index component of *this
a_index | Index in [0,DIM) |
Referenced by Z().
|
inline |
Get Component (Non-Const)
Returns a mutable reference to the a_index component of *this
a_index | Index in [0,DIM) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
In Place Scalar Addition Operator.
Adds an integer to every component of *this
.
a_n | An integer. |
|
inline |
In Place Scalar Subtraction Operator.
Subtracts an integer from every component of *this
.
a_n | An integer. |
|
inline |
In Place Scalar Multiplication Operator.
Multiplies every component of *this
by an integer.
a_n | An integer. |
|
inline |
In Place Scalar Division Operator.
Divides every component of *this
by an integer. Quotients are rounded down. Division by 0 yields an error.
a_n | An integer. |
|
inline |
In Place Scalar Modulus Operator.
Computes the modulus of every component of *this by an integer. Modulo of 0 results in an error.
a_n | An integer. |
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by Z().
|
inline |
Referenced by Z().
|
inline |
Referenced by Proto::absMaxPoint(), and Z().
|
inline |
|
inline |
Query Codimension.
Returns the codimensionality of *this (e.g. the number of num-zero entries)
Referenced by Proto::MBBoundaryData< T, C, MEM >::adjFace(), Proto::MBBoundaryData< T, C, MEM >::localFace(), Proto::Register< T, C, MEM >::Register(), and Z().
|
inline |
|
inline |
|
inline |
Referenced by Z().
|
inline |
Referenced by Z().
|
inline |
Coordinates of non-zero entries.
Referenced by Z().
|
inline |
Coordinates of zero entries.
Referenced by Z().
|
inline |
Returns a vector of Points each of which are this dotted into a subset of unit vectors The zero vector is omitted
Referenced by Z().
|
inline |
|
inline |
|
inline |
Linear Out.
Writes from *this into a linear buffer of size this->linearSize()
.
a_buf | A buffer |
Referenced by Z().
|
inline |
Linear In.
Reads to *this from a linear buffer of size this->linearSize()
.
a_buf | A buffer |
Referenced by Z().
|
inline |
|
inline |
Referenced by Z().
|
inline |
Referenced by Point().
|
inline |
References m_tuple, Proto::operator<<(), and Proto::operator>>().