NOX::Thyra::MultiVector Class Reference

Implementation of NOX::Abstract::MultiVector for Thyra multi-vectors. More...

#include <NOX_Thyra_MultiVector.H>

Inheritance diagram for NOX::Thyra::MultiVector:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MultiVector (const Teuchos::RCP< ::Thyra::MultiVectorBase< double > > &source)
 Constructor that creates a VIEW of the Thyra multivector.
 MultiVector (const ::Thyra::MultiVectorBase< double > &source)
 Construct from a given Thyra multivector.
 MultiVector (const NOX::Thyra::MultiVector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 ~MultiVector ()
 Destruct MultiVector.
virtual int 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 Teuchos::RCP
< ::Thyra::MultiVectorBase
< double > > 
getThyraMultiVector ()
 Get RCP to underlying Thyra vector.
virtual Teuchos::RCP< const
::Thyra::MultiVectorBase
< double > > 
getThyraMultiVector () const
 Get const RCP to underlying Thyra vector.
virtual
NOX::Abstract::MultiVector
init (double value)
 Initialize every element of this multi-vector with gamma.
virtual
NOX::Abstract::MultiVector
random (bool useSeed=false, int seed=1)
 Initialize each element of this multi-vector with a random value.
virtual
NOX::Abstract::MultiVector
operator= (const NOX::Abstract::MultiVector &source)
 Copy source multi-vector source into this multi-vector.
virtual
NOX::Abstract::MultiVector
setBlock (const NOX::Abstract::MultiVector &source, const 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::MultiVector
augment (const NOX::Abstract::MultiVector &source)
 Append the vectors in source to *this.
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::Vector
operator[] (int i) const
 Return a const reference to the i-th column of the multivector as an abstract vector.
virtual
NOX::Abstract::MultiVector
scale (double gamma)
 Scale each element of this multivector by gamma.
virtual
NOX::Abstract::MultiVector
update (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::MultiVector
update (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::MultiVector
update (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 Teuchos::RCP
< NOX::Abstract::MultiVector
clone (CopyType type=DeepCopy) const
 Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector.
virtual Teuchos::RCP
< NOX::Abstract::MultiVector
clone (int numvecs) const
 Creates a new multi-vector with numvecs columns.
virtual Teuchos::RCP
< NOX::Abstract::MultiVector
subCopy (const 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::MultiVector
subView (const vector< int > &index) const
 Creates a new multi-vector with ndex.size() columns that shares the columns of *this given by index.
virtual void norm (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)$.

Protected Member Functions

bool isContiguous (const vector< int > &index) const
 Check whether an index array is contiguous.

Protected Attributes

Teuchos::RCP
< ::Thyra::MultiVectorBase
< double > > 
thyraMultiVec
 Pointer to petra vector owned by this object.
std::vector< Teuchos::RCP
< NOX::Thyra::Vector > > 
noxThyraVectors
 NOX::Thyra::Vector's for each column of the multivector.


Detailed Description

Implementation of NOX::Abstract::MultiVector for Thyra multi-vectors.

Definition at line 64 of file NOX_Thyra_MultiVector.H.


Constructor & Destructor Documentation

NOX::Thyra::MultiVector::MultiVector ( const Teuchos::RCP< ::Thyra::MultiVectorBase< double > > &  source  ) 

Constructor that creates a VIEW of the Thyra multivector.

Definition at line 49 of file NOX_Thyra_MultiVector.C.

NOX::Thyra::MultiVector::MultiVector ( const ::Thyra::MultiVectorBase< double > &  source  ) 

Construct from a given Thyra multivector.

Definition at line 57 of file NOX_Thyra_MultiVector.C.

NOX::Thyra::MultiVector::MultiVector ( const NOX::Thyra::MultiVector source,
NOX::CopyType  type = NOX::DeepCopy 
)

Copy constructor.

Definition at line 64 of file NOX_Thyra_MultiVector.C.

NOX::Thyra::MultiVector::~MultiVector (  )  [virtual]

Destruct MultiVector.

Reimplemented from NOX::Abstract::MultiVector.

Definition at line 71 of file NOX_Thyra_MultiVector.C.


Member Function Documentation

Teuchos::RCP<::Thyra::MultiVectorBase< double > > NOX::Thyra::MultiVector::getThyraMultiVector (  )  [virtual]

Teuchos::RCP< const ::Thyra::MultiVectorBase< double > > NOX::Thyra::MultiVector::getThyraMultiVector (  )  const [virtual]

Get const RCP to underlying Thyra vector.

Definition at line 94 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::init ( double  value  )  [virtual]

Initialize every element of this multi-vector with gamma.

Implements NOX::Abstract::MultiVector.

Definition at line 101 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::random ( bool  useSeed = false,
int  seed = 1 
) [virtual]

Initialize each element of this multi-vector with a random value.

Implements NOX::Abstract::MultiVector.

Definition at line 109 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::operator= ( const NOX::Abstract::MultiVector source  )  [virtual]

Copy source multi-vector source into this multi-vector.

Implements NOX::Abstract::MultiVector.

Definition at line 77 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::setBlock ( const NOX::Abstract::MultiVector source,
const vector< int > &  index 
) [virtual]

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.

Implements NOX::Abstract::MultiVector.

Definition at line 119 of file NOX_Thyra_MultiVector.C.

References isContiguous(), and thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::augment ( const NOX::Abstract::MultiVector source  )  [virtual]

Append the vectors in source to *this.

Implements NOX::Abstract::MultiVector.

Definition at line 140 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::Vector & NOX::Thyra::MultiVector::operator[] ( int  i  )  [virtual]

Return a reference to the i-th column of the multivector as an abstract vector.

Implements NOX::Abstract::MultiVector.

Definition at line 172 of file NOX_Thyra_MultiVector.C.

References noxThyraVectors, and thyraMultiVec.

const NOX::Abstract::Vector & NOX::Thyra::MultiVector::operator[] ( int  i  )  const [virtual]

Return a const reference to the i-th column of the multivector as an abstract vector.

Implements NOX::Abstract::MultiVector.

Definition at line 182 of file NOX_Thyra_MultiVector.C.

References noxThyraVectors, and thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::scale ( double  gamma  )  [virtual]

Scale each element of this multivector by gamma.

Implements NOX::Abstract::MultiVector.

Definition at line 192 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::update ( double  alpha,
const NOX::Abstract::MultiVector a,
double  gamma = 0.0 
) [virtual]

Compute x = (alpha * a) + (gamma * x) where a is a multi-vector and x = *this.

Implements NOX::Abstract::MultiVector.

Definition at line 200 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::update ( double  alpha,
const NOX::Abstract::MultiVector a,
double  beta,
const NOX::Abstract::MultiVector b,
double  gamma = 0.0 
) [virtual]

Compute x = (alpha * a) + (beta * b) + (gamma * x) where a and b are multi-vectors and x = *this.

Implements NOX::Abstract::MultiVector.

Definition at line 211 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

NOX::Abstract::MultiVector & NOX::Thyra::MultiVector::update ( Teuchos::ETransp  transb,
double  alpha,
const NOX::Abstract::MultiVector a,
const NOX::Abstract::MultiVector::DenseMatrix b,
double  gamma = 0.0 
) [virtual]

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.

Implements NOX::Abstract::MultiVector.

Definition at line 230 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Thyra::MultiVector::clone ( CopyType  type = 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.

Definition at line 264 of file NOX_Thyra_MultiVector.C.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Thyra::MultiVector::clone ( int  numvecs  )  const [virtual]

Creates a new multi-vector with numvecs columns.

Implements NOX::Abstract::MultiVector.

Definition at line 271 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Thyra::MultiVector::subCopy ( const vector< int > &  index  )  const [virtual]

Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.

Implements NOX::Abstract::MultiVector.

Definition at line 280 of file NOX_Thyra_MultiVector.C.

References isContiguous(), and thyraMultiVec.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Thyra::MultiVector::subView ( const vector< int > &  index  )  const [virtual]

Creates a new multi-vector with ndex.size() columns that shares the columns of *this given by index.

Implements NOX::Abstract::MultiVector.

Definition at line 294 of file NOX_Thyra_MultiVector.C.

References isContiguous(), and thyraMultiVec.

void NOX::Thyra::MultiVector::norm ( vector< double > &  result,
NOX::Abstract::Vector::NormType  type = NOX::Abstract::Vector::TwoNorm 
) const [virtual]

void NOX::Thyra::MultiVector::multiply ( double  alpha,
const NOX::Abstract::MultiVector y,
NOX::Abstract::MultiVector::DenseMatrix b 
) const [virtual]

Computes the matrix-matrix product $\alpha * y^T * (*this)$.

Implements NOX::Abstract::MultiVector.

Definition at line 320 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

int NOX::Thyra::MultiVector::length (  )  const [virtual]

Return the length of multi-vector.

Implements NOX::Abstract::MultiVector.

Definition at line 340 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

int NOX::Thyra::MultiVector::numVectors (  )  const [virtual]

Return the number of vectors in the multi-vector.

Implements NOX::Abstract::MultiVector.

Definition at line 347 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

void NOX::Thyra::MultiVector::print ( std::ostream &  stream  )  const [virtual]

Print the vector. This is meant for debugging purposes only.

Implements NOX::Abstract::MultiVector.

Definition at line 354 of file NOX_Thyra_MultiVector.C.

References thyraMultiVec.

bool NOX::Thyra::MultiVector::isContiguous ( const vector< int > &  index  )  const [protected]

Check whether an index array is contiguous.

Definition at line 363 of file NOX_Thyra_MultiVector.C.

Referenced by setBlock(), subCopy(), and subView().


Member Data Documentation

Teuchos::RCP< ::Thyra::MultiVectorBase<double> > NOX::Thyra::MultiVector::thyraMultiVec [protected]

Pointer to petra vector owned by this object.

Definition at line 250 of file NOX_Thyra_MultiVector.H.

Referenced by augment(), clone(), getThyraMultiVector(), init(), length(), multiply(), norm(), numVectors(), operator=(), operator[](), print(), random(), scale(), setBlock(), subCopy(), subView(), and update().

std::vector< Teuchos::RCP<NOX::Thyra::Vector> > NOX::Thyra::MultiVector::noxThyraVectors [mutable, protected]

NOX::Thyra::Vector's for each column of the multivector.

Each Thyra_Vector in the NOX::Thyra::Vector has a view into a column of the multivector and get filled in as needed by operator[].

Definition at line 257 of file NOX_Thyra_MultiVector.H.

Referenced by operator[]().


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

Generated on Thu Dec 17 11:03:10 2009 for Nonlinear Solver Project by  doxygen 1.5.9