NOX Development
|
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>
Public Member Functions | |
Vector (const Vector &source, NOX::CopyType type=NOX::DeepCopy) | |
Copy constructor. | |
virtual | ~Vector () |
Vector destructor. | |
virtual NOX::Abstract::Vector & | operator= (const NOX::Abstract::Vector &y) |
Assignment operator. | |
virtual Vector & | operator= (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::Vector & | init (double gamma) |
NOX::Abstract::Vector init function. Initializes each stored vector and scalar. | |
virtual NOX::Abstract::Vector & | random (bool useSeed=false, int seed=1) |
Initialize every element of this vector with random values. | |
virtual NOX::Abstract::Vector & | abs (const NOX::Abstract::Vector &y) |
NOX::Abstract::Vector abs function. Compues absolute value of each stored vector and scalar. | |
virtual NOX::Abstract::Vector & | reciprocal (const NOX::Abstract::Vector &y) |
NOX::Abstract::Vector reciprocal function. Computes reciprocal of each stored vector and scalar. | |
virtual NOX::Abstract::Vector & | scale (double gamma) |
NOX::Abstract::Vector scale function. Scales each stored vector and scalar. | |
virtual NOX::Abstract::Vector & | scale (const NOX::Abstract::Vector &a) |
NOX::Abstract::Vector scale function. Scales each stored vector and scalar. | |
virtual NOX::Abstract::Vector & | update (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::Vector & | update (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 NOX::size_type | 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. | |
![]() | |
Vector () | |
Abstract Vector constructor (does nothing) | |
virtual | ~Vector () |
Abstract Vector destructor (does nothing) | |
virtual NOX::Abstract::Vector & | init (double gamma)=0 |
Initialize every element of this vector with gamma . | |
virtual NOX::Abstract::Vector & | random (bool useSeed=false, int seed=1)=0 |
Initialize each element of this vector with a random value. | |
virtual NOX::Abstract::Vector & | abs (const NOX::Abstract::Vector &y)=0 |
Put element-wise absolute values of source vector y into this vector. | |
virtual NOX::Abstract::Vector & | operator= (const NOX::Abstract::Vector &y)=0 |
Copy source vector y into this vector. | |
virtual NOX::Abstract::Vector & | reciprocal (const NOX::Abstract::Vector &y)=0 |
Put element-wise reciprocal of source vector y into this vector. | |
virtual NOX::Abstract::Vector & | scale (double gamma)=0 |
Scale each element of this vector by gamma . | |
virtual NOX::Abstract::Vector & | scale (const NOX::Abstract::Vector &a)=0 |
Scale this vector element-by-element by the vector a. | |
virtual NOX::Abstract::Vector & | update (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::Vector & | update (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 . | |
virtual NOX::size_type | length () const =0 |
Return the length of vector. | |
virtual void | print (std::ostream &stream) const |
Print the vector. To be used for debugging only. | |
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::GlobalData > | globalData |
Global data. | |
std::vector< Teuchos::RCP< NOX::Abstract::Vector > > | vectorPtrs |
Array of vector pointers. | |
std::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. | |
Additional Inherited Members | |
![]() | |
enum | NormType { TwoNorm , OneNorm , MaxNorm } |
Norm types used in norm() calculations. More... | |
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
The extended vector
The implementations of the NOX::Abstract::Vector methods are defined in terms of the implementations of each stored abstract vector.
|
virtual |
Vector destructor.
Reimplemented from NOX::Abstract::Vector.
|
virtual |
NOX::Abstract::Vector abs function. Compues absolute value of each stored vector and scalar.
Implements NOX::Abstract::Vector.
References scalarsPtr, and vectorPtrs.
|
virtual |
Clone function. Applies clone to each stored vector.
Implements NOX::Abstract::Vector.
Reimplemented in LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::PhaseTransition::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, and LOCA::TurningPoint::MooreSpence::ExtendedVector.
|
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.
References getScalar(), scalarsPtr, and vectorPtrs.
Referenced by LOCA::MultiPredictor::Constant::compute(), LOCA::MultiPredictor::Random::compute(), LOCA::MultiPredictor::Secant::compute(), and LOCA::MultiPredictor::Tangent::compute().
|
virtual |
Create a MultiVector with numVecs
columns.
Reimplemented from NOX::Abstract::Vector.
References NOX::DeepCopy.
|
protectedvirtual |
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::PhaseTransition::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, and LOCA::TurningPoint::MooreSpence::ExtendedVector.
|
virtual |
NOX::Abstract::Vector init function. Initializes each stored vector and scalar.
Implements NOX::Abstract::Vector.
Referenced by Vector().
|
virtual |
NOX::Abstract::Vector innerProduct function. Computes inner product * of each stored vector and combines to compute inner product.
Implements NOX::Abstract::Vector.
References scalarsPtr, and vectorPtrs.
Referenced by LOCA::MultiContinuation::ArcLengthGroup::scaleTangent().
|
virtual |
NOX::Abstract::Vector length function. Computes sum of lengths of stored vectors plus number of scalars.
Implements NOX::Abstract::Vector.
|
virtual |
NOX::Abstract::Vector weighted norm function. Computes weighted norm of each stored vector and combines to compute appropriate norm.
Implements NOX::Abstract::Vector.
References norm(), scalarsPtr, and vectorPtrs.
NOX::Abstract::Vector norm function. Computes norm of each stored vector and combines to compute appropriate norm.
Implements NOX::Abstract::Vector.
References NOX::Abstract::Vector::MaxNorm, NOX::Abstract::Vector::OneNorm, and NOX::Abstract::Vector::TwoNorm.
Referenced by LOCA::Homotopy::DeflatedGroup::getNormNewtonSolveResidual(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::Hopf::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::MultiContinuation::ConstrainedGroup::getNormNewtonSolveResidual(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), and norm().
|
virtual |
Assignment operator.
Implements NOX::Abstract::Vector.
Reimplemented in LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::PhaseTransition::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, and LOCA::TurningPoint::MooreSpence::ExtendedVector.
Referenced by LOCA::Hopf::ComplexVector::operator=(), LOCA::Hopf::MooreSpence::ExtendedVector::operator=(), LOCA::MultiContinuation::ExtendedVector::operator=(), LOCA::PhaseTransition::ExtendedVector::operator=(), LOCA::Pitchfork::MooreSpence::ExtendedVector::operator=(), and LOCA::TurningPoint::MooreSpence::ExtendedVector::operator=().
|
virtual |
Assignment operator.
Reimplemented in LOCA::Hopf::ComplexVector, LOCA::Hopf::MooreSpence::ExtendedVector, LOCA::MultiContinuation::ExtendedVector, LOCA::PhaseTransition::ExtendedVector, LOCA::Pitchfork::MooreSpence::ExtendedVector, and LOCA::TurningPoint::MooreSpence::ExtendedVector.
References globalData, numScalars, scalarsPtr, and vectorPtrs.
|
virtual |
NOX::Abstract::Vector print function. For debugging purposes.
Reimplemented from NOX::Abstract::Vector.
|
virtual |
Initialize every element of this vector with random values.
Implements NOX::Abstract::Vector.
References NOX::Random::setSeed().
|
virtual |
NOX::Abstract::Vector reciprocal function. Computes reciprocal of each stored vector and scalar.
Implements NOX::Abstract::Vector.
References scalarsPtr, and vectorPtrs.
|
virtual |
NOX::Abstract::Vector scale function. Scales each stored vector and scalar.
Implements NOX::Abstract::Vector.
References scalarsPtr, scale(), and vectorPtrs.
|
virtual |
NOX::Abstract::Vector scale function. Scales each stored vector and scalar.
Implements NOX::Abstract::Vector.
References NOX::Abstract::Vector::scale().
Referenced by scale(), and LOCA::MultiContinuation::ArcLengthGroup::scaleTangent().
|
virtual |
NOX::Abstract::Vector update function. Applies vector update to each stored vector and scalar.
Implements NOX::Abstract::Vector.
References scalarsPtr, and vectorPtrs.
|
virtual |
NOX::Abstract::Vector update function. Applies vector update to each stored vector and scalar.
Implements NOX::Abstract::Vector.
References scalarsPtr, and vectorPtrs.
Referenced by LOCA::Homotopy::DeflatedGroup::computeX(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::computeX(), LOCA::Hopf::MooreSpence::ExtendedGroup::computeX(), LOCA::MultiContinuation::ConstrainedGroup::computeX(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::computeX(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::computeX(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::computeX(), LOCA::Homotopy::DeflatedGroup::getNormNewtonSolveResidual(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::Hopf::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::MultiContinuation::ConstrainedGroup::getNormNewtonSolveResidual(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::getNormNewtonSolveResidual(), and LOCA::MultiPredictor::AbstractStrategy::setPredictorOrientation().