NOX Development
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
LOCA::Hopf::ComplexMultiVector Class Reference

Multi-vector class to hold two multi-vectors to represent a complex multi-vector. More...

#include <LOCA_Hopf_ComplexMultiVector.H>

Inheritance diagram for LOCA::Hopf::ComplexMultiVector:
Inheritance graph
[legend]
Collaboration diagram for LOCA::Hopf::ComplexMultiVector:
Collaboration graph
[legend]

Public Member Functions

 ComplexMultiVector (const Teuchos::RCP< LOCA::GlobalData > &global_data, const NOX::Abstract::Vector &cloneVec, int nColumns)
 Constructor.
 
 ComplexMultiVector (const Teuchos::RCP< LOCA::GlobalData > &global_data, const NOX::Abstract::MultiVector &realVec, const NOX::Abstract::MultiVector &imagVec)
 Constructor.
 
 ComplexMultiVector (const ComplexMultiVector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 
 ComplexMultiVector (const ComplexMultiVector &source, int nColumns)
 Copy constructor that creates a new multivector with nColumns columns.
 
 ComplexMultiVector (const ComplexMultiVector &source, const std::vector< int > &index, bool view)
 Copy constructor that creates a sub copy or view of the given multivector.
 
virtual ~ComplexMultiVector ()
 Destructor.
 
virtual ComplexMultiVectoroperator= (const ComplexMultiVector &y)
 Assignment operator.
 
virtual LOCA::Extended::MultiVectoroperator= (const LOCA::Extended::MultiVector &y)
 Assignment operator.
 
virtual NOX::Abstract::MultiVectoroperator= (const NOX::Abstract::MultiVector &y)
 Assignment operator.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (NOX::CopyType type=NOX::DeepCopy) const
 Create a new multi-vector of the same underlying type by cloning "this", and return a pointer to the new vector.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (int numvecs) const
 Creates a new multi-vector with numvecs columns.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubCopy (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubView (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns that shares the columns of *this given by index.
 
virtual Teuchos::RCP< const NOX::Abstract::MultiVectorgetRealMultiVec () const
 Returns the real component of extended multivector.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorgetRealMultiVec ()
 Returns the real component of extended multivector.
 
virtual Teuchos::RCP< const NOX::Abstract::MultiVectorgetImagMultiVec () const
 Returns the imaginary component of extended multivector.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorgetImagMultiVec ()
 Returns the imaginary component of extended multivector.
 
virtual Teuchos::RCP< LOCA::Hopf::ComplexVectorgetColumn (int i)
 Returns ith column as an extended vector.
 
virtual Teuchos::RCP< const LOCA::Hopf::ComplexVectorgetColumn (int i) const
 Returns ith column as an extended vector.
 
- Public Member Functions inherited from LOCA::Extended::MultiVector
 MultiVector (const MultiVector &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 
 MultiVector (const MultiVector &source, int nColumns)
 Copy constructor that creates a new multivector with nColumns columns.
 
 MultiVector (const MultiVector &source, const std::vector< int > &index, bool view)
 Copy constructor that creates a sub copy or view of the given multivector.
 
virtual ~MultiVector ()
 Vector destructor.
 
virtual NOX::Abstract::MultiVectorinit (double gamma)
 Initialize every element of this multi-vector with gamma.
 
virtual NOX::Abstract::MultiVectorrandom (bool useSeed=false, int seed=1)
 Initialize each element of this multi-vector with a random value.
 
virtual NOX::Abstract::MultiVectoroperator= (const NOX::Abstract::MultiVector &source)
 Copy source multi-vector source into this multi-vector.
 
virtual MultiVectoroperator= (const MultiVector &y)
 Copy source multi-vector source into this multi-vector.
 
virtual NOX::Abstract::MultiVectorsetBlock (const NOX::Abstract::MultiVector &source, const std::vector< int > &index)
 Copy the vectors in source to a set of vectors in *this. The index.size() vectors in source are copied to a subset of vectors in *this indicated by the indices given in index.
 
virtual NOX::Abstract::MultiVectorsetBlock (const MultiVector &source, const std::vector< int > &index)
 
virtual NOX::Abstract::MultiVectoraugment (const NOX::Abstract::MultiVector &source)
 Append the vectors in source to *this.
 
virtual NOX::Abstract::MultiVectoraugment (const MultiVector &source)
 
virtual NOX::Abstract::Vectoroperator[] (int i)
 Return a reference to the i-th column of the multivector as an abstract vector.
 
virtual const NOX::Abstract::Vectoroperator[] (int i) const
 Return a const reference to the i-th column of the multivector as an abstract vector.
 
virtual NOX::Abstract::MultiVectorscale (double gamma)
 Scale each element of this multivector by gamma.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double gamma=0.0)
 Compute x = (alpha * a) + (gamma * x) where a is a multi-vector and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const MultiVector &a, double gamma=0.0)
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double beta, const NOX::Abstract::MultiVector &b, double gamma=0.0)
 Compute x = (alpha * a) + (beta * b) + (gamma * x) where a and b are multi-vectors and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const MultiVector &a, double beta, const MultiVector &b, double gamma=0.0)
 
virtual NOX::Abstract::MultiVectorupdate (Teuchos::ETransp transb, double alpha, const NOX::Abstract::MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0)
 Compute x = (alpha * a * b) + (gamma * x) where a is a multivector, b is a dense matrix, x = *this, and op(b) = b if transb = Teuchos::NO_TRANS and op(b) is b transpose if transb = Teuchos::TRANS.
 
virtual NOX::Abstract::MultiVectorupdate (Teuchos::ETransp transb, double alpha, const MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0)
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (NOX::CopyType type=NOX::DeepCopy) const
 Create a new MultiVector of the same underlying type by cloning "this", and return a pointer to the new vector.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (int numvecs) const
 Creates a new multi-vector with numvecs columns.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubCopy (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubView (const std::vector< int > &index) const
 Creates a new multi-vector with index.size() columns that shares the columns of *this given by index.
 
virtual void norm (std::vector< double > &result, NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const
 Norm.
 
virtual void multiply (double alpha, const NOX::Abstract::MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const
 Computes the matrix-matrix product $\alpha * y^T * (*this)$.
 
virtual void multiply (double alpha, const MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const
 
virtual NOX::size_type length () const
 Return the length of multi-vector.
 
virtual int numVectors () const
 Return the number of vectors in the multi-vector.
 
virtual void print (std::ostream &stream) const
 Print the vector. This is meant for debugging purposes only.
 
virtual Teuchos::RCP< const NOX::Abstract::MultiVectorgetMultiVector (int i) const
 Returns const ref-count pointer to the ith multi-vector.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorgetMultiVector (int i)
 Returns ref-count pointer to the ith multi-vector.
 
virtual Teuchos::RCP< const NOX::Abstract::MultiVector::DenseMatrixgetScalars () const
 Returns const ref-count pointer to scalar matrix.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVector::DenseMatrixgetScalars ()
 Returns ref-count pointer to scalar matrix.
 
virtual Teuchos::RCP< const NOX::Abstract::MultiVector::DenseMatrixgetScalarRows (int num_rows, int row) const
 Returns const ref-count pointer to num_rows rows of scalar matrix starting at row row.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVector::DenseMatrixgetScalarRows (int num_rows, int row)
 Returns ref-count pointer to num_rows rows of scalar matrix starting at row row.
 
virtual const double & getScalar (int i, int j) const
 Returns const reference to the scalar for row i, column j.
 
virtual double & getScalar (int i, int j)
 Returns reference to the scalar for row i, column j.
 
virtual Teuchos::RCP< LOCA::Extended::VectorgetVector (int i)
 Return a ref-count pointer to the i-th column of the multivector as an abstract vector.
 
virtual Teuchos::RCP< const LOCA::Extended::VectorgetVector (int i) const
 Return a const ref-count pointer to the i-th column of the multivector as an abstract vector.
 
virtual int getNumScalarRows () const
 Returns number of scalars rows.
 
virtual int getNumMultiVectors () const
 Returns number of multi vectors.
 
- Public Member Functions inherited from NOX::Abstract::MultiVector
 MultiVector ()
 Default constructor. Does nothing.
 
virtual ~MultiVector ()
 Destructor. Does nothing.
 
virtual NOX::Abstract::MultiVectorinit (double gamma)=0
 Initialize every element of this multi-vector with gamma.
 
virtual NOX::Abstract::MultiVectorrandom (bool useSeed=false, int seed=1)=0
 Initialize each element of this multi-vector with a random value.
 
virtual NOX::Abstract::MultiVectoroperator= (const NOX::Abstract::MultiVector &source)=0
 Copy source multi-vector source into this multi-vector.
 
virtual NOX::Abstract::MultiVectorsetBlock (const NOX::Abstract::MultiVector &source, const std::vector< int > &index)=0
 Copy the vectors in source to a set of vectors in *this. The index.size() vectors in source are copied to a subset of vectors in *this indicated by the indices given in index.
 
virtual NOX::Abstract::MultiVectoraugment (const NOX::Abstract::MultiVector &source)=0
 Append the vectors in source to *this.
 
virtual NOX::Abstract::Vectoroperator[] (int i)=0
 Return a reference to the i-th column of the multivector as an abstract vector.
 
virtual const NOX::Abstract::Vectoroperator[] (int i) const =0
 Return a const reference to the i-th column of the multivector as an abstract vector.
 
virtual NOX::Abstract::MultiVectorscale (double gamma)=0
 Scale each element of this multivector by gamma.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double gamma=0.0)=0
 Compute x = (alpha * a) + (gamma * x) where a is a multi-vector and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (double alpha, const NOX::Abstract::MultiVector &a, double beta, const NOX::Abstract::MultiVector &b, double gamma=0.0)=0
 Compute x = (alpha * a) + (beta * b) + (gamma * x) where a and b are multi-vectors and x = *this.
 
virtual NOX::Abstract::MultiVectorupdate (Teuchos::ETransp transb, double alpha, const NOX::Abstract::MultiVector &a, const DenseMatrix &b, double gamma=0.0)=0
 Compute x = (alpha * a * op(b)) + (gamma * x) where a is a multivector, b is a dense matrix, x = *this, and op(b) = b if transb = Teuchos::NO_TRANS and op(b) is b transpose if transb = Teuchos::TRANS.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorclone (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::MultiVectorclone (int numvecs) const =0
 Creates a new multi-vector with numvecs columns.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubCopy (const std::vector< int > &index) const =0
 Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.
 
virtual Teuchos::RCP< NOX::Abstract::MultiVectorsubView (const std::vector< int > &index) const =0
 Creates a new multi-vector with ndex.size() columns that shares the columns of *this given by index.
 
virtual void norm (std::vector< double > &result, NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const =0
 Norm.
 
virtual void multiply (double alpha, const NOX::Abstract::MultiVector &y, DenseMatrix &b) const =0
 Computes the matrix-matrix product $\alpha * y^T * (*this)$.
 
virtual NOX::size_type length () const =0
 Return the length of multi-vector.
 
virtual int numVectors () const =0
 Return the number of vectors in the multi-vector.
 
virtual void print (std::ostream &stream) const =0
 Print the vector. This is meant for debugging purposes only.
 

Protected Member Functions

 ComplexMultiVector (const Teuchos::RCP< LOCA::GlobalData > &global_data, int nColumns)
 Constructor.
 
virtual Teuchos::RCP< LOCA::Extended::VectorgenerateVector (int nVecs, int nScalarRows) const
 Generate a derived extended vector.
 
- Protected Member Functions inherited from LOCA::Extended::MultiVector
 MultiVector (const Teuchos::RCP< LOCA::GlobalData > &global_data, int nColumns, int nVectorRows, int nScalarRows)
 Constructor that creates an empty multivector to be filled in later.
 
virtual Teuchos::RCP< LOCA::Extended::VectorgenerateVector (int nVecs, int nScalarRows) const
 Generate a derived extended vector.
 
void setMultiVectorPtr (int i, Teuchos::RCP< NOX::Abstract::MultiVector > v)
 Sets the pointer to the ith multivector.
 
void checkDimensions (const std::string &callingFunction, const LOCA::Extended::MultiVector &a) const
 Checks multi-vec argument dimensions are consistent.
 
void checkIndex (const std::string &callingFunction, int i) const
 Checks validity of column index.
 
void checkVectorRowIndex (const std::string &callingFunction, int i) const
 Checks validity of vector row index.
 
void checkIndex (const std::string &callingFunction, int i, int j) const
 Checks validity of column and row index for scalars.
 
bool isContiguous (const std::vector< int > &index) const
 Checks is index array is contiguous.
 

Friends

class ComplexVector
 Declare LOCA::Hopf::ComplexVector as a friend class so it can call protected methods.
 

Additional Inherited Members

- Public Types inherited from NOX::Abstract::MultiVector
typedef Teuchos::SerialDenseMatrix< int, double > DenseMatrix
 Typename of dense matrices.
 
- Protected Attributes inherited from LOCA::Extended::MultiVector
Teuchos::RCP< LOCA::GlobalDataglobalData
 Global data.
 
int numColumns
 Number of columns in each multivec and number of scalar vector columns.
 
int numMultiVecRows
 Number of multivec block rows.
 
int numScalarRows
 Number of scalar rows.
 
std::vector< Teuchos::RCP< NOX::Abstract::MultiVector > > multiVectorPtrs
 Array of multi-vector pointers, one for each block ROW.
 
Teuchos::RCP< NOX::Abstract::MultiVector::DenseMatrixscalarsPtr
 Dense matrix of scalars.
 
std::vector< Teuchos::RCP< LOCA::Extended::Vector > > extendedVectorPtrs
 Pointers to each column as a LOCA::Extended::Vector.
 
bool isView
 Flag indicating whether this vector is a view.
 

Detailed Description

Multi-vector class to hold two multi-vectors to represent a complex multi-vector.

This is not a true complex multi-vector. Operations like dot() and multiply() are not correct for complex vectors. This class exists to make some aspects of the real-equivalent formulation of complex linear algebra simpler to implement.

Constructor & Destructor Documentation

◆ ComplexMultiVector() [1/2]

LOCA::Hopf::ComplexMultiVector::ComplexMultiVector ( const Teuchos::RCP< LOCA::GlobalData > &  global_data,
const NOX::Abstract::Vector cloneVec,
int  nColumns 
)

Constructor.

Generates a multivector with nColumns columns from cloneVec

References NOX::Abstract::Vector::createMultiVector(), LOCA::Extended::MultiVector::setMultiVectorPtr(), and NOX::ShapeCopy.

◆ ComplexMultiVector() [2/2]

LOCA::Hopf::ComplexMultiVector::ComplexMultiVector ( const Teuchos::RCP< LOCA::GlobalData > &  global_data,
int  nColumns 
)
protected

Constructor.

Creates an empty multivector with nColumns columns

Member Function Documentation

◆ clone() [1/2]

Teuchos::RCP< NOX::Abstract::MultiVector > LOCA::Hopf::ComplexMultiVector::clone ( int  numvecs) const
virtual

Creates a new multi-vector with numvecs columns.

Reimplemented from LOCA::Extended::MultiVector.

◆ clone() [2/2]

Teuchos::RCP< NOX::Abstract::MultiVector > LOCA::Hopf::ComplexMultiVector::clone ( NOX::CopyType  type = NOX::DeepCopy) const
virtual

Create a new multi-vector of the same underlying type by cloning "this", and return a pointer to the new vector.

Reimplemented from LOCA::Extended::MultiVector.

◆ generateVector()

Teuchos::RCP< LOCA::Extended::Vector > LOCA::Hopf::ComplexMultiVector::generateVector ( int  nVecs,
int  nScalarRows 
) const
protectedvirtual

Generate a derived extended vector.

Returns a vector of type LOCA::Hopf::ComplexVector

Reimplemented from LOCA::Extended::MultiVector.

◆ operator=() [1/2]

LOCA::Extended::MultiVector & LOCA::Hopf::ComplexMultiVector::operator= ( const LOCA::Extended::MultiVector y)
virtual

Assignment operator.

Reimplemented from LOCA::Extended::MultiVector.

◆ operator=() [2/2]

NOX::Abstract::MultiVector & LOCA::Hopf::ComplexMultiVector::operator= ( const NOX::Abstract::MultiVector y)
virtual

Assignment operator.

Reimplemented from LOCA::Extended::MultiVector.

◆ subCopy()

Teuchos::RCP< NOX::Abstract::MultiVector > LOCA::Hopf::ComplexMultiVector::subCopy ( const std::vector< int > &  index) const
virtual

Creates a new multi-vector with index.size() columns whose columns are copies of the columns of *this given by index.

Reimplemented from LOCA::Extended::MultiVector.

◆ subView()

Teuchos::RCP< NOX::Abstract::MultiVector > LOCA::Hopf::ComplexMultiVector::subView ( const std::vector< int > &  index) const
virtual

Creates a new multi-vector with index.size() columns that shares the columns of *this given by index.

Reimplemented from LOCA::Extended::MultiVector.


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