#include <LOCA_Extended_MultiVector.H>
Collaboration diagram for LOCA::Extended::MultiVector:
Public Member Functions | |
| MultiVector (const MultiVector &source, NOX::CopyType type=NOX::DeepCopy) | |
| Copy constructor. | |
| MultiVector (const MultiVector &source, vector< int > &index, bool view=false) | |
| Copy constructor that creates s sub copy or view of the given multivector. | |
| virtual | ~MultiVector () |
| Vector destructor. | |
| virtual int | length () const |
| Return the length of multi-vector. | |
| virtual int | numVectors () const |
| Return the number of vectors in the multi-vector. | |
| virtual void | print () const |
| Print the vector. This is meant for debugging purposes only. | |
| virtual void | setMultiVector (int i, const NOX::Abstract::MultiVector &v) |
| Sets the ith multi-vector. | |
| virtual void | setScalar (int i, int j, double s) |
| Sets the scalar for row i, column j. | |
| virtual const NOX::Abstract::MultiVector & | getMultiVector (int i) const |
| Returns const reference to the ith multi-vector. | |
| virtual NOX::Abstract::MultiVector & | getMultiVector (int i) |
| Returns reference to the ith multi-vector. | |
| 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. | |
Initialization methods. | |
| virtual NOX::Abstract::MultiVector & | init (double gamma) |
Initialize every element of this multi-vector with gamma. | |
| virtual NOX::Abstract::MultiVector & | random (bool useSeed=false, int seed=1) |
| Initialize each element of this multi-vector with a random value. | |
| virtual NOX::Abstract::MultiVector & | operator= (const NOX::Abstract::MultiVector &source) |
Copy source multi-vector source into this multi-vector. | |
| virtual MultiVector & | operator= (const MultiVector &y) |
Copy source multi-vector source into this multi-vector. | |
| virtual NOX::Abstract::MultiVector & | setBlock (const NOX::Abstract::MultiVector &source, 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::MultiVector & | setBlock (const MultiVector &source, vector< int > &index) |
| virtual NOX::Abstract::MultiVector & | augment (const NOX::Abstract::MultiVector &source) |
Append the vectors in source to *this. | |
| virtual NOX::Abstract::MultiVector & | augment (const MultiVector &source) |
Accessor methods | |
| virtual NOX::Abstract::Vector & | operator[] (int i) |
| Return a reference to the i-th column of the multivector as an abstract vector. | |
| virtual const NOX::Abstract::Vector & | operator[] (int i) const |
| Return a const reference to the i-th column of the multivector as an abstract vector. | |
Update methods. | |
| virtual NOX::Abstract::MultiVector & | update (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::MultiVector & | update (double alpha, const MultiVector &a, double gamma=0.0) |
| virtual NOX::Abstract::MultiVector & | update (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::MultiVector & | update (double alpha, const MultiVector &a, double beta, const MultiVector &b, double gamma=0.0) |
| virtual NOX::Abstract::MultiVector & | update (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, and x = *this. | |
| virtual NOX::Abstract::MultiVector & | update (double alpha, const MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b, double gamma=0.0) |
Creating new MultiVectors. | |
| virtual NOX::Abstract::MultiVector * | clone (NOX::CopyType type=NOX::DeepCopy) const |
| Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector. | |
| virtual NOX::Abstract::MultiVector * | clone (int numvecs) const |
Creates a new multi-vector with numvecs columns. | |
| virtual NOX::Abstract::MultiVector * | subCopy (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 NOX::Abstract::MultiVector * | subView (vector< int > &index) const |
Creates a new multi-vector with index.size() columns that shares the columns of *this given by index. | |
Norms. | |
| virtual void | norm (vector< double > &result, NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const |
| Norm. | |
Dot products. | |
| virtual void | dot (double alpha, const NOX::Abstract::MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const |
Computes the dot product between each column of *this and y, scaled by alpha. | |
| virtual void | dot (double alpha, const MultiVector &y, NOX::Abstract::MultiVector::DenseMatrix &b) const |
Protected Member Functions | |
| MultiVector (int nColumns, int nVecs, int nScalarRows, bool view=false) | |
| Constructor that creates an empty extended multivector holding nVecs multivectors, each multivector stores nColumns, and there are nScalarRows rows of scalars. Set view to true when creating a multivector view. | |
| void | setMultiVectorPtr (int i, NOX::Abstract::MultiVector *v) |
| Sets the pointer to the ith multivector. | |
| void | checkDimensions (const LOCA::Extended::MultiVector &a) const |
| Checks multi-vec argument dimensions are consistent. | |
| void | checkDimensions (const LOCA::Extended::MultiVector &a, vector< int > &index) const |
| Checks multi-vec argument dimensions are consistent. | |
| void | checkDimensions (const LOCA::Extended::MultiVector &a, const NOX::Abstract::MultiVector::DenseMatrix &b) const |
| Checks multi-vec argument dimensions are consistent. | |
| void | checkAugmentDimensions (const LOCA::Extended::MultiVector &a) const |
| Checks multi-vec argument dimensions are consistent for augment. | |
| void | checkIndex (int i) const |
| Checks validity of column index. | |
| void | checkIndex (int i, int j) const |
| Checks validity of column and row index for scalars. | |
Protected Attributes | |
| 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. | |
| vector< NOX::Abstract::MultiVector * > | multiVectorPtrs |
| Array of multi-vector pointers, one for each block ROW. | |
| vector< NOX::Abstract::MultiVector::DenseMatrix * > | scalarVectorPtrs |
| Array of scalars, one for each COLUMN. | |
| vector< LOCA::Extended::Vector * > | extendedVectorPtrs |
| Pointers to each column as a LOCA::Extended::Vector. | |
| bool | isView |
| Flag indicating whether this multivec was created as a view. | |
Friends | |
| class | Vector |
| Declare LOCA::Extended::Vector as a friend class. | |
|
|
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". Note that there is no assumption that a vector created by ShapeCopy is initialized to zeros.
|
|
|
Array of scalars, one for each COLUMN. We store the scalar vectors column wise instead of row wise because for all but the matrix multiplication method, it is more efficient. This is also the only way to get sub-vector views efficiently. |
1.3.9.1