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

RealVect Class Reference

A Real vector in SpaceDim-dimensional space. More...

#include <RealVect.H>

Collaboration diagram for RealVect:

Collaboration graph
[legend]
List of all members.

Constants

static const RealVect Zero
static const RealVect Unit
RealVect BASISREALV (int dir)

Public Member Functions

Constructors and Accessors
 RealVect ()
 RealVect (D_DECL(Real i, Real j, Real k))
 RealVect (const RealVect &rhs)
 RealVect (const IntVect &iv)
RealVectoperator= (const RealVect &rhs)
Realoperator[] (int i)
const Realoperator[] (int i) const
Comparison Operators
bool operator== (const RealVect &p) const
bool operator!= (const RealVect &p) const
bool operator< (const RealVect &p) const
bool operator<= (const RealVect &p) const
bool operator> (const RealVect &p) const
bool operator>= (const RealVect &p) const
bool lexLT (const RealVect &s) const
bool lexGT (const RealVect &s) const
Arithmetic Operators
RealVectoperator+= (Real s)
RealVectoperator+= (const RealVect &p)
RealVectoperator-= (Real s)
RealVectoperator-= (const RealVect &p)
RealVect operator- (Real s) const
RealVectoperator *= (Real s)
Real dotProduct (const RealVect &a_rhs) const
RealVectoperator *= (const RealVect &p)
RealVect operator * (Real s) const
RealVectoperator/= (Real s)
RealVectoperator/= (const RealVect &p)
RealVect operator/ (Real s) const
RealVectscale (Real s)
Unary operators
RealVect operator+ () const
RealVect operator- () const
Real sum () const
Real product () const
Data pointer functions
const RealdataPtr () const
RealdataPtr ()

Static Public Attributes

static size_t io_offset

Protected Attributes

Real vect [SpaceDim]

Friends

class HDF5Handle
std::ostream & operator<< (std::ostream &ostr, const RealVect &p)
Arithmetic friend functions
RealVect operator+ (Real s, const RealVect &p)
RealVect operator- (Real s, const RealVect &p)
RealVect operator * (Real s, const RealVect &p)
RealVect operator/ (Real s, const RealVect &p)
RealVect operator+ (const RealVect &s, const RealVect &p)
RealVect operator- (const RealVect &s, const RealVect &p)
RealVect operator * (const RealVect &s, const RealVect &p)
RealVect operator/ (const RealVect &s, const RealVect &p)
RealVect scale (const RealVect &p, Real s)

Detailed Description

A Real vector in SpaceDim-dimensional space.

The class RealVect is an implementation of a Real vector in a SpaceDim-dimensional space. RealVect 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

RealVect::RealVect  ) 
 

Construct a RealVect whose components are zero.

RealVect::RealVect D_DECL(Real i, Real j, Real k)   ) 
 

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

RealVect::RealVect const RealVect rhs  )  [inline]
 

The copy constructor.

RealVect::RealVect const IntVect iv  )  [inline]
 

Construct a RealVect from an IntVect by coercing each component from int to Real.


Member Function Documentation

Real* RealVect::dataPtr  ) 
 

Only for sending stuff to Fortran

const Real* RealVect::dataPtr  )  const
 

Only for sending stuff to Fortran

Real RealVect::dotProduct const RealVect a_rhs  )  const
 

bool RealVect::lexGT const RealVect s  )  const [inline]
 

Returns true if this RealVect is lexically greater than the argument. An RealVect MUST BE either lexically less than, lexically greater than, or equal to another RealVect.

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 RealVect::lexLT const RealVect s  )  const [inline]
 

Returns true if this RealVect is lexically less than the argument. An RealVect MUST BE either lexically less than, lexically greater than, or equal to another RealVect.

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

RealVect RealVect::operator * Real  s  )  const
 

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

RealVect& RealVect::operator *= const RealVect p  ) 
 

Modifies this RealVect by component-wise multiplication by argument.

RealVect& RealVect::operator *= Real  s  ) 
 

Modifies this RealVect by multiplying each component by a scalar.

bool RealVect::operator!= const RealVect p  )  const
 

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

RealVect RealVect::operator+  )  const [inline]
 

Unary plus -- for completeness.

RealVect& RealVect::operator+= const RealVect p  ) 
 

Modifies this RealVect by component-wise addition by argument.

RealVect& RealVect::operator+= Real  s  ) 
 

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

RealVect RealVect::operator-  )  const [inline]
 

Unary minus -- negates all components of this RealVect.

RealVect RealVect::operator- Real  s  )  const
 

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

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

Modifies this RealVect by component-wise subtraction by argument.

RealVect& RealVect::operator-= Real  s  ) 
 

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

RealVect RealVect::operator/ Real  s  )  const
 

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

RealVect& RealVect::operator/= const RealVect p  ) 
 

Modifies this RealVect by component-wise division by argument.

RealVect& RealVect::operator/= Real  s  ) 
 

Modifies this RealVect by dividing each component by a scalar.

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

Returns true if this RealVect is less than argument RealVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVect to be neither greater than, less than, nor equal to another.

bool RealVect::operator<= const RealVect p  )  const [inline]
 

Returns true if this RealVect is less than or equal to argument RealVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVect to be neither greater than or equal to, less than or equal to, nor equal to another.

RealVect& RealVect::operator= const RealVect rhs  ) 
 

The assignment operator.

bool RealVect::operator== const RealVect p  )  const
 

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

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

Returns true if this RealVect is greater than argument RealVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVect to be neither greater than, less than, nor equal to another.

bool RealVect::operator>= const RealVect p  )  const [inline]
 

Returns true if this RealVect is greater than or equal to argument RealVect. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVect to be neither greater than or equal to, less than or equal to, nor equal to another.

const Real & RealVect::operator[] int  i  )  const [inline]
 

Returns the i'th coordinate of the RealVect.

Real & RealVect::operator[] int  i  )  [inline]
 

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

Real RealVect::product  )  const [inline]
 

Product of all components of this RealVect.

RealVect & RealVect::scale Real  s  )  [inline]
 

Modifies this RealVect by multiplying each component by a scalar.

Real RealVect::sum  )  const [inline]
 

Sum of all components of this RealVect.


Friends And Related Function Documentation

RealVect BASISREALV int  dir  )  [friend]
 

Returns a basis vector in the given coordinate direction.
In 2-D:
BASISREALV(0) == (1.,0.); BASISREALV(1) == (0.,1.).
In 3-D:
BASISREALV(0) == (1.,0.,0.); BASISREALV(1) == (0.,1.,0.); BASISREALV(2) == (0.,0.,1.).
Note that the coordinate directions are based at zero.

friend class HDF5Handle [friend]
 

RealVect operator * const RealVect s,
const RealVect p
[friend]
 

Returns component-wise product of s and p.

RealVect operator * Real  s,
const RealVect p
[friend]
 

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

RealVect operator+ const RealVect s,
const RealVect p
[friend]
 

Returns component-wise sum of RealVects s and p.

RealVect operator+ Real  s,
const RealVect p
[friend]
 

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

RealVect operator- const RealVect s,
const RealVect p
[friend]
 

Returns s - p.

RealVect operator- Real  s,
const RealVect p
[friend]
 

Returns s - p.

RealVect operator/ const RealVect s,
const RealVect p
[friend]
 

Returns component-wise quotient p / s.

RealVect operator/ Real  s,
const RealVect p
[friend]
 

Returns a RealVect that is a RealVect p with each component divided by a scalar s.

std::ostream& operator<< std::ostream &  ostr,
const RealVect p
[friend]
 

Print to the given output stream in ASCII.

RealVect scale const RealVect p,
Real  s
[friend]
 

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


Member Data Documentation

size_t RealVect::io_offset [static]
 

const RealVect RealVect::Unit [static]
 

This is a RealVect all of whose components are equal to one.

Real RealVect::vect[SpaceDim] [protected]
 

The individual components of this RealVect.

const RealVect RealVect::Zero [static]
 

This is a RealVect all of whose components are equal to zero.


The documentation for this class was generated from the following file:
Generated on Wed Oct 5 14:02:14 2005 for Chombo&AMRSelfGravity by  doxygen 1.4.1