LOCA::Extended::Vector Class Reference

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

#include <LOCA_Extended_Vector.H>

Inheritance diagram for LOCA::Extended::Vector:

Inheritance graph
[legend]
Collaboration diagram for LOCA::Extended::Vector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Vector (const Vector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
virtual ~Vector ()
 Vector destructor.
virtual NOX::Abstract::Vectoroperator= (const NOX::Abstract::Vector &y)
 Assignment operator.
virtual Vectoroperator= (const Vector &y)
 Assignment operator.
virtual Teuchos::RCP
< NOX::Abstract::Vector
clone (NOX::CopyType type=NOX::DeepCopy) const
 Clone function. Applies clone to each stored 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 NOX::Abstract::Vectorinit (double gamma)
 NOX::Abstract::Vector init function. Initializes each stored vector and scalar.
virtual NOX::Abstract::Vectorrandom (bool useSeed=false, int seed=1)
 Initialize every element of this vector with random values.
virtual NOX::Abstract::Vectorabs (const NOX::Abstract::Vector &y)
 NOX::Abstract::Vector abs function. Compues absolute value of each stored vector and scalar.
virtual NOX::Abstract::Vectorreciprocal (const NOX::Abstract::Vector &y)
 NOX::Abstract::Vector reciprocal function. Computes reciprocal of each stored vector and scalar.
virtual NOX::Abstract::Vectorscale (double gamma)
 NOX::Abstract::Vector scale function. Scales each stored vector and scalar.
virtual NOX::Abstract::Vectorscale (const NOX::Abstract::Vector &a)
 NOX::Abstract::Vector scale function. Scales each stored vector and scalar.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double gamma=0.0)
 NOX::Abstract::Vector update function. Applies vector update to each stored vector and scalar.
virtual NOX::Abstract::Vectorupdate (double alpha, const NOX::Abstract::Vector &a, double beta, const NOX::Abstract::Vector &b, double gamma=0.0)
 NOX::Abstract::Vector update function. Applies vector update to each stored vector and scalar.
virtual double norm (NormType type=TwoNorm) const
 NOX::Abstract::Vector norm function. Computes norm of each stored vector and combines to compute appropriate norm.
virtual double norm (const NOX::Abstract::Vector &weights) const
 NOX::Abstract::Vector weighted norm function. Computes weighted norm of each stored vector and combines to compute appropriate norm.
virtual double innerProduct (const NOX::Abstract::Vector &y) const
 NOX::Abstract::Vector innerProduct function. Computes inner product * of each stored vector and combines to compute inner product.
virtual int length () const
 NOX::Abstract::Vector length function. Computes sum of lengths of stored vectors plus number of scalars.
virtual void print (std::ostream &stream) const
 NOX::Abstract::Vector print function. For debugging purposes.
virtual void setVector (int i, const NOX::Abstract::Vector &v)
 Sets the ith vector.
virtual void setVectorView (int i, const Teuchos::RCP< NOX::Abstract::Vector > &v)
 Sets the ith vector as a view.
virtual void setScalar (int i, double s)
 Sets the ith scalar.
virtual void setScalarArray (double *sv)
 Sets the scalar array.
virtual Teuchos::RCP< const
NOX::Abstract::Vector
getVector (int i) const
 Returns const ref-count pointer to the ith vector.
virtual Teuchos::RCP
< NOX::Abstract::Vector
getVector (int i)
 Returns ref-count pointer to the ith vector.
virtual double getScalar (int i) const
 Returns copy of the ith scalar.
virtual double & getScalar (int i)
 Returns reference to the ith scalar.
virtual Teuchos::RCP< const
NOX::Abstract::MultiVector::DenseMatrix
getScalars () const
 Returns array of scalars.
virtual Teuchos::RCP
< NOX::Abstract::MultiVector::DenseMatrix
getScalars ()
 Returns array of scalars.
virtual int getNumScalars () const
 Returns number of scalars.
virtual int getNumVectors () const
 Returns number of vectors.

Protected Member Functions

 Vector (const Teuchos::RCP< LOCA::GlobalData > &global_data, int nvecs, int nscalars)
 Vector constructor.
virtual Teuchos::RCP
< LOCA::Extended::MultiVector
generateMultiVector (int nColumns, int nVectorRows, int nScalarRows) const
 generate an extended multi-vector

Protected Attributes

Teuchos::RCP< LOCA::GlobalDataglobalData
 Global data.
vector< Teuchos::RCP
< NOX::Abstract::Vector > > 
vectorPtrs
 Array of vector pointers.
vector< bool > isView
 Array indicating if each vector is a view.
int numScalars
 Number of scalars.
Teuchos::RCP
< NOX::Abstract::MultiVector::DenseMatrix
scalarsPtr
 Scalars.

Friends

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


Detailed Description

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

Many continuation and bifurcation calculations can be viewed as the solution to an extended set of equations. For example, calculating a turning point can be viewed as computing a solution to $G(z) = 0$ where $z = [x, n, p]\in\Re^{2n+1}$ and

\[ G(z) = \left[ \begin{array}{c} F(x,p) \\ Jn \\ n^Tn-1 \end{array} \right] \]

The extended vector $z$ is comprised of the two vectors $x$ and $n$ as well as the scalar $p$. This class provides an implementation of the NOX::Abstract::Vector interface for such extended vectors. It stores an array of pointers to NOX::Abstract::Vector's as well as an array of scalars using the STL vector class.

The implementations of the NOX::Abstract::Vector methods are defined in terms of the implementations of each stored abstract vector.

Definition at line 90 of file LOCA_Extended_Vector.H.


Constructor & Destructor Documentation

LOCA::Extended::Vector::Vector ( const Vector source,
NOX::CopyType  type = NOX::DeepCopy 
)

Copy constructor.

Definition at line 61 of file LOCA_Extended_Vector.C.

References NOX::DeepCopy, init(), isView, scalarsPtr, and vectorPtrs.

LOCA::Extended::Vector::~Vector (  )  [virtual]

Vector destructor.

Reimplemented from NOX::Abstract::Vector.

Definition at line 82 of file LOCA_Extended_Vector.C.

LOCA::Extended::Vector::Vector ( const Teuchos::RCP< LOCA::GlobalData > &  global_data,
int  nvecs,
int  nscalars 
) [protected]

Vector constructor.

Definition at line 48 of file LOCA_Extended_Vector.C.

References numScalars, and scalarsPtr.


Member Function Documentation

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

LOCA::Extended::Vector & LOCA::Extended::Vector::operator= ( const Vector y  )  [virtual]

Teuchos::RCP< NOX::Abstract::Vector > LOCA::Extended::Vector::clone ( NOX::CopyType  type = NOX::DeepCopy  )  const [virtual]

Teuchos::RCP< NOX::Abstract::MultiVector > LOCA::Extended::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.

Reimplemented from NOX::Abstract::Vector.

Definition at line 128 of file LOCA_Extended_Vector.C.

References generateMultiVector(), numScalars, and vectorPtrs.

Referenced by LOCA::MultiPredictor::Tangent::compute(), LOCA::MultiPredictor::Secant::compute(), LOCA::MultiPredictor::Random::compute(), and LOCA::MultiPredictor::Constant::compute().

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

Create a MultiVector with numVecs columns.

Reimplemented from NOX::Abstract::Vector.

Definition at line 180 of file LOCA_Extended_Vector.C.

References NOX::DeepCopy, generateMultiVector(), numScalars, and vectorPtrs.

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

NOX::Abstract::Vector init function. Initializes each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 213 of file LOCA_Extended_Vector.C.

References scalarsPtr, and vectorPtrs.

Referenced by Vector().

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

Initialize every element of this vector with random values.

Reimplemented from NOX::Abstract::Vector.

Definition at line 222 of file LOCA_Extended_Vector.C.

References scalarsPtr, NOX::Random::setSeed(), and vectorPtrs.

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

NOX::Abstract::Vector abs function. Compues absolute value of each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 234 of file LOCA_Extended_Vector.C.

References numScalars, scalarsPtr, and vectorPtrs.

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

NOX::Abstract::Vector reciprocal function. Computes reciprocal of each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 248 of file LOCA_Extended_Vector.C.

References numScalars, scalarsPtr, and vectorPtrs.

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

NOX::Abstract::Vector scale function. Scales each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 262 of file LOCA_Extended_Vector.C.

References scalarsPtr, and vectorPtrs.

Referenced by scale(), and LOCA::MultiContinuation::ArcLengthGroup::scaleTangent().

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

NOX::Abstract::Vector scale function. Scales each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 272 of file LOCA_Extended_Vector.C.

References scalarsPtr, scale(), and vectorPtrs.

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

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

NOX::Abstract::Vector update function. Applies vector update to each stored vector and scalar.

Implements NOX::Abstract::Vector.

Definition at line 301 of file LOCA_Extended_Vector.C.

References numScalars, scalarsPtr, update(), and vectorPtrs.

double LOCA::Extended::Vector::norm ( NormType  type = TwoNorm  )  const [virtual]

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

NOX::Abstract::Vector weighted norm function. Computes weighted norm of each stored vector and combines to compute appropriate norm.

Implements NOX::Abstract::Vector.

Definition at line 358 of file LOCA_Extended_Vector.C.

References numScalars, scalarsPtr, and vectorPtrs.

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

NOX::Abstract::Vector innerProduct function. Computes inner product * of each stored vector and combines to compute inner product.

Implements NOX::Abstract::Vector.

Definition at line 377 of file LOCA_Extended_Vector.C.

References numScalars, scalarsPtr, and vectorPtrs.

Referenced by LOCA::MultiContinuation::ArcLengthGroup::scaleTangent().

int LOCA::Extended::Vector::length (  )  const [virtual]

NOX::Abstract::Vector length function. Computes sum of lengths of stored vectors plus number of scalars.

Implements NOX::Abstract::Vector.

Definition at line 392 of file LOCA_Extended_Vector.C.

References numScalars, and vectorPtrs.

void LOCA::Extended::Vector::print ( std::ostream &  stream  )  const [virtual]

NOX::Abstract::Vector print function. For debugging purposes.

Reimplemented from NOX::Abstract::Vector.

Definition at line 403 of file LOCA_Extended_Vector.C.

References scalarsPtr, and vectorPtrs.

void LOCA::Extended::Vector::setVector ( int  i,
const NOX::Abstract::Vector v 
) [virtual]

void LOCA::Extended::Vector::setVectorView ( int  i,
const Teuchos::RCP< NOX::Abstract::Vector > &  v 
) [virtual]

Sets the ith vector as a view.

Definition at line 423 of file LOCA_Extended_Vector.C.

References isView, and vectorPtrs.

void LOCA::Extended::Vector::setScalar ( int  i,
double  s 
) [virtual]

void LOCA::Extended::Vector::setScalarArray ( double *  sv  )  [virtual]

Sets the scalar array.

Definition at line 438 of file LOCA_Extended_Vector.C.

References numScalars, and scalarsPtr.

Teuchos::RCP< const NOX::Abstract::Vector > LOCA::Extended::Vector::getVector ( int  i  )  const [virtual]

Teuchos::RCP< NOX::Abstract::Vector > LOCA::Extended::Vector::getVector ( int  i  )  [virtual]

Returns ref-count pointer to the ith vector.

Definition at line 455 of file LOCA_Extended_Vector.C.

References vectorPtrs.

double LOCA::Extended::Vector::getScalar ( int  i  )  const [virtual]

Returns copy of the ith scalar.

Definition at line 461 of file LOCA_Extended_Vector.C.

References scalarsPtr.

Referenced by LOCA::MultiContinuation::NaturalConstraint::computeConstraints(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::computeScaledDotProduct(), LOCA::MultiContinuation::ExtendedGroup::computeScaledDotProduct(), LOCA::MultiContinuation::ConstrainedGroup::computeScaledDotProduct(), LOCA::MultiContinuation::ArcLengthGroup::computeScaledDotProduct(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::computeScaledDotProduct(), LOCA::Homotopy::DeflatedGroup::computeScaledDotProduct(), LOCA::StepSize::Constant::computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), LOCA::TurningPoint::MinimallyAugmented::ExtendedGroup::computeX(), LOCA::TurningPoint::MooreSpence::ExtendedVector::getBifParam(), LOCA::Pitchfork::MooreSpence::ExtendedVector::getBifParam(), LOCA::Hopf::MooreSpence::ExtendedVector::getBifParam(), LOCA::Hopf::MooreSpence::ExtendedVector::getFrequency(), LOCA::Pitchfork::MooreSpence::ExtendedVector::getSlack(), LOCA::TurningPoint::MinimallyAugmented::ExtendedGroup::printSolution(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::printSolution(), LOCA::MultiContinuation::ConstrainedGroup::printSolution(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::printSolution(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::projectToDraw(), LOCA::MultiContinuation::ExtendedGroup::projectToDraw(), LOCA::MultiContinuation::ConstrainedGroup::projectToDraw(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::projectToDraw(), LOCA::Homotopy::DeflatedGroup::projectToDraw(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::setX(), and LOCA::Hopf::MinimallyAugmented::ExtendedGroup::setX().

double & LOCA::Extended::Vector::getScalar ( int  i  )  [virtual]

Returns reference to the ith scalar.

Definition at line 467 of file LOCA_Extended_Vector.C.

References scalarsPtr.

Teuchos::RCP< const NOX::Abstract::MultiVector::DenseMatrix > LOCA::Extended::Vector::getScalars (  )  const [virtual]

Teuchos::RCP< NOX::Abstract::MultiVector::DenseMatrix > LOCA::Extended::Vector::getScalars (  )  [virtual]

Returns array of scalars.

Definition at line 479 of file LOCA_Extended_Vector.C.

References scalarsPtr.

int LOCA::Extended::Vector::getNumScalars (  )  const [virtual]

Returns number of scalars.

Definition at line 485 of file LOCA_Extended_Vector.C.

References numScalars.

int LOCA::Extended::Vector::getNumVectors (  )  const [virtual]

Returns number of vectors.

Definition at line 491 of file LOCA_Extended_Vector.C.

References vectorPtrs.

Teuchos::RCP< LOCA::Extended::MultiVector > LOCA::Extended::Vector::generateMultiVector ( int  nColumns,
int  nVectorRows,
int  nScalarRows 
) const [protected, virtual]

generate an extended multi-vector

Extended vectors derived from this class should implement this method and return a multivector of the appropriate type so that the createMultiVectors method returns a multivector of the appropriate type.

Reimplemented in LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, and LOCA::TurningPoint::MooreSpence::ExtendedVector.

Definition at line 497 of file LOCA_Extended_Vector.C.

References globalData.

Referenced by createMultiVector().


Friends And Related Function Documentation

friend class LOCA::Extended::MultiVector [friend]

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

Definition at line 93 of file LOCA_Extended_Vector.H.


Member Data Documentation

vector< Teuchos::RCP<NOX::Abstract::Vector> > LOCA::Extended::Vector::vectorPtrs [protected]

vector< bool > LOCA::Extended::Vector::isView [protected]

Array indicating if each vector is a view.

Definition at line 296 of file LOCA_Extended_Vector.H.

Referenced by setVector(), setVectorView(), and Vector().


The documentation for this class was generated from the following files:

Generated on Thu Dec 17 11:02:50 2009 for Nonlinear Solver Project by  doxygen 1.5.9