LOCA::Extended::MultiVector Class Reference

Implemenatation of the NOX::Abstract::MultiVector class for extended multi-vectors comprised of an arbitrary number of multi-vectors and scalars. More...

#include <LOCA_Extended_MultiVector.H>

Inheritance diagram for LOCA::Extended::MultiVector:

[legend]
Collaboration diagram for LOCA::Extended::MultiVector:
[legend]
List of all members.

Public Member Functions

 MultiVector (const MultiVector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 MultiVector (const MultiVector &source, int nColumns)
 Copy constructor that creates a new multivector with nColumns columns.
 MultiVector (const MultiVector &source, const vector< int > &index, bool view)
 Copy constructor that creates a sub copy or view of the given multivector.
virtual ~MultiVector ()
 Vector destructor.
Implementation of NOX::Abstract::MultiVector methods.
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 MultiVectoroperator= (const MultiVector &y)
 Copy source multi-vector source into this multi-vector.
virtual NOX::Abstract::MultiVectorsetBlock (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::MultiVectorsetBlock (const MultiVector &source, const vector< int > &index)
virtual NOX::Abstract::MultiVectoraugment (const NOX::Abstract::MultiVector &source)
 Append the vectors in source to *this.
virtual NOX::Abstract::MultiVectoraugment (const 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 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 MultiVector &a, double beta, const 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 MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0)
virtual NOX::Abstract::MultiVectorclone (NOX::CopyType type=NOX::DeepCopy) const
 Create a new MultiVector of the same underlying type by cloning "this", and return a pointer to the new vector.
virtual NOX::Abstract::MultiVectorclone (int numvecs) const
 Creates a new multi-vector with numvecs columns.
virtual NOX::Abstract::MultiVectorsubCopy (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 NOX::Abstract::MultiVectorsubView (const 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 (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 MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const
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 () const
 Print the vector. This is meant for debugging purposes only.
Additional public accessor methods
virtual const NOX::Abstract::MultiVectorgetMultiVector (int i) const
 Returns const reference to the ith multi-vector.
virtual NOX::Abstract::MultiVectorgetMultiVector (int i)
 Returns reference to the ith multi-vector.
virtual const NOX::Abstract::MultiVector::DenseMatrixgetScalars () const
 Returns const reference to scalar matrix.
virtual NOX::Abstract::MultiVector::DenseMatrixgetScalars ()
 Returns reference to scalar matrix.
virtual const double & getScalar (int i, int j) const
 Returns const reference to the scalar for row i, column j.
virtual double & getScalar (int i, int j)
 Returns reference to the scalar for row i, column j.
virtual LOCA::Extended::VectorgetVector (int i)
 Return a reference to the i-th column of the multivector as an abstract vector.
virtual const LOCA::Extended::VectorgetVector (int i) const
 Return a const reference to the i-th column of the multivector as an abstract vector.
virtual int getNumScalarRows () const
 Returns number of scalars rows.
virtual int getNumMultiVectors () const
 Returns number of multi vectors.

Protected Member Functions

 MultiVector (int nColumns, int nVectorRows, int nScalarRows)
 Constructor that creates an empty multivector to be filled in later.
Additional interface derived classes must implement
virtual LOCA::Extended::VectorgenerateVector (int nVecs, int nScalarRows) const
 Generate a derived extended vector.
Other protected helper functions
void setMultiVectorPtr (int i, NOX::Abstract::MultiVector *v)
 Sets the pointer to the ith multivector.
void checkDimensions (const string &callingFunction, const LOCA::Extended::MultiVector &a) const
 Checks multi-vec argument dimensions are consistent.
void checkIndex (const string &callingFunction, int i) const
 Checks validity of column index.
void checkVectorRowIndex (const string &callingFunction, int i) const
 Checks validity of vector row index.
void checkIndex (const string &callingFunction, int i, int j) const
 Checks validity of column and row index for scalars.
bool isContiguous (const vector< int > &index) const
 Checks is index array is contiguous.

Protected Attributes

int numColumns
 Number of columns in each multivec and number of scalar vector columns.
int numMultiVecRows
 Number of multivec block rows.
int numScalarRows
 Number of scalar rows.
vector< NOX::Abstract::MultiVector * > multiVectorPtrs
 Array of multi-vector pointers, one for each block ROW.
NOX::Abstract::MultiVector::DenseMatrixscalarsPtr
 Dense matrix of scalars.
vector< LOCA::Extended::Vector * > extendedVectorPtrs
 Pointers to each column as a LOCA::Extended::Vector.
bool isView
 Flag indicating whether this vector is a view.

Friends

class Vector
 Declare LOCA::Extended::Vector as a friend class.

Detailed Description

Implemenatation of the NOX::Abstract::MultiVector class for extended multi-vectors comprised of an arbitrary number of multi-vectors and scalars.


Member Function Documentation

NOX::Abstract::MultiVector * LOCA::Extended::MultiVector::clone NOX::CopyType  type = NOX::DeepCopy  )  const [virtual]
 

Create a new MultiVector 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.

Reimplemented in LOCA::MultiContinuation::ExtendedMultiVector, and LOCA::TurningPoint::MooreSpence::ExtendedMultiVector.

LOCA::Extended::Vector * LOCA::Extended::MultiVector::generateVector int  nVecs,
int  nScalarRows
const [protected, virtual]
 

Generate a derived extended vector.

Extended multi-vectors derived from this class should implement this method and return a vector of the appropriate type. This allows the operator[] methods to work correctly for derived classes.

Reimplemented in LOCA::MultiContinuation::ExtendedMultiVector, and LOCA::TurningPoint::MooreSpence::ExtendedMultiVector.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:40:45 2008 for NOX by doxygen 1.3.9.1