Playa::SerialVector Class Reference

Playa implementation of a serial vector, implementing the LoadableVector interface allowing an application to access elements. More...

Inheritance diagram for Playa::SerialVector:

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

List of all members.

Public Member Functions

 SerialVector (const VectorSpace< double > &vs)
 Construct with a vector space.
VectorBase interface
RCP< const VectorSpaceBase
< double > > 
space () const
 Access to the space in which this vector lives.
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.
Diagnostics
std::string description () const
Access through global indices
void getElements (const int *globalIndices, int numElems, Array< double > &elems) const
 get the batch of elements at the given global indices
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.

Static Public Member Functions

static const SerialVectorgetConcrete (const Vector< double > &x)
static SerialVectorgetConcrete (Vector< double > &x)

Private Attributes

VectorSpace< double > vecSpace_
Array< double > data_
int dim_


Detailed Description

Playa implementation of a serial vector, implementing the LoadableVector interface allowing an application to access elements.

If created in SPMD, this will be replicated on all processors.

Definition at line 26 of file PlayaSerialVector.hpp.


Constructor & Destructor Documentation

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

Construct with a vector space.

Definition at line 18 of file PlayaSerialVector.cpp.

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


Member Function Documentation

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

add to a single element

Implements Playa::LoadableVector< double >.

Definition at line 37 of file PlayaSerialVector.cpp.

References data_.

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

add to a group of elements

Reimplemented from Playa::LoadableVector< double >.

Definition at line 51 of file PlayaSerialVector.cpp.

References data_.

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

Size of the (single) chunk of data values.

Implements Playa::SingleChunkVector< double >.

Definition at line 91 of file PlayaSerialVector.hpp.

References dim_.

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

Implements Playa::SingleChunkVector< double >.

Definition at line 88 of file PlayaSerialVector.hpp.

References data_.

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

std::string SerialVector::description (  )  const

Definition at line 89 of file PlayaSerialVector.cpp.

References dim_.

void SerialVector::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 74 of file PlayaSerialVector.cpp.

SerialVector * SerialVector::getConcrete ( Vector< double > &  x  )  [static]

Definition at line 67 of file PlayaSerialVector.cpp.

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

const SerialVector * SerialVector::getConcrete ( const Vector< double > &  x  )  [static]

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

get the batch of elements at the given global indices

Definition at line 79 of file PlayaSerialVector.cpp.

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

set a single element

Implements Playa::LoadableVector< double >.

Definition at line 32 of file PlayaSerialVector.cpp.

References data_.

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

set a group of elements

Reimplemented from Playa::LoadableVector< double >.

Definition at line 42 of file PlayaSerialVector.cpp.

References data_.

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

Access to the space in which this vector lives.

Implements Playa::VectorBase< double >.

Definition at line 38 of file PlayaSerialVector.hpp.

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


Member Data Documentation

Array<double> Playa::SerialVector::data_ [private]

Definition at line 101 of file PlayaSerialVector.hpp.

Referenced by addToElement(), addToElements(), dataPtr(), setElement(), and setElements().

Definition at line 103 of file PlayaSerialVector.hpp.

Referenced by chunkSize(), and description().

Definition at line 99 of file PlayaSerialVector.hpp.

Referenced by space().

Site Contact