TSF implementation of a serial vector, implementing the LoadableVector interface allowing an application to access elements. More...
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 SerialVector * | getConcrete (const Vector< double > &x) |
| static SerialVector * | getConcrete (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_ |
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.
| 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.
| 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 | ||
| ) |
| 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] |
Implements TSFExtended::RawDataAccessibleVector< double >.
Definition at line 107 of file TSFSerialVector.hpp.
Referenced by TSFExtended::DenseSerialMatrix::applyOp(), TSFExtended::denseSolve(), and TSFExtended::denseSVD().
| virtual double* TSFExtended::SerialVector::dataPtr | ( | ) | [inline, virtual] |
Implements TSFExtended::RawDataAccessibleVector< double >.
Definition at line 109 of file TSFSerialVector.hpp.
| 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] |
Definition at line 405 of file TSFSerialVector.cpp.
References Sundance::Handle< PointerType >::ptr().
Referenced by TSFExtended::DenseSerialMatrix::applyOp().
| 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 | ||
| ) |
| 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] |
Definition at line 340 of file TSFSerialVector.cpp.
References globalDim_.
Referenced by acquireDetachedVectorViewImpl(), and acquireNonconstDetachedVectorViewImpl().
Array<double> TSFExtended::SerialVector::data_ [private] |
Definition at line 163 of file TSFSerialVector.hpp.
Referenced by acquireDetachedVectorViewImpl(), acquireNonconstDetachedVectorViewImpl(), addToElement(), addToElements(), getElement(), getElements(), operator[](), print(), setElement(), and setElements().
int TSFExtended::SerialVector::globalDim_ [private] |
Definition at line 165 of file TSFSerialVector.hpp.
Referenced by acquireDetachedVectorViewImpl(), acquireNonconstDetachedVectorViewImpl(), applyOpImpl(), commitNonconstDetachedVectorViewImpl(), releaseDetachedVectorViewImpl(), and validateRange().
bool TSFExtended::SerialVector::in_applyOpImpl_ [mutable, 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.