All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Types | Private Attributes | List of all members
Xpetra::EpetraVector Class Reference

#include <Xpetra_EpetraVector.hpp>

Inheritance diagram for Xpetra::EpetraVector:
Xpetra::Vector< double, int, int > Xpetra::EpetraMultiVector Xpetra::MultiVector< double, int, int, Node > Xpetra::MultiVector< double, int, int > Xpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > Xpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > Teuchos::Describable Teuchos::Describable Teuchos::LabeledObject Teuchos::LabeledObject

Private Types

typedef double Scalar
 
typedef int LocalOrdinal
 
typedef int GlobalOrdinal
 
typedef
KokkosClassic::DefaultNode::DefaultNodeType 
Node
 

Private Attributes

const RCP< const
Epetra_MultiVector
internalRefToBaseMV_
 

Constructor/Destructor Methods

 EpetraVector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
 Sets all vector entries to zero. More...
 
 EpetraVector (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source)
 Vector copy constructor. More...
 
virtual ~EpetraVector ()
 Destructor. More...
 

Post-construction modification routines

void replaceGlobalValue (GlobalOrdinal globalRow, const Scalar &value)
 Replace current value at the specified location with specified value. More...
 
void sumIntoGlobalValue (GlobalOrdinal globalRow, const Scalar &value)
 Adds specified value to existing value at the specified location. More...
 
void replaceLocalValue (LocalOrdinal myRow, const Scalar &value)
 Replace current value at the specified location with specified values. More...
 
void sumIntoLocalValue (LocalOrdinal myRow, const Scalar &value)
 Adds specified value to existing value at the specified location. More...
 

Mathematical methods

Scalar dot (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
 Computes dot product of this Vector against input Vector x. More...
 
Teuchos::ScalarTraits< Scalar >
::magnitudeType 
norm1 () const
 Return 1-norm of this Vector. More...
 
Teuchos::ScalarTraits< Scalar >
::magnitudeType 
norm2 () const
 Compute 2-norm of this Vector. More...
 
Teuchos::ScalarTraits< Scalar >
::magnitudeType 
normInf () const
 Compute Inf-norm of this Vector. More...
 
Teuchos::ScalarTraits< Scalar >
::magnitudeType 
normWeighted (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const
 Compute Weighted 2-norm (RMS Norm) of this Vector. More...
 
Scalar meanValue () const
 Compute mean (average) value of this Vector. More...
 

Overridden from Teuchos::Describable

std::string description () const
 Return a simple one-line description of this object. More...
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object. More...
 

Xpetra specific

 EpetraVector (const Teuchos::RCP< Epetra_Vector > &vec)
 EpetraMultiVector constructor to wrap a Epetra_Vector object. More...
 
Epetra_VectorgetEpetra_Vector () const
 Get the underlying Epetra vector. More...
 
 EpetraVector (const RCP< Epetra_MultiVector > &mv, size_t j)
 

Additional Inherited Members

- Public Member Functions inherited from Xpetra::Vector< double, int, int >
virtual ~Vector ()
 Destructor. More...
 
virtual double dot (const Vector< double, int, int, Node > &a) const =0
 Computes dot product of this Vector against input Vector x. More...
 
virtual Teuchos::ScalarTraits
< double >::magnitudeType 
normWeighted (const Vector< double, int, int, Node > &weights) const =0
 Compute Weighted 2-norm (RMS Norm) of this Vector. More...
 
- Public Member Functions inherited from Xpetra::MultiVector< double, int, int, Node >
virtual ~MultiVector ()
 Destructor. More...
 
MultiVector< double, int, int,
Node > & 
operator= (const MultiVector< double, int, int, Node > &rhs)
 Assignment operator: Does a deep copy. More...
 
virtual void replaceGlobalValue (intglobalRow, size_t vectorIndex, const double &value)=0
 Replace value, using global (row) index. More...
 
virtual void sumIntoGlobalValue (intglobalRow, size_t vectorIndex, const double &value)=0
 Add value to existing value, using global (row) index. More...
 
virtual void replaceLocalValue (intmyRow, size_t vectorIndex, const double &value)=0
 Replace value, using local (row) index. More...
 
virtual void sumIntoLocalValue (intmyRow, size_t vectorIndex, const double &value)=0
 Add value to existing value, using local (row) index. More...
 
virtual void putScalar (const double &value)=0
 Set all values in the multivector with the given value. More...
 
virtual Teuchos::RCP< const
Vector< double, int, int, Node > > 
getVector (size_t j) const =0
 Return a Vector which is a const view of column j. More...
 
virtual Teuchos::RCP< Vector
< double, int, int, Node > > 
getVectorNonConst (size_t j)=0
 Return a Vector which is a nonconst view of column j. More...
 
virtual Teuchos::ArrayRCP
< const double > 
getData (size_t j) const =0
 Const view of the local values in a particular vector of this multivector. More...
 
virtual Teuchos::ArrayRCP< double > getDataNonConst (size_t j)=0
 View of the local values in a particular vector of this multivector. More...
 
virtual void dot (const MultiVector< double, int, int, Node > &A, const Teuchos::ArrayView< double > &dots) const =0
 Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]). More...
 
virtual void abs (const MultiVector< double, int, int, Node > &A)=0
 Put element-wise absolute values of input Multi-vector in target: A = abs(this). More...
 
virtual void reciprocal (const MultiVector< double, int, int, Node > &A)=0
 Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j). More...
 
virtual void scale (const double &alpha)=0
 Scale the current values of a multi-vector, this = alpha*this. More...
 
virtual void scale (Teuchos::ArrayView< const double > alpha)=0
 Scale the current values of a multi-vector, this[j] = alpha[j]*this[j]. More...
 
virtual void update (const double &alpha, const MultiVector< double, int, int, Node > &A, const double &beta)=0
 Update multi-vector values with scaled values of A, this = beta*this + alpha*A. More...
 
virtual void update (const double &alpha, const MultiVector< double, int, int, Node > &A, const double &beta, const MultiVector< double, int, int, Node > &B, const double &gamma)=0
 Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B. More...
 
virtual void norm1 (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< double >::magnitudeType > &norms) const =0
 Compute 1-norm of each vector in multi-vector. More...
 
virtual void norm2 (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< double >::magnitudeType > &norms) const =0
 
virtual void normInf (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< double >::magnitudeType > &norms) const =0
 Compute Inf-norm of each vector in multi-vector. More...
 
virtual void normWeighted (const MultiVector< double, int, int, Node > &weights, const Teuchos::ArrayView< typename Teuchos::ScalarTraits< double >::magnitudeType > &norms) const =0
 
virtual void meanValue (const Teuchos::ArrayView< double > &means) const =0
 Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int). More...
 
virtual void multiply (Teuchos::ETransp transA, Teuchos::ETransp transB, const double &alpha, const MultiVector< double, int, int, Node > &A, const MultiVector< double, int, int, Node > &B, const double &beta)=0
 Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B). More...
 
virtual void elementWiseMultiply (doublescalarAB, const Vector< double, int, int, Node > &A, const MultiVector< double, int, int, Node > &B, doublescalarThis)=0
 Element-wise multiply of a Vector A with a MultiVector B. More...
 
virtual size_t getNumVectors () const =0
 Number of columns in the multivector. More...
 
virtual size_t getLocalLength () const =0
 Local number of rows on the calling process. More...
 
virtual global_size_t getGlobalLength () const =0
 Global number of rows in the multivector. More...
 
virtual void replaceMap (const RCP< const Map< int, int, Node > > &map)=0
 
virtual void setSeed (unsigned int seed)=0
 Set seed for Random function. More...
 
virtual void randomize (bool bUseXpetraImplementation=false)=0
 
virtual void Xpetra_randomize ()
 Set multi-vector values to random numbers. XPetra implementation. More...
 
- Public Member Functions inherited from Xpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >
virtual ~DistObject ()
 Destructor. More...
 
virtual void doImport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)=0
 Import data into this object using an Import object ("forward mode"). More...
 
virtual void doExport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)=0
 Export data into this object using an Export object ("forward mode"). More...
 
virtual void doImport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)=0
 Import data into this object using an Export object ("reverse mode"). More...
 
virtual void doExport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)=0
 Export data into this object using an Import object ("reverse mode"). More...
 
- Public Member Functions inherited from Teuchos::Describable
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
- Public Member Functions inherited from Xpetra::EpetraMultiVector
void randomize (bool bUseXpetraImplementation=false)
 Set multi-vector values to random numbers. More...
 
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
getMap () const
 Implements DistObject interface. More...
 
void doImport (const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
 Import. More...
 
void doExport (const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
 Export. More...
 
void doImport (const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
 Import (using an Exporter). More...
 
void doExport (const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
 Export (using an Importer). More...
 
void replaceMap (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
 Replace the underlying Map in place. More...
 
 EpetraMultiVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
 Basic MultiVector constuctor. More...
 
 EpetraMultiVector (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source)
 MultiVector copy constructor. More...
 
 EpetraMultiVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
 Set multi-vector values from array of pointers using Teuchos memory management classes. (copy). More...
 
virtual ~EpetraMultiVector ()
 MultiVector destructor. More...
 
void replaceGlobalValue (GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
 Replace value, using global (row) index. More...
 
void sumIntoGlobalValue (GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
 Add value to existing value, using global (row) index. More...
 
void replaceLocalValue (LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
 Replace value, using local (row) index. More...
 
void sumIntoLocalValue (LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
 Add value to existing value, using local (row) index. More...
 
void putScalar (const Scalar &value)
 Set all values in the multivector with the given value. More...
 
Teuchos::RCP< const Vector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node > > 
getVector (size_t j) const
 Return a Vector which is a const view of column j. More...
 
Teuchos::RCP< Vector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
getVectorNonConst (size_t j)
 Return a Vector which is a nonconst view of column j. More...
 
Teuchos::ArrayRCP< const ScalargetData (size_t j) const
 Const view of the local values in a particular vector of this multivector. More...
 
Teuchos::ArrayRCP< ScalargetDataNonConst (size_t j)
 View of the local values in a particular vector of this multivector. More...
 
void dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
 Compute the dot product of each corresponding pair of vectors (columns) in A and B. More...
 
void abs (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
 Put element-wise absolute values of input Multi-vector in target: A = abs(this). More...
 
void reciprocal (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
 Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j). More...
 
void scale (const Scalar &alpha)
 Scale in place: this = alpha*this. More...
 
void scale (Teuchos::ArrayView< const Scalar > alpha)
 Scale the current values of a multi-vector, this[j] = alpha[j]*this[j]. More...
 
void update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
 Update: this = beta*this + alpha*A. More...
 
void update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &gamma)
 Update: this = gamma*this + alpha*A + beta*B. More...
 
void norm1 (const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
 Compute 1-norm of each vector in multi-vector. More...
 
void norm2 (const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
 
void normInf (const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
 Compute Inf-norm of each vector in multi-vector. More...
 
void normWeighted (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights, const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
 
void meanValue (const Teuchos::ArrayView< Scalar > &means) const
 Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int). More...
 
void multiply (Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta)
 Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B). More...
 
void elementWiseMultiply (Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis)
 Multiply a Vector A elementwise by a MultiVector B. More...
 
size_t getNumVectors () const
 Number of columns in the multivector. More...
 
size_t getLocalLength () const
 Local number of rows on the calling process. More...
 
global_size_t getGlobalLength () const
 Global number of rows in the multivector. More...
 
 EpetraMultiVector (const RCP< Epetra_MultiVector > &vec)
 EpetraMultiVector constructor to wrap a Epetra_MultiVector object. More...
 
RCP< Epetra_MultiVectorgetEpetra_MultiVector () const
 Get the underlying Epetra multivector. More...
 
void setSeed (unsigned int seed)
 Set seed for Random function. More...
 
- Public Member Functions inherited from Xpetra::MultiVector< double, int, int >
virtual ~MultiVector ()
 Destructor. More...
 
MultiVector< double, int, int,
KokkosClassic::DefaultNode::DefaultNodeType > & 
operator= (const MultiVector< double, int, int, KokkosClassic::DefaultNode::DefaultNodeType > &rhs)
 Assignment operator: Does a deep copy. More...
 
virtual void Xpetra_randomize ()
 Set multi-vector values to random numbers. XPetra implementation. More...
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 
- Protected Member Functions inherited from Xpetra::MultiVector< double, int, int, Node >
virtual void assign (const MultiVector< double, int, int, Node > &rhs)=0
 Implementation of the assignment operator (operator=); does a deep copy. More...
 
- Protected Member Functions inherited from Xpetra::EpetraMultiVector
virtual void assign (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
 Implementation of the assignment operator (operator=); does a deep copy. More...
 

Detailed Description

Definition at line 71 of file Xpetra_EpetraVector.hpp.

Member Typedef Documentation

typedef double Xpetra::EpetraVector::Scalar
private

Definition at line 75 of file Xpetra_EpetraVector.hpp.

Definition at line 76 of file Xpetra_EpetraVector.hpp.

Definition at line 77 of file Xpetra_EpetraVector.hpp.

Definition at line 78 of file Xpetra_EpetraVector.hpp.

Constructor & Destructor Documentation

Xpetra::EpetraVector::EpetraVector ( const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
bool  zeroOut = true 
)
explicit

Sets all vector entries to zero.

Xpetra::EpetraVector::EpetraVector ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source)

Vector copy constructor.

virtual Xpetra::EpetraVector::~EpetraVector ( )
inlinevirtual

Destructor.

Definition at line 103 of file Xpetra_EpetraVector.hpp.

Xpetra::EpetraVector::EpetraVector ( const Teuchos::RCP< Epetra_Vector > &  vec)
inline

EpetraMultiVector constructor to wrap a Epetra_Vector object.

Definition at line 162 of file Xpetra_EpetraVector.hpp.

Xpetra::EpetraVector::EpetraVector ( const RCP< Epetra_MultiVector > &  mv,
size_t  j 
)

This constructor creates a Vector which is a view of column j of the MultiVector 'mv'. It implements the logic of MultiVector::getVector/getVectorNonConst() for Epetra MultiVector. The newly created Xpetra::EpetraVector will remain valid after the disappearance of the references to 'mv' in user code.

Definition at line 164 of file Xpetra_EpetraVector.cpp.

Member Function Documentation

void Xpetra::EpetraVector::replaceGlobalValue ( GlobalOrdinal  globalRow,
const Scalar value 
)
virtual

Replace current value at the specified location with specified value.

Implements Xpetra::Vector< double, int, int >.

Definition at line 54 of file Xpetra_EpetraVector.cpp.

void Xpetra::EpetraVector::sumIntoGlobalValue ( GlobalOrdinal  globalRow,
const Scalar value 
)
virtual

Adds specified value to existing value at the specified location.

Implements Xpetra::Vector< double, int, int >.

Definition at line 56 of file Xpetra_EpetraVector.cpp.

void Xpetra::EpetraVector::replaceLocalValue ( LocalOrdinal  myRow,
const Scalar value 
)
virtual

Replace current value at the specified location with specified values.

Implements Xpetra::Vector< double, int, int >.

Definition at line 58 of file Xpetra_EpetraVector.cpp.

void Xpetra::EpetraVector::sumIntoLocalValue ( LocalOrdinal  myRow,
const Scalar value 
)
virtual

Adds specified value to existing value at the specified location.

Implements Xpetra::Vector< double, int, int >.

Definition at line 60 of file Xpetra_EpetraVector.cpp.

double Xpetra::EpetraVector::dot ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  a) const

Computes dot product of this Vector against input Vector x.

Definition at line 62 of file Xpetra_EpetraVector.cpp.

Teuchos::ScalarTraits< double >::magnitudeType Xpetra::EpetraVector::norm1 ( ) const
virtual

Return 1-norm of this Vector.

Implements Xpetra::Vector< double, int, int >.

Definition at line 74 of file Xpetra_EpetraVector.cpp.

Teuchos::ScalarTraits< double >::magnitudeType Xpetra::EpetraVector::norm2 ( ) const
virtual

Compute 2-norm of this Vector.

Implements Xpetra::Vector< double, int, int >.

Definition at line 76 of file Xpetra_EpetraVector.cpp.

Teuchos::ScalarTraits< double >::magnitudeType Xpetra::EpetraVector::normInf ( ) const
virtual

Compute Inf-norm of this Vector.

Implements Xpetra::Vector< double, int, int >.

Definition at line 78 of file Xpetra_EpetraVector.cpp.

Teuchos::ScalarTraits< double >::magnitudeType Xpetra::EpetraVector::normWeighted ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  weights) const

Compute Weighted 2-norm (RMS Norm) of this Vector.

Definition at line 80 of file Xpetra_EpetraVector.cpp.

double Xpetra::EpetraVector::meanValue ( ) const
virtual

Compute mean (average) value of this Vector.

Implements Xpetra::Vector< double, int, int >.

Definition at line 87 of file Xpetra_EpetraVector.cpp.

std::string Xpetra::EpetraVector::description ( ) const
virtual

Return a simple one-line description of this object.

Reimplemented from Xpetra::EpetraMultiVector.

Definition at line 89 of file Xpetra_EpetraVector.cpp.

void Xpetra::EpetraVector::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const
virtual

Print the object with some verbosity level to an FancyOStream object.

Reimplemented from Xpetra::EpetraMultiVector.

Definition at line 99 of file Xpetra_EpetraVector.cpp.

Epetra_Vector* Xpetra::EpetraVector::getEpetra_Vector ( ) const
inline

Get the underlying Epetra vector.

Definition at line 165 of file Xpetra_EpetraVector.hpp.

Member Data Documentation

const RCP<const Epetra_MultiVector> Xpetra::EpetraVector::internalRefToBaseMV_
private

Definition at line 178 of file Xpetra_EpetraVector.hpp.


The documentation for this class was generated from the following files: