NOX::Abstract::Vector Class Reference

NOX's pure abstract vector interface for vectors that are used by the nonlinear solver. More...

#include <NOX_Abstract_Vector.H>

Inheritance diagram for NOX::Abstract::Vector:

Inheritance graph
[legend]
List of all members.

Public Types

 TwoNorm
 Use the 2-norm.
 OneNorm
 Use the 1-norm.
 MaxNorm
 Use the max-norm, a.k.a. the $\infty$-norm.
enum  NormType { TwoNorm, OneNorm, MaxNorm }
 Norm types used in norm() calculations. More...

Public Member Functions

 Vector ()
 Abstract Vector constructor (does nothing)
virtual ~Vector ()
 Abstract Vector destructor (does nothing)
virtual int length () const =0
 Return the length of vector.
virtual void print (std::ostream &stream) const
 Print the vector. To be used for debugging only.
virtual NOX::Abstract::Vectorinit (double gamma)=0
 Initialize every element of this vector with gamma.
virtual NOX::Abstract::Vectorrandom (bool useSeed=false, int seed=1)
 Initialize each element of this vector with a random value.
virtual NOX::Abstract::Vectorabs (const NOX::Abstract::Vector &y)=0
 Put element-wise absolute values of source vector y into this vector.
virtual NOX::Abstract::Vectoroperator= (const NOX::Abstract::Vector &y)=0
 Copy source vector y into this vector.
virtual NOX::Abstract::Vectorreciprocal (const NOX::Abstract::Vector &y)=0
 Put element-wise reciprocal of source vector y into this vector.
virtual NOX::Abstract::Vectorscale (double gamma)=0
 Scale each element of this vector by gamma.
virtual NOX::Abstract::Vectorscale (const NOX::Abstract::Vector &a)=0
 Scale this vector element-by-element by the vector a.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double gamma=0.0)=0
 Compute x = (alpha * a) + (gamma * x) where x is this vector.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double beta, const NOX::Abstract::Vector &b, double gamma=0.0)=0
 Compute x = (alpha * a) + (beta * b) + (gamma * x) where x is this vector.
virtual Teuchos::RCP< NOX::Abstract::Vectorclone (NOX::CopyType type=NOX::DeepCopy) const =0
 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::MultiVectorcreateMultiVector (const NOX::Abstract::Vector *const *vecs, int numVecs, NOX::CopyType type=NOX::DeepCopy) const
 Create a MultiVector with numVecs+1 columns out of an array of Vectors. The vector stored under this will be the first column with the remaining numVecs columns given by vecs.
virtual Teuchos::RCP< NOX::Abstract::MultiVectorcreateMultiVector (int numVecs, NOX::CopyType type=NOX::DeepCopy) const
 Create a MultiVector with numVecs columns.
virtual double norm (NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const =0
 Norm.
virtual double norm (const NOX::Abstract::Vector &weights) const =0
 Weighted 2-Norm.
virtual double innerProduct (const NOX::Abstract::Vector &y) const =0
 Inner product with y.

Detailed Description

NOX's pure abstract vector interface for vectors that are used by the nonlinear solver.

This class is a member of the namespace NOX::Abstract.

The user should implement their own concrete implementation of this class or use one of the implementations provided by us.

Author:
Tammy Kolda (SNL 8950), Roger Pawlowski (SNL 9233)


Member Enumeration Documentation

enum NOX::Abstract::Vector::NormType

Norm types used in norm() calculations.

Enumerator:
TwoNorm  Use the 2-norm.
OneNorm  Use the 1-norm.
MaxNorm  Use the max-norm, a.k.a. the $\infty$-norm.


Member Function Documentation

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::abs ( const NOX::Abstract::Vector y  )  [pure virtual]

Put element-wise absolute values of source vector y into this vector.

Here x represents this vector, and we update it as

\[ x_i = | y_i | \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual Teuchos::RCP<NOX::Abstract::Vector> NOX::Abstract::Vector::clone ( NOX::CopyType  type = NOX::DeepCopy  )  const [pure 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" (the memory is allocated for the objects, but the current values are not copied into the vector). 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.

Implemented in LOCA::Extended::Vector, LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, LOCA::TurningPoint::MooreSpence::ExtendedVector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Abstract::Vector::createMultiVector ( int  numVecs,
NOX::CopyType  type = NOX::DeepCopy 
) const [virtual]

Create a MultiVector with numVecs columns.

The default implementation creates a generic NOX::MultiVector with either Shape or Deep copies of the supplied vector.

Reimplemented in LOCA::Extended::Vector, NOX::Epetra::Vector, and NOX::Thyra::Vector.

Teuchos::RCP< NOX::Abstract::MultiVector > NOX::Abstract::Vector::createMultiVector ( const NOX::Abstract::Vector *const *  vecs,
int  numVecs,
NOX::CopyType  type = NOX::DeepCopy 
) const [virtual]

Create a MultiVector with numVecs+1 columns out of an array of Vectors. The vector stored under this will be the first column with the remaining numVecs columns given by vecs.

The default implementation creates a generic NOX::MultiVector with either Shape or Deep copies of the supplied vectors.

Reimplemented in LOCA::Extended::Vector, NOX::Epetra::Vector, and NOX::Thyra::Vector.

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::init ( double  gamma  )  [pure virtual]

Initialize every element of this vector with gamma.

Here x represents this vector, and we update it as

\[ x_i = \gamma \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual double NOX::Abstract::Vector::innerProduct ( const NOX::Abstract::Vector y  )  const [pure virtual]

Inner product with y.

Here x represents this vector, and we compute its inner product with y as follows:

\[ \langle x,y \rangle = \sum_{i=1}^n x_i y_i \]

Returns:
$\langle x,y \rangle$

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual int NOX::Abstract::Vector::length (  )  const [pure virtual]

Return the length of vector.

Returns:
The length of this vector
Note:
Even if the vector is distributed across processors, this should return the global length of the vector.

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual double NOX::Abstract::Vector::norm ( const NOX::Abstract::Vector weights  )  const [pure virtual]

Weighted 2-Norm.

Here x represents this vector, and we compute its weighted norm as follows:

\[ \|x\|_w = \sqrt{\sum_{i=1}^{n} w_i \; x_i^2} \]

Returns:
$ \|x\|_w $

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual double NOX::Abstract::Vector::norm ( NOX::Abstract::Vector::NormType  type = NOX::Abstract::Vector::TwoNorm  )  const [pure virtual]

Norm.

Here x represents this vector, and we compute its norm as follows: for each NOX::Abstract::Vector::NormType:

Returns:
$\|x\|$

Implemented in NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::operator= ( const NOX::Abstract::Vector y  )  [pure virtual]

Copy source vector y into this vector.

Here x represents this vector, and we update it as

\[ x_i = y_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, LOCA::TurningPoint::MooreSpence::ExtendedVector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

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

Initialize each element of this vector with a random value.

If useSeed is true, uses the value of seed to seed the random number generator before filling the entries of this vector. So, if two calls are made where useSeed is true and seed is the same, then the vectors returned should be the same.

Default implementation throw an error. Only referenced by LOCA methods.

Returns:
Reference to this object

Reimplemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, and NOX::LAPACK::Vector.

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::reciprocal ( const NOX::Abstract::Vector y  )  [pure virtual]

Put element-wise reciprocal of source vector y into this vector.

Here x represents this vector, and we update it as

\[ x_i = \frac{1}{y_i} \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::scale ( const NOX::Abstract::Vector a  )  [pure virtual]

Scale this vector element-by-element by the vector a.

Here x represents this vector, and we update it as

\[ x_i = x_i \cdot a_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::scale ( double  gamma  )  [pure virtual]

Scale each element of this vector by gamma.

Here x represents this vector, and we update it as

\[ x_i = \gamma x_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

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

Compute x = (alpha * a) + (beta * b) + (gamma * x) where x is this vector.

Here x represents this vector, and we update it as

\[ x_i = \alpha \; a_i + \beta \; b_i + \gamma \; x_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

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

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

Here x represents this vector, and we update it as

\[ x_i = \alpha \; a_i + \gamma \; x_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:41:59 2010 for NOX by  doxygen 1.4.7