NOX Development
Public Types | Public Member Functions
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

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::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::RCP
< 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::RCP
< NOX::Abstract::MultiVector
createMultiVector (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

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.

Referenced by LOCA::Bifurcation::TPBord::StatusTest::NullVectorNormWRMS::checkStatus(), and LOCA::Bifurcation::PitchforkBord::StatusTest::NullVectorNormWRMS::checkStatus().

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::PhaseTransition::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, LOCA::TurningPoint::MooreSpence::ExtendedVector, NOX::Epetra::Vector, NOX::Thyra::Vector, NOX::Petsc::Vector, and NOX::LAPACK::Vector.

Referenced by NOX::StatusTest::NormWRMS::checkStatus(), NOX::StatusTest::NormUpdate::checkStatus(), LOCA::Bifurcation::TPBord::StatusTest::NullVectorNormWRMS::checkStatus(), LOCA::Bifurcation::PitchforkBord::StatusTest::NullVectorNormWRMS::checkStatus(), NOX::Direction::NonlinearCG::compute(), LOCA::SingularJacobianSolve::NicDay::compute(), LOCA::SingularJacobianSolve::Nic::compute(), LOCA::SingularJacobianSolve::ItRef::compute(), LOCA::DerivUtils::computeDCeDxa(), LOCA::DerivUtils::computeDJnDxa(), LOCA::DerivUtils::computeDwtCeDp(), LOCA::DerivUtils::computeDwtCeDx(), LOCA::DerivUtils::computeDwtJnDp(), LOCA::DerivUtils::computeDwtJnDx(), NOX::Direction::Utils::InexactNewton::computeForcingTerm(), LOCA::SingularJacobianSolve::NicDay::computeMulti(), LOCA::SingularJacobianSolve::Nic::computeMulti(), LOCA::SingularJacobianSolve::ItRef::computeMulti(), NOX::MeritFunction::SumOfSquares::computeQuadraticMinimizer(), NOX::MeritFunction::SumOfSquares::computeQuadraticModel(), LOCA::Epetra::Group::computeScaledDotProduct(), NOX::MeritFunction::SumOfSquares::computeSlope(), NOX::LineSearch::Utils::Slope::computeSlope(), NOX::LineSearch::Utils::Slope::computeSlopeWithOutJac(), NOX::Solver::TensorBased::getDirectionalDerivative(), NOX::Solver::TensorBased::getNormModelResidual(), NOX::MultiVector::MultiVector(), LOCA::DerivUtils::perturbXVec(), LOCA::AnasaziOperator::JacobianInverse::rayleighQuotient(), NOX::Direction::Broyden::BroydenMemoryUnit::reset(), NOX::Direction::Newton::resetForcingTerm(), LOCA::Epetra::Group::setScaleVector(), and LOCA::Extended::Vector::setVector().

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.

References Teuchos::rcp().

Referenced by LOCA::TurningPoint::MooreSpence::ExtendedGroup::applyJacobian(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::applyJacobian(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::applyJacobian(), LOCA::MultiContinuation::ConstrainedGroup::applyJacobian(), LOCA::Hopf::MooreSpence::ExtendedGroup::applyJacobian(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::applyJacobian(), LOCA::Homotopy::DeflatedGroup::applyJacobian(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::applyJacobianInverse(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::applyJacobianInverse(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::applyJacobianInverse(), LOCA::MultiContinuation::ConstrainedGroup::applyJacobianInverse(), LOCA::Hopf::MooreSpence::ExtendedGroup::applyJacobianInverse(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::applyJacobianInverse(), LOCA::Homotopy::DeflatedGroup::applyJacobianInverse(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::applyJacobianTranspose(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::applyJacobianTranspose(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::applyJacobianTranspose(), LOCA::MultiContinuation::ConstrainedGroup::applyJacobianTranspose(), LOCA::Hopf::MooreSpence::ExtendedGroup::applyJacobianTranspose(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::applyJacobianTranspose(), LOCA::Homotopy::DeflatedGroup::applyJacobianTranspose(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::applyJacobianTransposeInverse(), LOCA::MultiContinuation::ConstrainedGroup::applyJacobianTransposeInverse(), LOCA::Hopf::ComplexMultiVector::ComplexMultiVector(), LOCA::Eigensolver::DGGEVStrategy::computeEigenvalues(), LOCA::Eigensolver::AnasaziStrategy::computeEigenvalues(), LOCA::Hopf::MinimallyAugmented::Constraint::Constraint(), LOCA::TurningPoint::MooreSpence::ExtendedMultiVector::ExtendedMultiVector(), LOCA::Pitchfork::MooreSpence::ExtendedMultiVector::ExtendedMultiVector(), LOCA::PhaseTransition::ExtendedMultiVector::ExtendedMultiVector(), LOCA::MultiContinuation::ExtendedMultiVector::ExtendedMultiVector(), LOCA::Hopf::MooreSpence::ExtendedMultiVector::ExtendedMultiVector(), LOCA::Epetra::AnasaziOperator::Floquet::rayleighQuotient(), LOCA::AnasaziOperator::ShiftInvert2Matrix::rayleighQuotient(), LOCA::AnasaziOperator::ShiftInvert::rayleighQuotient(), LOCA::AnasaziOperator::Cayley2Matrix::rayleighQuotient(), and LOCA::AnasaziOperator::Cayley::rayleighQuotient().

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.

References Teuchos::rcp().

virtual NOX::Abstract::Vector& NOX::Abstract::Vector::init ( double  gamma) [pure virtual]
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.

Referenced by NOX::LineSearch::NonlinearCG::compute(), NOX::Direction::NonlinearCG::compute(), LOCA::SingularJacobianSolve::NicDay::compute(), LOCA::SingularJacobianSolve::Nic::compute(), NOX::Solver::TensorBased::computeCurvilinearStep(), LOCA::DerivUtils::computeDwtCeDp(), LOCA::DerivUtils::computeDwtJnDp(), LOCA::SingularJacobianSolve::NicDay::computeMulti(), LOCA::SingularJacobianSolve::Nic::computeMulti(), NOX::MeritFunction::SumOfSquares::computeQuadraticMinimizer(), LOCA::Thyra::Group::computeScaledDotProduct(), LOCA::MultiContinuation::AbstractGroup::computeScaledDotProduct(), LOCA::LAPACK::Group::computeScaledDotProduct(), LOCA::Epetra::Group::computeScaledDotProduct(), NOX::Thyra::WeightedMeritFunction::computeSlope(), NOX::MeritFunction::SumOfSquares::computeSlope(), NOX::LineSearch::Utils::Slope::computeSlope(), LOCA::Pitchfork::MooreSpence::AbstractGroup::innerProduct(), NOX::Solver::InexactTrustRegionBased::iterateInexact(), NOX::Solver::InexactTrustRegionBased::iterateStandard(), LOCA::Epetra::AnasaziOperator::Floquet::rayleighQuotient(), LOCA::AnasaziOperator::ShiftInvert2Matrix::rayleighQuotient(), LOCA::AnasaziOperator::ShiftInvert::rayleighQuotient(), LOCA::AnasaziOperator::JacobianInverse::rayleighQuotient(), LOCA::AnasaziOperator::Cayley2Matrix::rayleighQuotient(), and LOCA::AnasaziOperator::Cayley::rayleighQuotient().

virtual int NOX::Abstract::Vector::length ( ) const [pure virtual]
virtual double NOX::Abstract::Vector::norm ( NOX::Abstract::Vector::NormType  type = NOX::Abstract::Vector::TwoNorm) const [pure virtual]
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 NOX::Abstract::Vector& NOX::Abstract::Vector::operator= ( const NOX::Abstract::Vector y) [pure virtual]
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.

Referenced by LOCA::Bifurcation::TPBord::StatusTest::NullVectorNormWRMS::checkStatus(), and LOCA::Bifurcation::PitchforkBord::StatusTest::NullVectorNormWRMS::checkStatus().

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]
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]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends