Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
TSFExtended::SerialVector Class Reference

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

Inheritance diagram for TSFExtended::SerialVector:
TSFExtended::IndexableVector< double > TSFExtended::RawDataAccessibleVector< double > Sundance::Printable TSFExtended::LoadableVector< double > TSFExtended::AccessibleVector< double >

List of all members.

Public Member Functions

 SerialVector (const RCP< const VectorSpaceBase< double > > &vs)
 Construct with a smart pointer to a vector space.
VectorBase interface
RCP< const VectorSpaceBase
< double > > 
space () const
void applyOpImpl (const RTOpPack::RTOpT< double > &op, const ArrayView< const Ptr< const VectorBase< double > > > &vecs, const ArrayView< const Ptr< VectorBase< double > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const OrdType global_offset) const
void acquireDetachedVectorViewImpl (const Range1D &rng, RTOpPack::ConstSubVectorView< double > *sub_vec) const
void releaseDetachedVectorViewImpl (RTOpPack::ConstSubVectorView< double > *sub_vec) const
void acquireNonconstDetachedVectorViewImpl (const Range1D &rng, RTOpPack::SubVectorView< double > *sub_vec)
void commitNonconstDetachedVectorViewImpl (RTOpPack::SubVectorView< double > *sub_vec)
IndexableVector interface
virtual const double & operator[] (OrdType globalIndex) const
 read the element at the given global index
virtual double & operator[] (OrdType globalIndex)
 writable access to the element at the given global index
Raw data access interface
virtual const double * dataPtr () const
virtual double * dataPtr ()
LoadableVector interface
void setElement (OrdType globalIndex, const double &value)
 set a single element
void addToElement (OrdType 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 (OrdType globalIndex) const
 get the element at the given global index
void getElements (const OrdType *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 SerialVectorgetConcrete (const Vector< double > &x)
static SerialVectorgetConcrete (Vector< double > &x)

Protected Member Functions

Range1D validateRange (const Range1D &rng) const

Private Attributes

RCP< const
Thyra::VectorSpaceBase< double > > 
vecSpace_
Array< double > data_
int globalDim_
bool in_applyOpImpl_

Detailed Description

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

This class derives from Thyra::VectorDefaultBase, so it can be used seamlessly in any Thyra-based code. If created in SPMD, this will be replicated on all processors.

Definition at line 51 of file TSFSerialVector.hpp.


Constructor & Destructor Documentation

SerialVector::SerialVector ( const RCP< const VectorSpaceBase< double > > &  vs)

Construct with a smart pointer to a vector space.

Definition at line 51 of file TSFSerialVector.cpp.


Member Function Documentation

void SerialVector::acquireDetachedVectorViewImpl ( const Range1D &  rng,
RTOpPack::ConstSubVectorView< double > *  sub_vec 
) const

Definition at line 214 of file TSFSerialVector.cpp.

References data_, globalDim_, and validateRange().

void SerialVector::acquireNonconstDetachedVectorViewImpl ( const Range1D &  rng,
RTOpPack::SubVectorView< double > *  sub_vec 
)

Definition at line 277 of file TSFSerialVector.cpp.

References data_, globalDim_, and validateRange().

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

add to a single element

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 366 of file TSFSerialVector.cpp.

References data_, and Sundance::value.

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

add to a group of elements

Definition at line 396 of file TSFSerialVector.cpp.

References data_.

void SerialVector::applyOpImpl ( const RTOpPack::RTOpT< double > &  op,
const ArrayView< const Ptr< const VectorBase< double > > > &  vecs,
const ArrayView< const Ptr< VectorBase< double > > > &  targ_vecs,
const Ptr< RTOpPack::ReductTarget > &  reduct_obj,
const OrdType  global_offset 
) const

Definition at line 67 of file TSFSerialVector.cpp.

References globalDim_, in_applyOpImpl_, and space().

void SerialVector::commitNonconstDetachedVectorViewImpl ( RTOpPack::SubVectorView< double > *  sub_vec)

Definition at line 318 of file TSFSerialVector.cpp.

References globalDim_.

virtual const double* TSFExtended::SerialVector::dataPtr ( ) const [inline, virtual]
virtual double* TSFExtended::SerialVector::dataPtr ( ) [inline, virtual]
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 TSFExtended::LoadableVector< double >.

Definition at line 419 of file TSFSerialVector.cpp.

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

Definition at line 412 of file TSFSerialVector.cpp.

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

const double & SerialVector::getElement ( OrdType  globalIndex) const [virtual]

get the element at the given global index

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 371 of file TSFSerialVector.cpp.

References data_.

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

Definition at line 376 of file TSFSerialVector.cpp.

References data_.

double & SerialVector::operator[] ( OrdType  globalIndex) [virtual]

writable access to the element at the given global index

Implements TSFExtended::IndexableVector< double >.

Definition at line 356 of file TSFSerialVector.cpp.

References data_.

virtual const double& TSFExtended::SerialVector::operator[] ( OrdType  globalIndex) const [inline, virtual]

read the element at the given global index

Implements TSFExtended::IndexableVector< double >.

Definition at line 97 of file TSFSerialVector.hpp.

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

Print to a stream.

Implements Sundance::Printable.

Definition at line 425 of file TSFSerialVector.cpp.

References data_.

void SerialVector::releaseDetachedVectorViewImpl ( RTOpPack::ConstSubVectorView< double > *  sub_vec) const

Definition at line 256 of file TSFSerialVector.cpp.

References globalDim_.

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

set a single element

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 361 of file TSFSerialVector.cpp.

References data_, and Sundance::value.

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

set a group of elements

Definition at line 387 of file TSFSerialVector.cpp.

References data_.

RCP< const VectorSpaceBase<double> > TSFExtended::SerialVector::space ( ) const [inline]

Definition at line 65 of file TSFSerialVector.hpp.

Referenced by applyOpImpl().

Teuchos::Range1D SerialVector::validateRange ( const Range1D &  rng) const [protected]

Member Data Documentation

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

Definition at line 167 of file TSFSerialVector.hpp.

Referenced by applyOpImpl().

RCP<const Thyra::VectorSpaceBase<double> > TSFExtended::SerialVector::vecSpace_ [private]

Definition at line 161 of file TSFSerialVector.hpp.

Site Contact