#include <IntVect.H>
The class IntVect is an implementation of an integer vector in a SpaceDim-dimensional space. It represents a point in a discrete space. IntVect values are accessed using the operator[] function, as for a normal C++ array. In addition, the basic arithmetic operators have been overloaded to implement scaling and translation operations.
Constants | |
static const IntVect | Zero |
static const IntVect | Unit |
IntVect | BASISV (int dir) |
static int | InitStatics () |
Addition operators | |
IntVect | operator+ (int s, const IntVect &p) |
IntVect & | operator+= (int s) |
IntVect & | operator+= (const IntVect &p) |
IntVect | operator+ (const IntVect &p) const |
IntVect | operator+ (int s) const |
Subtraction operators | |
IntVect | operator- (int s, const IntVect &p) |
IntVect & | operator-= (int s) |
IntVect & | operator-= (const IntVect &p) |
IntVect | operator- (const IntVect &p) const |
IntVect | operator- (int s) const |
Multiplication operators | |
IntVect | operator* (int s, const IntVect &p) |
IntVect & | operator*= (int s) |
IntVect & | operator*= (const IntVect &p) |
IntVect | operator* (const IntVect &p) const |
IntVect | operator* (int s) const |
Other arithmetic operators | |
IntVect | min (const IntVect &p1, const IntVect &p2) |
IntVect | max (const IntVect &p1, const IntVect &p2) |
IntVect | scale (const IntVect &p, int s) |
IntVect | reflect (const IntVect &a, int ref_ix, int idir) |
IntVect | diagShift (const IntVect &p, int s) |
IntVect | coarsen (const IntVect &p, int s) |
IntVect | coarsen (const IntVect &p1, const IntVect &p2) |
IntVect & | min (const IntVect &p) |
IntVect & | max (const IntVect &p) |
IntVect & | scale (int s) |
IntVect & | reflect (int ref_ix, int idir) |
IntVect & | shift (int coord, int s) |
IntVect & | shift (const IntVect &iv) |
IntVect & | diagShift (int s) |
IntVect & | coarsen (const IntVect &p) |
IntVect & | coarsen (int p) |
I/O Functions | |
std::ostream & | operator<< (std::ostream &os, const IntVect &iv) |
std::istream & | operator>> (std::istream &os, IntVect &iv) |
void | printOn (std::ostream &os) const |
void | p () const |
void | dumpOn (std::ostream &os) const |
Public Member Functions | |
Constructors and Accessors | |
IntVect () | |
IntVect (const Vector< int > &vi) | |
~IntVect () | |
IntVect (D_DECL6(int i, int j, int k, int l, int m, int n)) | |
IntVect (const int *a) | |
IntVect (const IntVect &rhs) | |
IntVect (const IndexTM< int, CH_SPACEDIM > &a_tm) | |
IntVect | copy () const |
IntVect & | operator= (const IntVect &rhs) |
int & | operator[] (int i) |
int | operator[] (int i) const |
void | setVal (int i, int val) |
Data pointer functions | |
const int * | getVect () const |
const int * | dataPtr () const |
int * | dataPtr () |
Comparison Operators | |
bool | operator== (const IntVect &p) const |
bool | operator!= (const IntVect &p) const |
bool | operator< (const IntVect &p) const |
bool | operator<= (const IntVect &p) const |
bool | operator> (const IntVect &p) const |
bool | operator>= (const IntVect &p) const |
bool | lexLT (const IntVect &s) const |
bool | lexGT (const IntVect &s) const |
Unary operators | |
IntVect | operator+ () const |
IntVect | operator- () const |
int | sum () const |
int | product () const |
Division operators | |
IntVect & | operator/= (int s) |
IntVect & | operator/= (const IntVect &p) |
IntVect | operator/ (const IntVect &p) const |
IntVect | operator/ (int s) const |
Protected Attributes | |
int | vect [SpaceDim] |
Static Protected Attributes | |
static const size_t | IntVectSize |
Friends | |
class | Box |
class | HDF5Handle |
class | VolIndex |
class | FaceIndex |
class | BLfacade::IntVect |
IntVect::IntVect | ( | ) | [inline] |
Construct an IntVect whose components are uninitialized.
Referenced by diagShift(), operator*(), operator*(), operator+(), operator+(), operator-(), operator-(), operator/(), and scale().
IntVect::~IntVect | ( | ) | [inline] |
Destructor.
IntVect::IntVect | ( | const int * | a | ) | [inline, explicit] |
IntVect::IntVect | ( | const IntVect & | rhs | ) | [inline] |
The copy constructor.
References IntVectSize, and vect.
IntVect::IntVect | ( | const IndexTM< int, CH_SPACEDIM > & | a_tm | ) |
IntVect IntVect::copy | ( | ) | const [inline] |
The assignment operator.
References vect.
int & IntVect::operator[] | ( | int | i | ) | [inline] |
int IntVect::operator[] | ( | int | i | ) | const [inline] |
void IntVect::setVal | ( | int | i, | |
int | val | |||
) | [inline] |
Set i'th coordinate of IntVect to val.
References SpaceDim, and vect.
Referenced by Box::setBig(), Box::setRange(), and Box::setSmall().
const int * IntVect::getVect | ( | ) | const [inline] |
Returns a const pointer to an array of coordinates of the IntVect. Useful for arguments to FORTRAN calls.
References vect.
Referenced by Box::getVect(), IVSFAB< T >::hiVect(), Box::hiVect(), IVSFAB< T >::loVect(), and Box::loVect().
const int * IntVect::dataPtr | ( | ) | const [inline] |
Only for sending to Fortran
References vect.
int * IntVect::dataPtr | ( | ) | [inline] |
Only for sending to Fortran
References vect.
bool IntVect::operator== | ( | const IntVect & | p | ) | const [inline] |
bool IntVect::operator!= | ( | const IntVect & | p | ) | const [inline] |
bool IntVect::operator< | ( | const IntVect & | p | ) | const [inline] |
bool IntVect::operator<= | ( | const IntVect & | p | ) | const [inline] |
Returns true if this IntVect is less than or equal to argument IntVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an IntVect to be neither greater than or equal to, less than or equal to, nor equal to another.
References vect.
bool IntVect::operator> | ( | const IntVect & | p | ) | const [inline] |
bool IntVect::operator>= | ( | const IntVect & | p | ) | const [inline] |
Returns true if this IntVect is greater than or equal to argument IntVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an IntVect to be neither greater than or equal to, less than or equal to, nor equal to another.
References vect.
bool IntVect::lexLT | ( | const IntVect & | s | ) | const [inline] |
Returns true if this IntVect is lexically less than the argument. An IntVect MUST BE either lexically less than, lexically greater than, or equal to another IntVect.
iv1 is lexically less than iv2 if:
in 2-D:
(iv1[0] < iv2[0]) || ((iv1[0] == iv2[0]) && (iv1[1] < iv2[1]));
in 3-D:
(iv1[0] < iv2[0]) || (iv1[0]==iv2[0] && ((iv1[1] < iv2[1] || ((iv1[1] == iv2[1]) && (iv1[2] < iv2[2])))));
References vect.
Referenced by VolIndex::operator<(), operator<(), and Box::operator<().
bool IntVect::lexGT | ( | const IntVect & | s | ) | const [inline] |
Returns true if this IntVect is lexically greater than the argument. An IntVect MUST BE either lexically less than, lexically greater than, or equal to another IntVect.
iv1 is lexically less than iv2 if:
in 2-D:
(iv1[0] > iv2[0]) || ((iv1[0] == iv2[0]) && (iv1[1] > iv2[1]));
in 3-D:
(iv1[0] > iv2[0]) || (iv1[0]==iv2[0] && ((iv1[1] > iv2[1] || ((iv1[1] == iv2[1]) && (iv1[2] > iv2[2])))));
References vect.
IntVect IntVect::operator- | ( | ) | const [inline] |
IntVect & IntVect::operator+= | ( | int | s | ) | [inline] |
IntVect IntVect::operator+ | ( | int | s | ) | const [inline] |
IntVect & IntVect::operator-= | ( | int | s | ) | [inline] |
IntVect IntVect::operator- | ( | int | s | ) | const [inline] |
IntVect & IntVect::operator*= | ( | int | s | ) | [inline] |
IntVect IntVect::operator* | ( | int | s | ) | const [inline] |
IntVect & IntVect::operator/= | ( | int | s | ) | [inline] |
IntVect IntVect::operator/ | ( | int | s | ) | const [inline] |
IntVect & IntVect::scale | ( | int | s | ) | [inline] |
IntVect & IntVect::reflect | ( | int | ref_ix, | |
int | idir | |||
) | [inline] |
IntVect & IntVect::shift | ( | int | coord, | |
int | s | |||
) | [inline] |
Modifies this IntVect by adding s to component in given coordinate direction.
References SpaceDim, and vect.
Referenced by Box::enclosedCells(), Box::grow(), Box::growHi(), Box::growLo(), Box::shift(), and Box::surroundingNodes().
IntVect & IntVect::diagShift | ( | int | s | ) | [inline] |
Modifies this IntVect by adding a scalar s to each component.
References vect.
Referenced by Box::grow().
Modify IntVect by component-wise integer projection.
void IntVect::printOn | ( | std::ostream & | os | ) | const |
Print an IntVect to the ostream.
void IntVect::dumpOn | ( | std::ostream & | os | ) | const |
Print an IntVect to the ostream a bit more verbosely.
static int IntVect::InitStatics | ( | ) | [static] |
Initializes Zero and Unit.
friend class Box [friend] |
friend class HDF5Handle [friend] |
friend class VolIndex [friend] |
friend class FaceIndex [friend] |
friend class BLfacade::IntVect [friend] |
Returns the IntVect that is the component-wise minimum of two argument IntVects.
Returns the IntVect that is the component-wise maximum of two argument IntVects.
Returns an IntVect that is the component-wise integer projection of p by s.
std::ostream& operator<< | ( | std::ostream & | os, | |
const IntVect & | iv | |||
) | [friend] |
Print the IntVect to given output stream in ASCII.
std::istream& operator>> | ( | std::istream & | os, | |
IntVect & | iv | |||
) | [friend] |
Read next IntVect from given input stream.
IntVect BASISV | ( | int | dir | ) | [friend] |
Returns a basis vector in the given coordinate direction.
In 3-D: BASISV(0) == (1,0,0); BASISV(1) == (0,1,0); BASISV(2) == (0,0,1).
In 2-D: BASISV(0) == (1,0); BASISV(1) == (0,1).
Note that the coordinate directions are based at zero.
const IntVect IntVect::Zero [static] |
This is an IntVect all of whose components are equal to zero.
Referenced by BoxIterator::BoxIterator(), Box::convert(), LevelData< T >::copyTo(), IVSFAB< T >::define(), BoxLayoutData< T >::generalCopyTo(), ImageIterator::ok(), and IVSFAB< T >::setDefaultValues().
const IntVect IntVect::Unit [static] |
This is an IntVect all of whose components are equal to one.
Referenced by BoxIterator::BoxIterator(), Box::convert(), CornerCopier::CornerCopier(), BaseIF::corners(), IVSFAB< T >::define(), and IVSFAB< T >::setDefaultValues().
int IntVect::vect[SpaceDim] [protected] |
The individual components of this IntVect.
Referenced by dataPtr(), diagShift(), getVect(), Box::index(), IntVect(), lexGT(), lexLT(), max(), min(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), operator[](), product(), reflect(), scale(), setVal(), shift(), and sum().
const size_t IntVect::IntVectSize [static, protected] |