#include <Tpetra_VectorDecl.hpp>
Inheritance diagram for Tpetra::Vector< Ordinal, Scalar >:

Public Member Functions | |
Constructor/Destructor Methods | |
| Vector (const Map< Ordinal > &map) | |
| Sets all vector entries to zero. | |
| Vector (const Teuchos::ArrayView< const Scalar > &values, const Map< Ordinal > &map) | |
| Set object values from user array. Throws an exception if an incorrect number of entries are specified. | |
| Vector (const Vector< Ordinal, Scalar > &source) | |
| Copy constructor. | |
| ~Vector () | |
| Destructor. | |
Post-Construction Modification Routines | |
| void | submitEntries (const Teuchos::ArrayView< const Ordinal > &indices, const Teuchos::ArrayView< const Scalar > &values) |
| Submit entries. Values submitted will be summed with existing values. | |
| void | setAllToScalar (const Scalar &value) |
| Set all entries to scalarValue. | |
| void | setAllToRandom () |
| Set all entries to random values. | |
Mathematical Methods | |
| Scalar | dotProduct (const Vector< Ordinal, Scalar > &x) const |
| Returns result of dot product, result = this.x. | |
| void | absoluteValue (const Vector< Ordinal, Scalar > &x) |
| Changes this vector to elementwise absolute values of x. | |
| void | reciprocal (const Vector< Ordinal, Scalar > &x) |
| Changes this vector to element-wise reciprocal values of x. | |
| void | scale (const Scalar &scalarThis) |
| Scale the current values of a vector, this = scalarThis*this. | |
| void | scale (const Scalar &scalarX, const Vector< Ordinal, Scalar > &x) |
| Replace vector values with scaled values of x, this = scalarX*x. | |
| void | update (const Scalar &scalarX, const Vector< Ordinal, Scalar > &x, const Scalar &scalarThis) |
| Update vector values with scaled values of x, this = scalarThis*this + scalarX*x. | |
| void | update (const Scalar &scalarX, const Vector< Ordinal, Scalar > &x, const Scalar &scalarY, const Vector< Ordinal, Scalar > &y, const Scalar &scalarThis) |
| Update vector with scaled values of x and y, this = scalarThis*this + scalarX*x + scalarY*y. | |
| Scalar | norm1 () const |
| Compute 1-norm of vector. | |
| Scalar | norm2 () const |
| Compute 2-norm of vector. | |
| Scalar | normInf () const |
| Compute Infinity-norm of vector. | |
| Scalar | normWeighted (const Vector< Ordinal, Scalar > &weights) const |
| Compute Weighted 2-norm (RMS Norm) of vector. | |
| Scalar | minValue () const |
| Compute minimum value of vector. | |
| Scalar | maxValue () const |
| Compute maximum value of vector. | |
| Scalar | meanValue () const |
| Compute mean (average) value of vector. | |
| void | elementwiseMultiply (const Scalar &scalarXY, const Vector< Ordinal, Scalar > &x, const Vector< Ordinal, Scalar > &y, const Scalar &scalarThis) |
| Vector multiplication (elementwise). | |
| void | elementwiseReciprocalMultiply (Scalar scalarXY, const Vector< Ordinal, Scalar > &x, const Vector< Ordinal, Scalar > &y, const Scalar &scalarThis) |
| Reciprocal multiply (elementwise). | |
Random number utilities | |
| const Scalar & | getSeed () const |
| Get seed. | |
| void | setSeed (const Scalar &seed) |
| Set seed. | |
Element access methods | |
| Scalar & | operator[] (Ordinal index) |
| [] operator, nonconst version | |
| const Scalar & | operator[] (Ordinal index) const |
| [] operator, const version | |
Attribute access methods | |
| Ordinal | getNumMyEntries () const |
| Returns number of vector entries owned by this image. | |
| Ordinal | getNumGlobalEntries () const |
| Returns number of vector entries across all images. | |
I/O methods | |
| void | print (std::ostream &os) const |
| Print method, used by overloaded << operator. | |
Misc. | |
| const Map< Ordinal > & | getMap () const |
| Returns a const reference to the VectorSpace this Vector belongs to. | |
| Vector< Ordinal, Scalar > & | operator= (const Vector< Ordinal, Scalar > &source) |
| Assignment Operator. | |
Expert/Developer Use Only. | |
Vector is templated on Scalar for the vector entries, and on Ordinal for the vector indices. A VectorSpace object is needed for all Vector objects.
Vector entries can only be accessed through their local index values. Global index values can be converted to local indices by using the VectorSpace::getLocalIndex method.
Note that for most of the mathematical methods that set this to the result of an operation on vectors passed as parameters, the this vector can be used as one of the parameters (unless otherwise specified).
Vector error codes (positive for non-fatal, negative for fatal):
| Tpetra::Vector< Ordinal, Scalar >::Vector | ( | const Map< Ordinal > & | map | ) |
Sets all vector entries to zero.
| Tpetra::Vector< Ordinal, Scalar >::Vector | ( | const Teuchos::ArrayView< const Scalar > & | values, | |
| const Map< Ordinal > & | map | |||
| ) |
Set object values from user array. Throws an exception if an incorrect number of entries are specified.
| Tpetra::Vector< Ordinal, Scalar >::Vector | ( | const Vector< Ordinal, Scalar > & | source | ) |
Copy constructor.
| Tpetra::Vector< Ordinal, Scalar >::~Vector | ( | ) |
Destructor.
| void Tpetra::Vector< Ordinal, Scalar >::submitEntries | ( | const Teuchos::ArrayView< const Ordinal > & | indices, | |
| const Teuchos::ArrayView< const Scalar > & | values | |||
| ) |
Submit entries. Values submitted will be summed with existing values.
| void Tpetra::Vector< Ordinal, Scalar >::setAllToScalar | ( | const Scalar & | value | ) |
Set all entries to scalarValue.
| void Tpetra::Vector< Ordinal, Scalar >::setAllToRandom | ( | ) |
Set all entries to random values.
| Scalar Tpetra::Vector< Ordinal, Scalar >::dotProduct | ( | const Vector< Ordinal, Scalar > & | x | ) | const |
Returns result of dot product, result = this.x.
| void Tpetra::Vector< Ordinal, Scalar >::absoluteValue | ( | const Vector< Ordinal, Scalar > & | x | ) |
Changes this vector to elementwise absolute values of x.
| void Tpetra::Vector< Ordinal, Scalar >::reciprocal | ( | const Vector< Ordinal, Scalar > & | x | ) |
Changes this vector to element-wise reciprocal values of x.
| void Tpetra::Vector< Ordinal, Scalar >::scale | ( | const Scalar & | scalarThis | ) |
Scale the current values of a vector, this = scalarThis*this.
| void Tpetra::Vector< Ordinal, Scalar >::scale | ( | const Scalar & | scalarX, | |
| const Vector< Ordinal, Scalar > & | x | |||
| ) |
Replace vector values with scaled values of x, this = scalarX*x.
| void Tpetra::Vector< Ordinal, Scalar >::update | ( | const Scalar & | scalarX, | |
| const Vector< Ordinal, Scalar > & | x, | |||
| const Scalar & | scalarThis | |||
| ) |
Update vector values with scaled values of x, this = scalarThis*this + scalarX*x.
| void Tpetra::Vector< Ordinal, Scalar >::update | ( | const Scalar & | scalarX, | |
| const Vector< Ordinal, Scalar > & | x, | |||
| const Scalar & | scalarY, | |||
| const Vector< Ordinal, Scalar > & | y, | |||
| const Scalar & | scalarThis | |||
| ) |
Update vector with scaled values of x and y, this = scalarThis*this + scalarX*x + scalarY*y.
| Scalar Tpetra::Vector< Ordinal, Scalar >::norm1 | ( | ) | const |
Compute 1-norm of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::norm2 | ( | ) | const |
Compute 2-norm of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::normInf | ( | ) | const |
Compute Infinity-norm of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::normWeighted | ( | const Vector< Ordinal, Scalar > & | weights | ) | const |
Compute Weighted 2-norm (RMS Norm) of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::minValue | ( | ) | const |
Compute minimum value of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::maxValue | ( | ) | const |
Compute maximum value of vector.
| Scalar Tpetra::Vector< Ordinal, Scalar >::meanValue | ( | ) | const |
Compute mean (average) value of vector.
| void Tpetra::Vector< Ordinal, Scalar >::elementwiseMultiply | ( | const Scalar & | scalarXY, | |
| const Vector< Ordinal, Scalar > & | x, | |||
| const Vector< Ordinal, Scalar > & | y, | |||
| const Scalar & | scalarThis | |||
| ) |
Vector multiplication (elementwise).
this = scalarThis*this + scalarXY*x, where @ represents elementwise multiplication.
| void Tpetra::Vector< Ordinal, Scalar >::elementwiseReciprocalMultiply | ( | Scalar | scalarXY, | |
| const Vector< Ordinal, Scalar > & | x, | |||
| const Vector< Ordinal, Scalar > & | y, | |||
| const Scalar & | scalarThis | |||
| ) |
Reciprocal multiply (elementwise).
this = scalarThis*this + scalarXY*y, where @ represents elementwise division.
| const Scalar & Tpetra::Vector< Ordinal, Scalar >::getSeed | ( | ) | const |
Get seed.
| void Tpetra::Vector< Ordinal, Scalar >::setSeed | ( | const Scalar & | seed | ) |
Set seed.
| Scalar & Tpetra::Vector< Ordinal, Scalar >::operator[] | ( | Ordinal | index | ) |
[] operator, nonconst version
| const Scalar & Tpetra::Vector< Ordinal, Scalar >::operator[] | ( | Ordinal | index | ) | const |
[] operator, const version
| Ordinal Tpetra::Vector< Ordinal, Scalar >::getNumMyEntries | ( | ) | const |
Returns number of vector entries owned by this image.
| Ordinal Tpetra::Vector< Ordinal, Scalar >::getNumGlobalEntries | ( | ) | const |
Returns number of vector entries across all images.
| void Tpetra::Vector< Ordinal, Scalar >::print | ( | std::ostream & | os | ) | const [virtual] |
Print method, used by overloaded << operator.
Reimplemented from Tpetra::DistObject< Ordinal, Scalar >.
| const Map< Ordinal > & Tpetra::Vector< Ordinal, Scalar >::getMap | ( | ) | const |
Returns a const reference to the VectorSpace this Vector belongs to.
Reimplemented from Tpetra::DistObject< Ordinal, Scalar >.
| Vector< Ordinal, Scalar > & Tpetra::Vector< Ordinal, Scalar >::operator= | ( | const Vector< Ordinal, Scalar > & | source | ) |
Assignment Operator.
1.4.7