NOX  Development
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NOX::MultiVector Class Reference

Default implementation for NOX::Abstract::MultiVector using an array of NOX::Abstract::MultiVector's. More...

#include <NOX_MultiVector.H>

Inheritance diagram for NOX::MultiVector:
Inheritance graph
[legend]
Collaboration diagram for NOX::MultiVector:
Collaboration graph
[legend]

Public Member Functions

 MultiVector (const NOX::Abstract::Vector &v, int numVecs=1, NOX::CopyType type=NOX::DeepCopy)
 Create MultiVector with numVecs columns out of a single NOX::Abstract::Vector.
 
 MultiVector (const NOX::Abstract::Vector *const *vs, int numVecs, NOX::CopyType type=NOX::DeepCopy)
 Create MultiVector out of array of NOX::Abstract::Vector's.
 
 MultiVector (const MultiVector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 
virtual ~MultiVector ()
 Destructor.
 
virtual NOX::size_type length () const
 Return the length of multi-vector.
 
virtual int numVectors () const
 Return the number of vectors in the multi-vector.
 
virtual void print (std::ostream &stream) const
 Print the vector. This is meant for debugging purposes only.
 
virtual NOX::Abstract::MultiVectorinit (double gamma)
 Initialize every element of this multi-vector with gamma.
 
virtual NOX::Abstract::MultiVectorrandom (bool useSeed=false, int seed=1)
 Initialize each element of this multi-vector with a random value.
 
virtual NOX::Abstract::MultiVectoroperator= (const NOX::Abstract::MultiVector &source)
 Copy source multi-vector source into this multi-vector.
 
virtual NOX::Abstract::MultiVectoroperator= (const NOX::MultiVector &source)
 Copy source multi-vector source into this multi-vector.
 
virtual NOX::Abstract::MultiVectorsetBlock (const NOX::Abstract::MultiVector &source, const std::vector< int > &index)
 Copy the vectors in source to a set of vectors in *this. The index.size() vectors in source are copied to a subset of vectors in *this indicated by the indices given in index.
 
virtual NOX::Abstract::MultiVectorsetBlock (const NOX::MultiVector &source, const std::vector< int > &index)
 
virtual NOX::Abstract::MultiVectoraugment (const NOX::Abstract::MultiVector &source)
 Append the vectors in source to *this.
 
virtual NOX::Abstract::MultiVectoraugment (const NOX::MultiVector &source)
 
virtual NOX::Abstract::Vectoroperator[] (int i)
 Return a reference to the i-th column of the multivector as an abstract vector.
 
virtual const NOX::Abstract::Vectoroperator[] (int i) const
 Return a const reference to the i-th column of the multivector as an abstract vector.
 
virtual NOX::Abstract::MultiVectorscale (double gamma)
 Scale each element of this multivector by gamma.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double gamma=0.0)
 Compute x = (alpha * a) + (gamma * x) where a is a multi-vector and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::MultiVector &a, double gamma=0.0)
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double beta, const NOX::Abstract::MultiVector &b, double gamma=0.0)
 Compute x = (alpha * a) + (beta * b) + (gamma * x) where a and b are multi-vectors and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::MultiVector &a, double beta, const NOX::MultiVector &b, double gamma=0.0)
 
virtual NOX::Abstract::MultiVectorupdate (Teuchos::ETransp transb, double alpha, const NOX::Abstract::MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0)
 Compute x = (alpha * a * b) + (gamma * x) where a is a multivector, b is a dense matrix, x = *this, and op(b) = b if transb = Teuchos::NO_TRANS and op(b) is b transpose if transb = Teuchos::TRANS.
 
virtual NOX::Abstract::MultiVectorupdate (Teuchos::ETransp transb, double alpha, const NOX::MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0)
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (NOX::CopyType type=NOX::DeepCopy) const
 Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector. More...
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (int numvecs) const
 Creates a new multi-vector with numvecs columns.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubCopy (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubView (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns that shares the columns of *this given by index.
 
virtual void norm (std::vector< double > &result, NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const
 Norm.
 
virtual void multiply (double alpha, const NOX::Abstract::MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const
 Computes the matrix-matrix product $\alpha * y^T * (*this)$.
 
virtual void multiply (double alpha, const NOX::MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const
 
- Public Member Functions inherited from NOX::Abstract::MultiVector
 MultiVector ()
 Default constructor. Does nothing.
 

Protected Member Functions

 MultiVector (int numvecs)
 Create MultiVector holding numvecs vectors.
 
void checkIndex (int idx) const
 Checks whether an index is valid. Throws an error if invalid.
 
void checkSize (int sz) const
 Checks whether the given multivector size is compatible with this multivector. Throws an error if invalid.
 

Protected Attributes

std::vector< Teuchos::RCP< NOX::Abstract::Vector > > vecs
 Stores pointers to NOX::Abstract::Vector's.
 

Additional Inherited Members

- Public Types inherited from NOX::Abstract::MultiVector
typedef Teuchos::SerialDenseMatrix< int, double > DenseMatrix
 Typename of dense matrices.
 

Detailed Description

Default implementation for NOX::Abstract::MultiVector using an array of NOX::Abstract::MultiVector's.

Member Function Documentation

◆ clone()

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::MultiVector::clone ( NOX::CopyType  type = NOX::DeepCopy) const
virtual

Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector.

If type is NOX::DeepCopy, then we need to create an exact replica of "this". Otherwise, if type is NOX::ShapeCopy, we need only replicate the shape of "this". Note that there is no assumption that a vector created by ShapeCopy is initialized to zeros.

Returns
Pointer to newly created vector or NULL if clone is not supported.

Implements NOX::Abstract::MultiVector.


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