Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

IntVect Class Reference

An integer Vector in SpaceDim-dimensional space. More...

#include <IntVect.H>

Collaboration diagram for IntVect:

Collaboration graph
[legend]
List of all members.

Addition operators

IntVectoperator+= (int s)
IntVectoperator+= (const IntVect &p)
IntVect operator+ (const IntVect &p) const
IntVect operator+ (int s) const
IntVect operator+ (int s, const IntVect &p)

Subtraction operators

IntVectoperator-= (int s)
IntVectoperator-= (const IntVect &p)
IntVect operator- (const IntVect &p) const
IntVect operator- (int s) const
IntVect operator- (int s, const IntVect &p)

Multiplication operators

IntVectoperator *= (int s)
IntVectoperator *= (const IntVect &p)
IntVect operator * (const IntVect &p) const
IntVect operator * (int s) const
IntVect operator * (int s, const IntVect &p)

Other arithmetic operators

IntVectmin (const IntVect &p)
IntVectmax (const IntVect &p)
IntVectscale (int s)
IntVectreflect (int ref_ix, int idir)
IntVectshift (int coord, int s)
IntVectshift (const IntVect &iv)
IntVectdiagShift (int s)
IntVectcoarsen (const IntVect &p)
IntVectcoarsen (int p)
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)

I/O Functions

void printOn (std::ostream &os) const
void p () const
void dumpOn (std::ostream &os) const
std::ostream & operator<< (std::ostream &os, const IntVect &iv)
std::istream & operator>> (std::istream &os, IntVect &iv)

Constants

static int InitStatics ()
static const IntVect Zero
static const IntVect Unit
IntVect BASISV (int dir)

Public Member Functions

Constructors and Accessors
 IntVect ()
 ~IntVect ()
 IntVect (D_DECL(int i, int j, int k))
 IntVect (const int *a)
 IntVect (const IntVect &rhs)
IntVect copy () const
IntVectoperator= (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
IntVectoperator/= (int s)
IntVectoperator/= (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

Detailed Description

An integer Vector in SpaceDim-dimensional space.

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.


Constructor & Destructor Documentation

IntVect::IntVect  )  [inline]
 

Construct an IntVect whose components are uninitialized.

IntVect::~IntVect  )  [inline]
 

Destructor.

IntVect::IntVect D_DECL(int i, int j, int k)   )  [inline]
 

Construct an IntVect given the specific values for its coordinates. D_DECL is a macro that sets the constructor to take CH_SPACEDIM arguments.

IntVect::IntVect const int *  a  )  [inline, explicit]
 

Construct an IntVect setting the coordinates to the corresponding values in the integer array a.

IntVect::IntVect const IntVect rhs  )  [inline]
 

The copy constructor.


Member Function Documentation

IntVect& IntVect::coarsen int  p  ) 
 

Modify IntVect by component-wise integer projection.

IntVect& IntVect::coarsen const IntVect p  ) 
 

Modify IntVect by component-wise integer projection.

IntVect IntVect::copy  )  const [inline]
 

int * IntVect::dataPtr  )  [inline]
 

Only for sending to Fortran

const int * IntVect::dataPtr  )  const [inline]
 

Only for sending to Fortran

IntVect & IntVect::diagShift int  s  )  [inline]
 

Modifies this IntVect by adding a scalar s to each component.

void IntVect::dumpOn std::ostream &  os  )  const
 

Print an IntVect to the ostream a bit more verbosely.

const int * IntVect::getVect  )  const [inline]
 

Returns a const pointer to an array of coordinates of the IntVect. Useful for arguments to FORTRAN calls.

static int IntVect::InitStatics  )  [static]
 

Initializes Zero and Unit.

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])))));

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])))));

IntVect & IntVect::max const IntVect p  )  [inline]
 

Modifies this IntVect by taking component-wise max with IntVect argument.

IntVect & IntVect::min const IntVect p  )  [inline]
 

Modifies this IntVect by taking component-wise min with IntVect argument.

IntVect IntVect::operator * int  s  )  const [inline]
 

Returns an IntVect that is this IntVect with each component multiplied by a scalar.

IntVect IntVect::operator * const IntVect p  )  const [inline]
 

Returns component-wise product of this IntVect with argument.

IntVect & IntVect::operator *= const IntVect p  )  [inline]
 

Modifies this IntVect by component-wise multiplication by argument.

IntVect & IntVect::operator *= int  s  )  [inline]
 

Modifies this IntVect by multiplication of each component by a scalar.

bool IntVect::operator!= const IntVect p  )  const [inline]
 

Returns true if this IntVect is different from argument IntVect. All comparisons between analogous components must be satisfied.

IntVect IntVect::operator+ int  s  )  const [inline]
 

Return an IntVect that is this IntVect with a scalar added to each component.

IntVect IntVect::operator+ const IntVect p  )  const [inline]
 

Returns component-wise sum of this IntVect and argument.

IntVect IntVect::operator+  )  const [inline]
 

Unary plus -- for completeness.

IntVect & IntVect::operator+= const IntVect p  )  [inline]
 

Modifies this IntVect by component-wise addition with argument.

IntVect & IntVect::operator+= int  s  )  [inline]
 

Modifies this IntVect by addition of a scalar to each component.

IntVect IntVect::operator- int  s  )  const [inline]
 

Returns an IntVect that is this IntVect with a scalar s subtracted from each component.

IntVect IntVect::operator- const IntVect p  )  const [inline]
 

Returns an IntVect that is this IntVect with p subtracted from it component-wise.

IntVect IntVect::operator-  )  const [inline]
 

Unary minus -- negates all components of this IntVect.

IntVect & IntVect::operator-= const IntVect p  )  [inline]
 

Modifies this IntVect by component-wise subtraction by argument.

IntVect & IntVect::operator-= int  s  )  [inline]
 

Modifies this IntVect by subtraction of a scalar from each component.

IntVect IntVect::operator/ int  s  )  const [inline]
 

Returns an IntVect that is this IntVect with each component divided by a scalar.

IntVect IntVect::operator/ const IntVect p  )  const [inline]
 

Returns component-wise quotient of this IntVect by argument.

IntVect & IntVect::operator/= const IntVect p  )  [inline]
 

Modifies this IntVect by component-wise division by IntVect argument.

IntVect & IntVect::operator/= int  s  )  [inline]
 

Modifies this IntVect by division of each component by a scalar.

bool IntVect::operator< const IntVect p  )  const [inline]
 

Returns true if this IntVect is less than 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, less than, nor equal to another.

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.

IntVect & IntVect::operator= const IntVect rhs  )  [inline]
 

The assignment operator.

bool IntVect::operator== const IntVect p  )  const [inline]
 

Returns true if this IntVect is equivalent to argument IntVect. All comparisons between analogous components must be satisfied.

bool IntVect::operator> const IntVect p  )  const [inline]
 

Returns true if this IntVect is greater than 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, less than, nor equal to another.

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.

int IntVect::operator[] int  i  )  const [inline]
 

Returns the i'th coordinate of the IntVect.

int & IntVect::operator[] int  i  )  [inline]
 

Returns a modifiable lvalue reference to the i'th coordinate of the IntVect.

void IntVect::p  )  const
 

Print an IntVect to the pout().

void IntVect::printOn std::ostream &  os  )  const
 

Print an IntVect to the ostream.

int IntVect::product  )  const [inline]
 

Product of all components of this IntVect.

IntVect & IntVect::reflect int  ref_ix,
int  idir
[inline]
 

Modifies IntVect by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir. Directions are based at zero.

IntVect & IntVect::scale int  s  )  [inline]
 

Modifies this IntVect by multiplying each component by a scalar.

void IntVect::setVal int  i,
int  val
[inline]
 

Set i'th coordinate of IntVect to val.

IntVect & IntVect::shift const IntVect iv  )  [inline]
 

Modifies this IntVect by component-wise addition with IntVect argument.

IntVect & IntVect::shift int  coord,
int  s
[inline]
 

Modifies this IntVect by adding s to component in given coordinate direction.

int IntVect::sum  )  const [inline]
 

Sum of all components of this IntVect.


Friends And Related Function Documentation

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.

friend class Box [friend]
 

IntVect coarsen const IntVect p1,
const IntVect p2
[friend]
 

Returns an IntVect which is the component-wise integer projection of IntVect p1 by IntVect p2.

IntVect coarsen const IntVect p,
int  s
[friend]
 

Returns an IntVect that is the component-wise integer projection of p by s.

IntVect diagShift const IntVect p,
int  s
[friend]
 

Returns IntVect obtained by adding a scalar to each of the components of the given IntVect.

friend class FaceIndex [friend]
 

friend class HDF5Handle [friend]
 

IntVect max const IntVect p1,
const IntVect p2
[friend]
 

Returns the IntVect that is the component-wise maximum of two argument IntVects.

IntVect min const IntVect p1,
const IntVect p2
[friend]
 

Returns the IntVect that is the component-wise minimum of two argument IntVects.

IntVect operator * int  s,
const IntVect p
[friend]
 

Returns an IntVect that is an IntVect p with each component multiplied by a scalar s.

IntVect operator+ int  s,
const IntVect p
[friend]
 

Returns an IntVect that is an IntVect p with a scalar s added to each component.

IntVect operator- int  s,
const IntVect p
[friend]
 

Returns s - p.

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 reflect const IntVect a,
int  ref_ix,
int  idir
[friend]
 

Returns an IntVect that is the reflection of the given IntVect in the plane which passes through ref_ix and normal to the coordinate direction idir.

IntVect scale const IntVect p,
int  s
[friend]
 

Returns an IntVect obtained by multiplying each of the components of the given IntVect by a scalar.

friend class VolIndex [friend]
 


Member Data Documentation

const size_t IntVect::IntVectSize [static, protected]
 

Number of bytes of storage used by this IntVect.

const IntVect IntVect::Unit [static]
 

This is an IntVect all of whose components are equal to one.

int IntVect::vect[SpaceDim] [protected]
 

The individual components of this IntVect.

const IntVect IntVect::Zero [static]
 

This is an IntVect all of whose components are equal to zero.


The documentation for this class was generated from the following file:
Generated on Wed Oct 5 12:48:01 2005 for Chombo&AMRIdealMHD by  doxygen 1.4.1