NOX::Epetra::Vector Class Reference

Implementation of NOX::Abstract::Vector for Epetra vectors. More...

#include <NOX_Epetra_Vector.H>

Inheritance diagram for NOX::Epetra::Vector:

[legend]
Collaboration diagram for NOX::Epetra::Vector:
[legend]
List of all members.

Public Member Functions

 Vector (Epetra_Vector &source, NOX::CopyType type=NOX::DeepCopy, bool createView=false)
 Construct by copying map and/or elements of an Epetra_Vector.
 Vector (const Epetra_Vector &source, NOX::CopyType type=NOX::DeepCopy)
 Construct by copying map and/or elements of an Epetra_Vector.
 Vector (const NOX::Epetra::Vector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 ~Vector ()
 Destruct Vector.
virtual int length () const
 Return the length of vector.
virtual void print () const
 Print the vector. This is meant for debugging purposes only and does not need to be defined.
Access to underlying Petra vector.
virtual Epetra_VectorgetEpetraVector ()
 Get reference to underlying Epetra vector.
virtual const Epetra_VectorgetEpetraVector () const
 Get const reference to underlying Epetra vector.
Initialization methods.
virtual NOX::Abstract::Vectorinit (double value)
 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::Vectoroperator= (const Epetra_Vector &y)
 Copies source vector into "this".
virtual NOX::Abstract::Vectoroperator= (const NOX::Epetra::Vector &y)
virtual NOX::Abstract::Vectoroperator= (const NOX::Abstract::Vector &y)
 Copy source vector y into this vector.
virtual NOX::Abstract::Vectorabs (const NOX::Epetra::Vector &y)
virtual NOX::Abstract::Vectorabs (const NOX::Abstract::Vector &y)
 Put element-wise absolute values of source vector y into this vector.
virtual NOX::Abstract::Vectorreciprocal (const NOX::Epetra::Vector &y)
virtual NOX::Abstract::Vectorreciprocal (const NOX::Abstract::Vector &y)
 Put element-wise reciprocal of source vector y into this vector.
Update methods.
virtual NOX::Abstract::Vectorscale (double gamma)
 Scale each element of this vector by gamma.
virtual NOX::Abstract::Vectorscale (const NOX::Epetra::Vector &a)
virtual NOX::Abstract::Vectorscale (const NOX::Abstract::Vector &a)
 Scale this vector element-by-element by the vector a.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Epetra::Vector &a, double gamma=0.0)
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double gamma=0.0)
 Compute x = (alpha * a) + (gamma * x) where x is this vector.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Epetra::Vector &a, double beta, const NOX::Epetra::Vector &b, double gamma=0.0)
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double beta, const NOX::Abstract::Vector &b, double gamma=0.0)
 Compute x = (alpha * a) + (beta * b) + (gamma * x) where x is this vector.
Creating new Vectors.
virtual NOX::Abstract::Vectorclone (CopyType type=DeepCopy) const
Norms.
virtual double norm (NOX::Abstract::Vector::NormType type=TwoNorm) const
 Norm.
virtual double norm (const NOX::Epetra::Vector &weights) const
virtual double norm (const NOX::Abstract::Vector &weights) const
 Weighted 2-Norm.
Dot products
virtual double dot (const NOX::Epetra::Vector &y) const
virtual double dot (const NOX::Abstract::Vector &y) const
 Dot product with y.

Protected Attributes

Epetra_VectorepetraVec
 Pointer to petra vector owned by this object.
bool ownsEpetraVector
 True if *this created (i.e. allocated the memory for) the underlying Epetra_Vector.

Detailed Description

Implementation of NOX::Abstract::Vector for Epetra vectors.


Constructor & Destructor Documentation

NOX::Epetra::Vector::Vector Epetra_Vector source,
NOX::CopyType  type = NOX::DeepCopy,
bool  createView = false
 

Construct by copying map and/or elements of an Epetra_Vector.

Option for creating a "View": Construct a NOX::Epetra::Vector using the SAME memory location used in the source Epetra_Vector. WARNING: A View can be dangerous since multiple objects can access the same memory locations.


Member Function Documentation

NOX::Abstract::Vector & NOX::Epetra::Vector::abs const NOX::Abstract::Vector y  )  [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

Implements NOX::Abstract::Vector.

double NOX::Epetra::Vector::dot const NOX::Abstract::Vector y  )  const [virtual]
 

Dot product with y.

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

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

Returns:
$\langle x,y \rangle$

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::init double  value  )  [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

Implements NOX::Abstract::Vector.

int NOX::Epetra::Vector::length  )  const [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.

Implements NOX::Abstract::Vector.

double NOX::Epetra::Vector::norm const NOX::Abstract::Vector weights  )  const [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 $

Implements NOX::Abstract::Vector.

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

Norm.

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

Returns:
$\|x\|$

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::operator= const NOX::Abstract::Vector y  )  [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

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::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 from NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::reciprocal const NOX::Abstract::Vector y  )  [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

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::scale const NOX::Abstract::Vector a  )  [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

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::scale double  gamma  )  [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

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::update double  alpha,
const NOX::Abstract::Vector a,
double  beta,
const NOX::Abstract::Vector b,
double  gamma = 0.0
[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

Implements NOX::Abstract::Vector.

NOX::Abstract::Vector & NOX::Epetra::Vector::update double  alpha,
const NOX::Abstract::Vector a,
double  gamma = 0.0
[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

Implements NOX::Abstract::Vector.


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