|
ML Version of the Day
|
Basic class for distributed double-precision vectors. More...
#include <MLAPI_MultiVector.h>


Public Member Functions | |
| MultiVector () | |
| Default constructor. | |
| MultiVector (const Space &VectorSpace, const int NumVectors=1, bool SetToZero=true) | |
| Constructor for a given Space. | |
| MultiVector (const Space &VectorSpace, double **Values, const int NumVectors=1) | |
| Constructor with a given Space, and user-provided array of values. | |
| MultiVector (const Space &VectorSpace, Teuchos::RefCountPtr< DoubleVector > RCPValues) | |
| Constructor with a given Space, and user-provided RefCountPtr. | |
| MultiVector (const Space &VectorSpace, std::vector< Teuchos::RefCountPtr< DoubleVector > > RCPValues) | |
| Constructor with a given Space, and user-provided array of values. | |
| MultiVector (const MultiVector &rhs) | |
| Copy constructor. | |
| ~MultiVector () | |
| Destructor. | |
| void | Reshape () |
Resets this object. | |
| void | Reshape (const Space &S, const int NumVectors=1, const bool SetToZero=true) |
| Sets the space of this vector. | |
| void | Append (const int NumVectors=1, const bool SetToZero=true) |
| Appends a new vector. | |
| void | Append (const MultiVector &rhs) |
| Appends a new vector. | |
| void | Delete (const int v) |
| Deletes the last vector. | |
| MultiVector & | operator= (double rhs) |
Sets all elements of this vector to rhs. | |
| MultiVector & | operator= (const MultiVector &rhs) |
Copies the rhs into this object. | |
| MultiVector & | operator= (const BaseLinearCombination &rhs) |
| Sets the elements from the input BaseLinearCombination. | |
| bool | operator== (const MultiVector &) const |
| MultiVector & | operator= (const std::string &Label) |
Sets the name of this object, does not touch vector elements or space. | |
| const double & | operator() (const int i) const |
Returns the value of local element i (const version). | |
| double & | operator() (const int i) |
Returns the value of local element i (non-const version). | |
| const double & | operator() (const int i, const int v) const |
Returns the value of local element i. | |
| double & | operator() (const int i, const int v) |
Returns the value of local element i (non-const version). | |
| const Space & | GetVectorSpace () const |
Returns the Space on which this vector is defined. | |
| Space & | GetVectorSpace () |
Returns the Space on which this vector is defined (non-const). | |
| int | GetNumVectors () const |
| Returns the number of vectors. | |
| int | GetMyLength () const |
| Returns the local length of each vector. | |
| int | GetGlobalLength () const |
| Returns the global length of each vector. | |
| double * | GetValues (const int v) |
| Returns a pointer to the double array (non-const version). | |
| const double * | GetValues (const int v) const |
| Returns a pointer to the double array (const version). | |
| Teuchos::RefCountPtr< DoubleVector > & | GetRCPValues (const int v) |
| Returns a pointer to the double array (non-const version). | |
| const Teuchos::RefCountPtr< DoubleVector > & | GetRCPValues (const int v) const |
| Returns a pointer to the double array (const version). | |
| void | SetRCPValues (const Teuchos::RefCountPtr< DoubleVector > &RCPValues, const int v) |
| Sets the RefCountPtr<Values_>. | |
| void | Update (const double alpha, int v=-1) |
| Sets this(v) = rhs. | |
| void | Update (const MultiVector &rhs) |
| Sets this = rhs. | |
| void | Update (double alpha, const MultiVector &rhs) |
| Sets this = alpha * rhs. | |
| void | Update (double alpha, const MultiVector &x, double beta, const MultiVector &y) |
| Sets this = alpha * x + beta * y. | |
| void | Update (double alpha, const MultiVector &rhs, double beta) |
| Sets this = alpha * rhs + beta * this. | |
| double | DotProduct (const MultiVector &rhs, int v=-1) const |
Computes the dot product between this vector and rhs. | |
| double | Norm2 (int v=-1) const |
Computes the 2-norm of this vector. | |
| double | NormInf (int v=-1) const |
Computes the infinite norm of this vector. | |
| double | NormOne (int v=-1) const |
Computes the one norm of this vector. | |
| void | Reciprocal (int v=-1) |
| Replaces each element of the vector with its reciprocal. | |
| void | Scale (const double Factor, int v=-1) |
| Scales each element by the specified factor. | |
| void | Random (int v=-1) |
| Populates the vector with random elements. | |
| void | Sort (int v=-1, const bool IsIncreasing=false) |
| Sorts the component of the vector. | |
| virtual std::ostream & | Print (std::ostream &os, const bool verbose=true) const |
Prints basic information about this object on std::ostream. | |
| bool | IsAlias (const MultiVector &rhs) const |
| Public Member Functions inherited from MLAPI::BaseObject | |
| BaseObject () | |
| Constructor with empty label. | |
| BaseObject (const std::string &Label) | |
| Constructor with given Label. | |
| virtual | ~BaseObject () |
| Destructor. | |
| void | SetLabel (const std::string &Label) |
Sets the Label of this object to Label. | |
| const std::string & | GetLabel () const |
| Returns the Label of this object. | |
| Public Member Functions inherited from MLAPI::CompObject | |
| CompObject () | |
| Constructor, set counter to 0.0. | |
| ~CompObject () | |
| Destructor. | |
| double | GetFlops () const |
| Returns the internal counter of flops. | |
| void | SetFlops (double Flops) const |
Sets internal counter to Flops. | |
| void | UpdateFlops (double Flops) const |
Updates internal counter by summing Flops. | |
| Public Member Functions inherited from MLAPI::TimeObject | |
| TimeObject () | |
| Constructor, set counter to 0.0. | |
| ~TimeObject () | |
| Destructor. | |
| void | ResetTimer () const |
| Resets the internal timer. | |
| void | UpdateTime () const |
| Updates the internal timer with the time spent since the last call to ResetTimer(). | |
| void | UpdateTime (double t) const |
Updates the internal timer with input value t. | |
| double | GetTime () const |
| Returns the internally stored counter. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, MultiVector const &mv) |
Additional Inherited Members | |
| Protected Attributes inherited from MLAPI::TimeObject | |
| Epetra_Time | Time_ |
| Object used to track time. | |
| double | TotalTime_ |
| Internal counter. | |
Basic class for distributed double-precision vectors.
|
inline |
Default constructor.
Referenced by Append(), DotProduct(), MultiVector(), operator=(), operator=(), operator=(), operator=(), Update(), Update(), Update(), and Update().
|
inline |
Constructor for a given Space.
References GetMyLength(), and SetRCPValues().
|
inline |
Constructor with a given Space, and user-provided array of values.
References GetNumVectors(), and SetRCPValues().
|
inline |
Constructor with a given Space, and user-provided RefCountPtr.
References GetNumVectors(), and SetRCPValues().
|
inline |
Constructor with a given Space, and user-provided array of values.
References GetNumVectors(), and SetRCPValues().
|
inline |
Copy constructor.
References GetNumVectors(), GetRCPValues(), GetVectorSpace(), MultiVector(), and SetRCPValues().
|
inline |
Destructor.
References GetNumVectors(), and SetRCPValues().
|
inline |
Appends a new vector.
References GetMyLength(), GetNumVectors(), and Update().
Referenced by MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace().
|
inline |
Appends a new vector.
References GetNumVectors(), GetRCPValues(), and MultiVector().
|
inline |
Deletes the last vector.
References GetNumVectors(), and GetRCPValues().
Referenced by MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace().
|
inline |
Computes the dot product between this vector and rhs.
References GetGlobalLength(), MLAPI::GetML_Comm(), GetMyLength(), GetNumVectors(), GetValues(), GetVectorSpace(), MultiVector(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Returns the global length of each vector.
Referenced by DotProduct(), Norm2(), Print(), Reciprocal(), Scale(), MLAPI::MultiLevelAdaptiveSA::SolveMultiLevelSA(), MLAPI::MultiLevelSA::SolveMultiLevelSA(), Update(), and Update().
|
inline |
Returns the local length of each vector.
Referenced by Append(), MLAPI::LoadBalanceOperator::Apply(), MLAPI::Operator::Apply(), MLAPI::MultiLevelAdaptiveSA::Compute(), MLAPI::MultiLevelSA::Compute(), DotProduct(), MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), MultiVector(), Norm2(), NormInf(), NormOne(), operator=(), Print(), Random(), Reciprocal(), Reshape(), Scale(), MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace(), Sort(), Update(), Update(), Update(), Update(), and Update().
|
inline |
Returns the number of vectors.
Referenced by Append(), Append(), MLAPI::LoadBalanceOperator::Apply(), MLAPI::Operator::Apply(), MLAPI::MultiLevelAdaptiveSA::Compute(), MLAPI::MultiLevelSA::Compute(), Delete(), DotProduct(), MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), MultiVector(), MultiVector(), MultiVector(), MultiVector(), MLAPI::MATLABStream::operator<<(), operator=(), operator=(), Print(), Reshape(), Reshape(), MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace(), Update(), Update(), Update(), Update(), Update(), and ~MultiVector().
|
inline |
Returns a pointer to the double array (non-const version).
Referenced by Append(), Delete(), MultiVector(), and operator=().
|
inline |
Returns a pointer to the double array (non-const version).
Referenced by MLAPI::EpetraBaseOperator::Apply(), DotProduct(), Norm2(), NormInf(), NormOne(), operator()(), operator()(), operator()(), operator()(), operator=(), Random(), Reciprocal(), Scale(), Update(), Update(), Update(), Update(), and Update().
|
inline |
Returns the Space on which this vector is defined.
Referenced by MLAPI::LoadBalanceOperator::Apply(), MLAPI::Operator::Apply(), DotProduct(), MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), MultiVector(), MLAPI::MATLABStream::operator<<(), operator=(), Print(), and Reshape().
|
inline |
Computes the 2-norm of this vector.
References GetGlobalLength(), MLAPI::GetML_Comm(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Computes the infinite norm of this vector.
References MLAPI::GetML_Comm(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
Referenced by MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), and MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace().
|
inline |
Computes the one norm of this vector.
References MLAPI::GetML_Comm(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Returns the value of local element i (non-const version).
References GetValues().
|
inline |
Returns the value of local element i (const version).
References GetValues().
|
inline |
Returns the value of local element i (non-const version).
References GetValues().
|
inline |
Returns the value of local element i.
References GetValues().
|
inline |
Sets the elements from the input BaseLinearCombination.
References MultiVector().
|
inline |
Copies the rhs into this object.
References MLAPI::BaseObject::GetLabel(), GetNumVectors(), GetRCPValues(), GetVectorSpace(), MultiVector(), MLAPI::BaseObject::SetLabel(), and SetRCPValues().
|
inline |
Sets the name of this object, does not touch vector elements or space.
References MultiVector(), and MLAPI::BaseObject::SetLabel().
|
inline |
Sets all elements of this vector to rhs.
References GetMyLength(), GetNumVectors(), GetValues(), and MultiVector().
|
inlinevirtual |
Prints basic information about this object on std::ostream.
Implements MLAPI::BaseObject.
References MLAPI::Barrier(), MLAPI::CompObject::GetFlops(), GetGlobalLength(), MLAPI::BaseObject::GetLabel(), GetMyLength(), MLAPI::GetMyPID(), MLAPI::GetNumProcs(), GetNumVectors(), MLAPI::TimeObject::GetTime(), GetVectorSpace(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Populates the vector with random elements.
References MLAPI::GetML_Comm(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
Referenced by MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), and MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace().
|
inline |
Replaces each element of the vector with its reciprocal.
References GetGlobalLength(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
Referenced by MLAPI::MultiLevelSA::Compute().
|
inline |
Resets this object.
References GetNumVectors(), GetVectorSpace(), MLAPI::Space::Reshape(), and SetRCPValues().
Referenced by MLAPI::MultiLevelAdaptiveSA::Compute(), MLAPI::MultiLevelSA::Compute(), MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), and MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace().
|
inline |
Sets the space of this vector.
References GetMyLength(), GetNumVectors(), and SetRCPValues().
|
inline |
Scales each element by the specified factor.
References GetGlobalLength(), GetMyLength(), GetValues(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
Referenced by MLAPI::MultiLevelSA::Compute(), MLAPI::MultiLevelAdaptiveSA::IncrementNullSpace(), and MLAPI::MultiLevelAdaptiveSA::SetupInitialNullSpace().
|
inline |
Sets the RefCountPtr<Values_>.
Referenced by MultiVector(), MultiVector(), MultiVector(), MultiVector(), MultiVector(), operator=(), Reshape(), Reshape(), and ~MultiVector().
|
inline |
Sorts the component of the vector.
References GetMyLength(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Sets this(v) = rhs.
References GetMyLength(), GetNumVectors(), and GetValues().
|
inline |
Sets this = rhs.
References GetMyLength(), GetNumVectors(), GetValues(), MultiVector(), MLAPI::TimeObject::ResetTimer(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Sets this = alpha * rhs.
References GetGlobalLength(), GetMyLength(), GetNumVectors(), GetValues(), MultiVector(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Sets this = alpha * rhs + beta * this.
References GetGlobalLength(), GetMyLength(), GetNumVectors(), GetValues(), MultiVector(), MLAPI::TimeObject::ResetTimer(), MLAPI::CompObject::UpdateFlops(), and MLAPI::TimeObject::UpdateTime().
|
inline |
Sets this = alpha * x + beta * y.
References GetMyLength(), GetNumVectors(), GetValues(), MultiVector(), MLAPI::TimeObject::ResetTimer(), Update(), and MLAPI::TimeObject::UpdateTime().