# 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:

[legend]
List of all members.

## Public Types

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.
Initialization methods.
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.
Update methods.
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.
Creating new Vectors.
virtual Teuchos::RefCountPtr<
NOX::Abstract::Vector
clone (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::RefCountPtr<
NOX::Abstract::MultiVector
createMultiVector (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::RefCountPtr<
NOX::Abstract::MultiVector
createMultiVector (int numVecs, NOX::CopyType type=NOX::DeepCopy) const
Create a MultiVector with numVecs columns.
Norms.
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.
Inner product.
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

Norm types used in norm() calculations.

Enumeration values:
 TwoNorm Use the 2-norm. OneNorm Use the 1-norm. MaxNorm Use the max-norm, a.k.a. the -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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, and NOX::LAPACK::Vector.

 virtual Teuchos::RefCountPtr 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.

 Teuchos::RefCountPtr< 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, and NOX::Epetra::Vector.

 Teuchos::RefCountPtr< 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, and NOX::Epetra::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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::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: Returns: Implemented in LOCA::Extended::Vector, NOX::Epetra::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::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: Returns: Implemented in LOCA::Extended::Vector, NOX::Epetra::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: Implemented in NOX::Epetra::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 Returns:Reference to this object

 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, 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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::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 Returns:Reference to this object Implemented in LOCA::Extended::Vector, NOX::Epetra::Vector, and NOX::LAPACK::Vector.

The documentation for this class was generated from the following files:
• NOX_Abstract_Vector.H
• NOX_Abstract_Vector.C

Generated on Thu Sep 18 12:38:37 2008 for NOX by  1.3.9.1