Playa::EpetraVector Class Reference

Playa::VectorBase wrapper for Epetra_Vector. More...

Inheritance diagram for Playa::EpetraVector:

Playa::SingleChunkVector< double > Playa::LoadableVector< double > Playa::Printable Playa::VectorBase< double >

List of all members.

Public Member Functions

 EpetraVector (const VectorSpace< double > &vs)
 Construct with an Epetra vector space.
 EpetraVector (const VectorSpace< double > &vs, const RCP< Epetra_Vector > &vec)
 Construct with an Epetra vector space and an existing Epetra vector.
const RCP< Epetra_Vector > & epetraVec () const
RCP< Epetra_Vector > & epetraVec ()
virtual void update (const double &alpha, const VectorBase< double > *other, const double &gamma)
 Carry out the operation (*this) = gamma*(*this) + alpha*x ;.
virtual void update (const double &alpha, const VectorBase< double > *x, const double &beta, const VectorBase< double > *y, const double &gamma)
 Carry out the operation (*this) = gamma*(*this) + alpha*x + beta*y;.
virtual double dot (const VectorBase< double > *other) const
virtual double norm2 () const
VectorBase interface
RCP< const VectorSpaceBase
< double > > 
space () const
 Return the space in which this vector lives.
IndexableVector interface
virtual const double & operator[] (int globalIndex) const
 read the element at the given global index
virtual double & operator[] (int globalIndex)
 writable access to the element at the given global index
LoadableVector interface
void setElement (int globalIndex, const double &value)
 set a single element
void addToElement (int globalIndex, const double &value)
 add to a single element
void setElements (int numElems, const int *globalIndices, const double *values)
 set a group of elements
void addToElements (int numElems, const int *globalIndices, const double *values)
 add to a group of elements
void finalizeAssembly ()
 Do whatever finalization steps are needed by the implementation, for instance, synchronizing border elements.
AccessibleVector interface
const double & getElement (int globalIndex) const
void getElements (const int *globalIndices, int numElems, Teuchos::Array< double > &elems) const
Printable interface
void print (std::ostream &os) const
 Print to a stream.

Static Public Member Functions

static const Epetra_Vector & getConcrete (const Playa::Vector< double > &tsfVec)
 Get a read-only Epetra_Vector.
static Epetra_Vector & getConcrete (Playa::Vector< double > &tsfVec)
 Get a read-write Epetra_Vector.
static Epetra_Vector * getConcretePtr (Playa::Vector< double > &tsfVec)
 Get a read-write Epetra_Vector pointer.

Protected Member Functions

Single chunk data access interface
virtual const double * dataPtr () const
virtual double * dataPtr ()
virtual int chunkSize () const
 Size of the (single) chunk of data values.

Private Attributes

VectorSpace< double > vecSpace_
RCP< Epetra_Vector > epetraVec_
int numLocalElements_


Detailed Description

Playa::VectorBase wrapper for Epetra_Vector.

Definition at line 24 of file PlayaEpetraVector.hpp.


Constructor & Destructor Documentation

EpetraVector::EpetraVector ( const VectorSpace< double > &  vs  ) 

Construct with an Epetra vector space.

Definition at line 17 of file PlayaEpetraVector.cpp.

References Playa::EpetraVectorSpace::epetraMap(), epetraVec_, and Playa::Handle< PointerType >::ptr().

EpetraVector::EpetraVector ( const VectorSpace< double > &  vs,
const RCP< Epetra_Vector > &  vec 
)

Construct with an Epetra vector space and an existing Epetra vector.

Definition at line 35 of file PlayaEpetraVector.cpp.

References Playa::Handle< PointerType >::ptr().


Member Function Documentation

void EpetraVector::addToElement ( int  globalIndex,
const double &  value 
) [virtual]

add to a single element

Implements Playa::LoadableVector< double >.

Definition at line 66 of file PlayaEpetraVector.cpp.

References epetraVec().

void EpetraVector::addToElements ( int  numElems,
const int *  globalIndices,
const double *  values 
) [virtual]

add to a group of elements

Reimplemented from Playa::LoadableVector< double >.

Definition at line 102 of file PlayaEpetraVector.cpp.

References epetraVec().

virtual int Playa::EpetraVector::chunkSize (  )  const [inline, protected, virtual]

Size of the (single) chunk of data values.

Implements Playa::SingleChunkVector< double >.

Definition at line 135 of file PlayaEpetraVector.hpp.

References numLocalElements_.

virtual double* Playa::EpetraVector::dataPtr (  )  [inline, protected, virtual]

Implements Playa::SingleChunkVector< double >.

Definition at line 132 of file PlayaEpetraVector.hpp.

References epetraVec_.

virtual const double* Playa::EpetraVector::dataPtr (  )  const [inline, protected, virtual]

Implements Playa::SingleChunkVector< double >.

Definition at line 130 of file PlayaEpetraVector.hpp.

References epetraVec_.

double EpetraVector::dot ( const VectorBase< double > *  other  )  const [virtual]

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 181 of file PlayaEpetraVector.cpp.

References epetraVec_.

RCP<Epetra_Vector>& Playa::EpetraVector::epetraVec (  )  [inline]

Definition at line 99 of file PlayaEpetraVector.hpp.

References epetraVec_.

const RCP<Epetra_Vector>& Playa::EpetraVector::epetraVec (  )  const [inline]

void EpetraVector::finalizeAssembly (  )  [virtual]

Do whatever finalization steps are needed by the implementation, for instance, synchronizing border elements.

The default implementation is a no-op.

Reimplemented from Playa::LoadableVector< double >.

Definition at line 111 of file PlayaEpetraVector.cpp.

References epetraVec().

Epetra_Vector & EpetraVector::getConcrete ( Playa::Vector< double > &  tsfVec  )  [static]

Get a read-write Epetra_Vector.

Definition at line 134 of file PlayaEpetraVector.cpp.

References epetraVec(), and Playa::Handle< PointerType >::ptr().

const Epetra_Vector & EpetraVector::getConcrete ( const Playa::Vector< double > &  tsfVec  )  [static]

Epetra_Vector * EpetraVector::getConcretePtr ( Playa::Vector< double > &  tsfVec  )  [static]

Get a read-write Epetra_Vector pointer.

Definition at line 145 of file PlayaEpetraVector.cpp.

References epetraVec(), and Playa::Handle< PointerType >::ptr().

Referenced by Playa::getEpetraDiagonal(), Playa::AztecSolver::solve(), and Playa::AmesosSolver::solve().

const double & EpetraVector::getElement ( int  globalIndex  )  const

Definition at line 74 of file PlayaEpetraVector.cpp.

References epetraVec().

Referenced by operator[]().

void EpetraVector::getElements ( const int *  globalIndices,
int  numElems,
Teuchos::Array< double > &  elems 
) const

Definition at line 80 of file PlayaEpetraVector.cpp.

References epetraVec().

double EpetraVector::norm2 (  )  const [virtual]

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 191 of file PlayaEpetraVector.cpp.

References epetraVec_.

double & EpetraVector::operator[] ( int  globalIndex  )  [virtual]

writable access to the element at the given global index

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 53 of file PlayaEpetraVector.cpp.

References epetraVec().

virtual const double& Playa::EpetraVector::operator[] ( int  globalIndex  )  const [inline, virtual]

read the element at the given global index

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 49 of file PlayaEpetraVector.hpp.

References getElement().

void EpetraVector::print ( std::ostream &  os  )  const [virtual]

Print to a stream.

Implements Playa::Printable.

Definition at line 118 of file PlayaEpetraVector.cpp.

References epetraVec().

void EpetraVector::setElement ( int  globalIndex,
const double &  value 
) [virtual]

set a single element

Implements Playa::LoadableVector< double >.

Definition at line 59 of file PlayaEpetraVector.cpp.

References epetraVec().

void EpetraVector::setElements ( int  numElems,
const int *  globalIndices,
const double *  values 
) [virtual]

set a group of elements

Reimplemented from Playa::LoadableVector< double >.

Definition at line 93 of file PlayaEpetraVector.cpp.

References epetraVec().

RCP< const VectorSpaceBase<double> > Playa::EpetraVector::space (  )  const [inline, virtual]

Return the space in which this vector lives.

Implements Playa::VectorBase< double >.

Definition at line 43 of file PlayaEpetraVector.hpp.

References Playa::Handle< PointerType >::ptr(), and vecSpace_.

void EpetraVector::update ( const double &  alpha,
const VectorBase< double > *  x,
const double &  beta,
const VectorBase< double > *  y,
const double &  gamma 
) [virtual]

Carry out the operation (*this) = gamma*(*this) + alpha*x + beta*y;.

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 166 of file PlayaEpetraVector.cpp.

References epetraVec_.

void EpetraVector::update ( const double &  alpha,
const VectorBase< double > *  x,
const double &  gamma 
) [virtual]

Carry out the operation (*this) = gamma*(*this) + alpha*x ;.

Reimplemented from Playa::SingleChunkVector< double >.

Definition at line 156 of file PlayaEpetraVector.cpp.

References epetraVec_.


Member Data Documentation

RCP<Epetra_Vector> Playa::EpetraVector::epetraVec_ [private]

Definition at line 142 of file PlayaEpetraVector.hpp.

Referenced by dataPtr(), dot(), epetraVec(), EpetraVector(), norm2(), and update().

Definition at line 144 of file PlayaEpetraVector.hpp.

Referenced by chunkSize().

Definition at line 140 of file PlayaEpetraVector.hpp.

Referenced by space().

Site Contact