|
Tpetra Matrix/Vector Services
Version of the Day
|
A distributed dense vector. More...
#include <Tpetra_Vector_decl.hpp>

Public Types | |
Typedefs to facilitate template metaprogramming. | |
| typedef Scalar | scalar_type |
| The type of entries in the vector(s). More... | |
| typedef LocalOrdinal | local_ordinal_type |
| The type of local indices. More... | |
| typedef GlobalOrdinal | global_ordinal_type |
| The type of global indices. More... | |
| typedef Node | node_type |
| The Kokkos Node type. More... | |
Typedefs | |
| typedef Scalar | packet_type |
| The type of each datum being sent or received in an Import or Export. More... | |
Public Member Functions | |
| virtual void | removeEmptyProcessesInPlace (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap) |
| Remove processes owning zero rows from the Map and their communicator. More... | |
Constructor/Destructor Methods | |
| Vector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true) | |
| Sets all vector entries to zero. More... | |
| Vector (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source) | |
| Vector copy constructor. More... | |
| Vector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const ArrayView< const Scalar > &A) | |
| Set vector values from an existing array (copy) More... | |
| virtual | ~Vector () |
| Destructor. More... | |
Post-construction modification routines | |
| void | replaceGlobalValue (GlobalOrdinal globalRow, const Scalar &value) |
| Replace current value at the specified location with specified value. More... | |
| void | sumIntoGlobalValue (GlobalOrdinal globalRow, const Scalar &value) |
| Adds specified value to existing value at the specified location. More... | |
| void | replaceLocalValue (LocalOrdinal myRow, const Scalar &value) |
| Replace current value at the specified location with specified values. More... | |
| void | sumIntoLocalValue (LocalOrdinal myRow, const Scalar &value) |
| Adds specified value to existing value at the specified location. More... | |
Extraction methods | |
| void | get1dCopy (ArrayView< Scalar > A) const |
| Return multi-vector values in user-provided two-dimensional array (using Teuchos memory management classes). More... | |
| Teuchos::ArrayRCP< Scalar > | getDataNonConst () |
| View of the local values of this vector. More... | |
| Teuchos::ArrayRCP< const Scalar > | getData () const |
| Const view of the local values of this vector. More... | |
Mathematical methods | |
| Scalar | dot (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const |
| Computes dot product of this Vector against input Vector x. More... | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | norm1 () const |
| Return 1-norm of this Vector. More... | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | norm2 () const |
| Compute 2-norm of this Vector. More... | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | normInf () const |
| Compute Inf-norm of this Vector. More... | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | normWeighted (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const |
| Compute Weighted 2-norm (RMS Norm) of this Vector. More... | |
| Scalar | meanValue () const |
| Compute mean (average) value of this Vector. More... | |
Implementation of the Teuchos::Describable interface | |
| virtual std::string | description () const |
| A simple one-line description of this object. More... | |
| virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
| Print the object with some verbosity level to a FancyOStream. More... | |
Post-construction modification routines | |
| void | replaceGlobalValue (GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) |
| Replace value, using global (row) index. More... | |
| void | sumIntoGlobalValue (GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) |
| Add value to existing value, using global (row) index. More... | |
| void | replaceLocalValue (LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) |
| Replace value, using local (row) index. More... | |
| void | sumIntoLocalValue (LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) |
| Add value to existing value, using local (row) index. More... | |
| void | putScalar (const Scalar &value) |
| Set all values in the multivector with the given value. More... | |
| void | randomize () |
| Set all values in the multivector to pseudorandom numbers. More... | |
| void | replaceMap (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map) |
| Replace the underlying Map in place. More... | |
| void | reduce () |
| Sum values of a locally replicated multivector across all processes. More... | |
Data Copy and View get methods | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subCopy (const Teuchos::Range1D &colRng) const |
| Return a MultiVector with copies of selected columns. More... | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subCopy (const Teuchos::ArrayView< const size_t > &cols) const |
| Return a MultiVector with copies of selected columns. More... | |
| Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subView (const Teuchos::Range1D &colRng) const |
| Return a const MultiVector with const views of selected columns. More... | |
| Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subView (const Teuchos::ArrayView< const size_t > &cols) const |
| Return a const MultiVector with const views of selected columns. More... | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subViewNonConst (const Teuchos::Range1D &colRng) |
| Return a MultiVector with views of selected columns. More... | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | subViewNonConst (const Teuchos::ArrayView< const size_t > &cols) |
| Return a MultiVector with views of selected columns. More... | |
| Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | offsetView (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &subMap, size_t offset) const |
| Return a const MultiVector view of a subset of rows. More... | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | offsetViewNonConst (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &subMap, size_t offset) |
| Return a non-const MultiVector view of a subset of rows. More... | |
| Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | getVector (size_t j) const |
| Return a Vector which is a const view of column j. More... | |
| Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | getVectorNonConst (size_t j) |
| Return a Vector which is a nonconst view of column j. More... | |
| Teuchos::ArrayRCP< const Scalar > | getData (size_t j) const |
| Const view of the local values in a particular vector of this multivector. More... | |
| Teuchos::ArrayRCP< Scalar > | getDataNonConst (size_t j) |
| View of the local values in a particular vector of this multivector. More... | |
| void | get1dCopy (Teuchos::ArrayView< Scalar > A, size_t LDA) const |
| Fill the given array with a copy of this multivector's local values. More... | |
| void | get2dCopy (Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > ArrayOfPtrs) const |
| Fill the given array with a copy of this multivector's local values. More... | |
| Teuchos::ArrayRCP< const Scalar > | get1dView () const |
| Const persisting (1-D) view of this multivector's local values. More... | |
| Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > | get2dView () const |
| Return const persisting pointers to values. More... | |
| Teuchos::ArrayRCP< Scalar > | get1dViewNonConst () |
| Nonconst persisting (1-D) view of this multivector's local values. More... | |
| Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > | get2dViewNonConst () |
| Return non-const persisting pointers to values. More... | |
| const Kokkos::MultiVector< Scalar, Node > & | getLocalMV () const |
| Return a const reference to the underlying Kokkos::MultiVector object (advanced use only) More... | |
| Kokkos::MultiVector< Scalar, Node > & | getLocalMVNonConst () |
| Return a non-const reference to the underlying Kokkos::MultiVector object (advanced use only) More... | |
Mathematical methods | |
| void | dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const |
| Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]) More... | |
| void | abs (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A) |
| Put element-wise absolute values of input Multi-vector in target: A = abs(this) More... | |
| void | reciprocal (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A) |
| Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j). More... | |
| void | scale (const Scalar &alpha) |
Scale in place: this = alpha*this. More... | |
| void | scale (Teuchos::ArrayView< const Scalar > alpha) |
Scale each column in place: this[j] = alpha[j]*this[j]. More... | |
| void | scale (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A) |
Scale in place: this = alpha * A. More... | |
| void | update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta) |
Update: this = beta*this + alpha*A. More... | |
| void | update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &gamma) |
Update: this = gamma*this + alpha*A + beta*B. More... | |
| void | norm1 (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const |
| Compute 1-norm of each vector in multi-vector. More... | |
| void | norm2 (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const |
| void | normInf (const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const |
| Compute Inf-norm of each vector in multi-vector. More... | |
| void | normWeighted (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights, const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const |
| void | meanValue (const Teuchos::ArrayView< Scalar > &means) const |
| Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int). More... | |
| void | multiply (Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta) |
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B). More... | |
| void | elementWiseMultiply (Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis) |
| Multiply a Vector A elementwise by a MultiVector B. More... | |
Attribute access functions | |
| size_t | getNumVectors () const |
| Number of columns in the multivector. More... | |
| size_t | getLocalLength () const |
| Local number of rows on the calling process. More... | |
| global_size_t | getGlobalLength () const |
| Global number of rows in the multivector. More... | |
| size_t | getStride () const |
| Stride between columns in the multivector. More... | |
| bool | isConstantStride () const |
| Whether this multivector has constant stride between columns. More... | |
Public methods for redistributing data | |
| void | doImport (const SrcDistObject &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM) |
| Import data into this object using an Import object ("forward mode"). More... | |
| void | doImport (const SrcDistObject &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM) |
| Import data into this object using an Export object ("reverse mode"). More... | |
| void | doExport (const SrcDistObject &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM) |
| Export data into this object using an Export object ("forward mode"). More... | |
| void | doExport (const SrcDistObject &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM) |
| Export data into this object using an Import object ("reverse mode"). More... | |
Attribute accessor methods | |
| bool | isDistributed () const |
| Whether this is a globally distributed object. More... | |
| const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & | getMap () const |
| The Map describing the parallel distribution of this object. More... | |
I/O methods | |
| void | print (std::ostream &os) const |
| Print this object to the given output stream. More... | |
Protected Member Functions | |
| Vector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const ArrayRCP< Scalar > &data) | |
| Advanced constructor accepting parallel buffer view, used by MultiVector to break off Vector objects. More... | |
| Vector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const ArrayRCP< Scalar > &data, EPrivateComputeViewConstructor) | |
| Advanced constructor accepting parallel buffer view, used by MultiVector to break off Vector objects. More... | |
| virtual void | doTransfer (const SrcDistObject &src, CombineMode CM, size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs, const Teuchos::ArrayView< const LocalOrdinal > &remoteLIDs, const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Distributor &distor, ReverseOption revOp) |
| Redistribute data across memory images. More... | |
View constructors, used only by nonmember constructors. | |
| bool | vectorIndexOutOfRange (size_t VectorIndex) const |
| template<class T > | |
| ArrayRCP< T > | getSubArrayRCP (ArrayRCP< T > arr, size_t j) const |
| Persisting view of j-th column in the given ArrayRCP. More... | |
Protected Attributes | |
| KMV | lclMV_ |
| The Kokkos::MultiVector containing the compute buffer of data. More... | |
| Array< size_t > | whichVectors_ |
| Indices of columns this multivector is viewing. More... | |
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > | map_ |
| The Map over which this object is distributed. More... | |
Instance data for tracking efficiency warnings | |
| bool | releaseViewsRaisedEfficiencyWarning_ |
| Whether releaseViews() has yet raised an efficiency warning. More... | |
| bool | createViewsRaisedEfficiencyWarning_ |
| Whether createViews() has yet raised an efficiency warning. More... | |
| bool | createViewsNonConstRaisedEfficiencyWarning_ |
| Whether createViewsNonConst() has yet raised an efficiency warning. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | createMultiVectorFromView (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayRCP< Scalar > &view, size_t LDA, size_t numVectors) |
| Nonmember MultiVector constructor with view semantics using user-allocated data. More... | |
| template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node > | |
| RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | createVector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map) |
| Non-member function to create a Vector from a specified Map. More... | |
| template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node > | |
| RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | createVectorFromView (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const ArrayRCP< Scalar > &view) |
| Non-member function to create a Vector with view semantics using user-allocated data. More... | |
| template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | createMultiVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t numVectors) |
| Nonmember MultiVector constructor: make a MultiVector from a given Map. More... | |
Implementation of Tpetra::DistObject | |
| virtual bool | checkSizes (const SrcDistObject &sourceObj) |
Whether data redistribution between sourceObj and this object is legal. More... | |
| virtual void | copyAndPermute (const SrcDistObject &sourceObj, size_t numSameIDs, const ArrayView< const LocalOrdinal > &permuteToLIDs, const ArrayView< const LocalOrdinal > &permuteFromLIDs) |
| Perform copies and permutations that are local to this process. More... | |
| virtual size_t | constantNumberOfPackets () const |
| Number of packets to send per LID. More... | |
| virtual void | packAndPrepare (const SrcDistObject &sourceObj, const ArrayView< const LocalOrdinal > &exportLIDs, Array< Scalar > &exports, const ArrayView< size_t > &numExportPacketsPerLID, size_t &constantNumPackets, Distributor &distor) |
| Perform any packing or preparation required for communication. More... | |
| virtual void | unpackAndCombine (const ArrayView< const LocalOrdinal > &importLIDs, const ArrayView< const Scalar > &imports, const ArrayView< size_t > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM) |
| Perform any unpacking and combining after communication. More... | |
| void | createViews () const |
| Hook for creating a const view. More... | |
| void | createViewsNonConst (Kokkos::ReadWriteOption rwo) |
| Hook for creating a nonconst view. More... | |
| void | releaseViews () const |
| Hook for releasing views. More... | |
| ArrayRCP< Scalar > | ncview_ |
| Nonconst host view created in createViewsNonConst(). More... | |
| ArrayRCP< const Scalar > | cview_ |
| Const host view created in createViews(). More... | |
A distributed dense vector.
This class inherits from MultiVector, and has the same template parameters. A Vector is a special case of a MultiVector that has only one vector (column). It may be used wherever a MultiVector may be used.
Definition at line 61 of file Tpetra_Vector_decl.hpp.
|
inherited |
The type of entries in the vector(s).
Definition at line 331 of file Tpetra_MultiVector_decl.hpp.
|
inherited |
The type of local indices.
Definition at line 333 of file Tpetra_MultiVector_decl.hpp.
|
inherited |
The type of global indices.
Definition at line 335 of file Tpetra_MultiVector_decl.hpp.
|
inherited |
The Kokkos Node type.
Definition at line 337 of file Tpetra_MultiVector_decl.hpp.
|
inherited |
The type of each datum being sent or received in an Import or Export.
Note that this type does not always correspond to the Scalar template parameter of subclasses.
Definition at line 183 of file Tpetra_DistObject_decl.hpp.
|
protectedinherited |
Whether the data transfer should be performed in forward or reverse mode.
"Reverse mode" means calling doExport() with an Import object, or calling doImport() with an Export object. "Forward mode" means calling doExport() with an Export object, or calling doImport() with an Import object.
Definition at line 418 of file Tpetra_DistObject_decl.hpp.
|
explicit |
Sets all vector entries to zero.
Definition at line 56 of file Tpetra_Vector_def.hpp.
| Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Vector | ( | const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & | source | ) |
Vector copy constructor.
Definition at line 61 of file Tpetra_Vector_def.hpp.
| Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Vector | ( | const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & | map, |
| const ArrayView< const Scalar > & | A | ||
| ) |
Set vector values from an existing array (copy)
Definition at line 80 of file Tpetra_Vector_def.hpp.
|
virtual |
Destructor.
Definition at line 85 of file Tpetra_Vector_def.hpp.
|
protected |
Advanced constructor accepting parallel buffer view, used by MultiVector to break off Vector objects.
|
protected |
Advanced constructor accepting parallel buffer view, used by MultiVector to break off Vector objects.
Definition at line 73 of file Tpetra_Vector_def.hpp.
| void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::replaceGlobalValue | ( | GlobalOrdinal | globalRow, |
| const Scalar & | value | ||
| ) |
Replace current value at the specified location with specified value.
globalRow must be a valid global element on this node, according to the row map. Definition at line 88 of file Tpetra_Vector_def.hpp.
| void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sumIntoGlobalValue | ( | GlobalOrdinal | globalRow, |
| const Scalar & | value | ||
| ) |
Adds specified value to existing value at the specified location.
globalRow must be a valid global element on this node, according to the row map. Definition at line 93 of file Tpetra_Vector_def.hpp.
| void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::replaceLocalValue | ( | LocalOrdinal | myRow, |
| const Scalar & | value | ||
| ) |
Replace current value at the specified location with specified values.
localRow must be a valid local element on this node, according to the row map. Definition at line 98 of file Tpetra_Vector_def.hpp.
| void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sumIntoLocalValue | ( | LocalOrdinal | myRow, |
| const Scalar & | value | ||
| ) |
Adds specified value to existing value at the specified location.
localRow must be a valid local element on this node, according to the row map. Definition at line 103 of file Tpetra_Vector_def.hpp.
| void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::get1dCopy | ( | ArrayView< Scalar > | A | ) | const |
Return multi-vector values in user-provided two-dimensional array (using Teuchos memory management classes).
Definition at line 108 of file Tpetra_Vector_def.hpp.
|
inline |
View of the local values of this vector.
Definition at line 115 of file Tpetra_Vector_decl.hpp.
|
inline |
Const view of the local values of this vector.
Definition at line 119 of file Tpetra_Vector_decl.hpp.
| Scalar Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dot | ( | const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & | a | ) | const |
Computes dot product of this Vector against input Vector x.
Definition at line 114 of file Tpetra_Vector_def.hpp.
| Teuchos::ScalarTraits< Scalar >::magnitudeType Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::norm1 | ( | ) | const |
Return 1-norm of this Vector.
Definition at line 152 of file Tpetra_Vector_def.hpp.
| Teuchos::ScalarTraits< Scalar >::magnitudeType Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::norm2 | ( | ) | const |
Compute 2-norm of this Vector.
Definition at line 164 of file Tpetra_Vector_def.hpp.
| Teuchos::ScalarTraits< Scalar >::magnitudeType Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::normInf | ( | ) | const |
Compute Inf-norm of this Vector.
Definition at line 177 of file Tpetra_Vector_def.hpp.
| Teuchos::ScalarTraits< Scalar >::magnitudeType Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::normWeighted | ( | const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & | weights | ) | const |
Compute Weighted 2-norm (RMS Norm) of this Vector.
Definition at line 189 of file Tpetra_Vector_def.hpp.
| Scalar Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::meanValue | ( | ) | const |
Compute mean (average) value of this Vector.
Definition at line 135 of file Tpetra_Vector_def.hpp.
|
virtual |
A simple one-line description of this object.
Reimplemented from Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 211 of file Tpetra_Vector_def.hpp.
|
virtual |
Print the object with some verbosity level to a FancyOStream.
Reimplemented from Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 220 of file Tpetra_Vector_def.hpp.
|
inherited |
Replace value, using global (row) index.
Replace the current value at row globalRow (a global index) and column vectorIndex with the given value. The column index is zero based.
globalRow must be a valid global element on this process, according to the row Map. Definition at line 2371 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Add value to existing value, using global (row) index.
Add the given value to the existing value at row globalRow (a global index) and column vectorIndex. The column index is zero based.
globalRow must be a valid global element on this process, according to the row Map. Definition at line 2395 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Replace value, using local (row) index.
Replace the current value at row myRow (a local index) and column vectorIndex with the given value. The column index is zero based.
myRow must be a valid local element on this process, according to the row Map. Definition at line 2313 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Add value to existing value, using local (row) index.
Add the given value to the existing value at row myRow (a local index) and column vectorIndex. The column index is zero based.
myRow must be a valid local element on this process, according to the row Map. Definition at line 2342 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Set all values in the multivector with the given value.
Definition at line 1116 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Set all values in the multivector to pseudorandom numbers.
srand() and rand().Definition at line 1095 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Replace the underlying Map in place.
map->isCompatible (this->getMap ()). "Similar" means that the communicators have the same number of processes, though these need not be in the same order (have the same assignments of ranks) or represent the same communication contexts. It means the same thing as the MPI_SIMILAR return value of MPI_COMM_COMPARE. See MPI 3.0 Standard, Section 6.4.1.This method replaces this object's Map with the given Map. This relabels the rows of the multivector using the global IDs in the input Map. Thus, it implicitly applies a permutation, without actually moving data. If the new Map's communicator has more processes than the original Map's communicator, it "projects" the MultiVector onto the new Map by filling in missing rows with zeros. If the new Map's communicator has fewer processes than the original Map's communicator, the method "forgets about" any rows that do not exist in the new Map. (It mathematical terms, if one considers a MultiVector as a function from one vector space to another, this operation restricts the range.)
This method must always be called collectively on the communicator with the largest number of processes: either this object's current communicator (this->getMap()->getComm()), or the new Map's communicator (map->getComm()). If the new Map's communicator has fewer processes, then the new Map must be null on processes excluded from the original communicator, and the current Map must be nonnull on all processes. If the new Map has more processes, then it must be nonnull on all those processes, and the original Map must be null on those processes which are not in the new Map's communicator. (The latter case can only happen to a MultiVector to which a replaceMap() operation has happened before.)
this->getMap ()->getComm ()). We reserve the right to do checking in debug mode that requires this method to be called collectively in order not to deadlock.Definition at line 1137 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Sum values of a locally replicated multivector across all processes.
Definition at line 2244 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a MultiVector with copies of selected columns.
These methods are used to get the data underlying the MultiVector. They return data in one of three forms:
Definition at line 1603 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a MultiVector with copies of selected columns.
Definition at line 1576 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a const MultiVector with const views of selected columns.
Definition at line 1761 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a const MultiVector with const views of selected columns.
Definition at line 1708 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a MultiVector with views of selected columns.
Definition at line 1822 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a MultiVector with views of selected columns.
Definition at line 1795 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a const MultiVector view of a subset of rows.
Return a const view of this MultiVector consisting of a subset of the rows, as specified by an offset and a subset Map of this MultiVector's current row Map.
| In | subMap - The row Map for the new MultiVector. |
| In | offset - The offset into the data of (*this). |
subMap->getNodeNumElements() + offset < this->getLocalLength() Definition at line 1630 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a non-const MultiVector view of a subset of rows.
Returns a non-const view of this MultiVector consisting of a subset of the rows, as specified by an offset and a subset Map of this MultiVector's current row Map.
| In | subMap - The row Map for the new MultiVector. |
| In | offset - The offset into the data of (*this). |
subMap->getNodeNumElements() + offset < this->getLocalLength() Definition at line 1669 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a Vector which is a const view of column j.
Definition at line 1855 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a Vector which is a nonconst view of column j.
Definition at line 1880 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Const view of the local values in a particular vector of this multivector.
Definition at line 1514 of file Tpetra_MultiVector_def.hpp.
|
inherited |
View of the local values in a particular vector of this multivector.
Definition at line 1525 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Fill the given array with a copy of this multivector's local values.
| A | [out] View of the array to fill. We consider A as a matrix with column-major storage. |
| LDA | [in] Leading dimension of the matrix A. |
Definition at line 1901 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Fill the given array with a copy of this multivector's local values.
| ArrayOfPtrs | [out] Array of arrays, one for each column of the multivector. On output, we fill ArrayOfPtrs[j] with the data for column j of this multivector. |
Definition at line 1936 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Const persisting (1-D) view of this multivector's local values.
This method assumes that the columns of the multivector are stored contiguously. If not, this method throws std::runtime_error.
Definition at line 1970 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return const persisting pointers to values.
Definition at line 2034 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Nonconst persisting (1-D) view of this multivector's local values.
This method assumes that the columns of the multivector are stored contiguously. If not, this method throws std::runtime_error.
Definition at line 1982 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return non-const persisting pointers to values.
Definition at line 1994 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a const reference to the underlying Kokkos::MultiVector object (advanced use only)
Definition at line 2437 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Return a non-const reference to the underlying Kokkos::MultiVector object (advanced use only)
Definition at line 2443 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i])
Definition at line 806 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Put element-wise absolute values of input Multi-vector in target: A = abs(this)
Definition at line 1380 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
Definition at line 1333 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Scale in place: this = alpha*this.
Replace this MultiVector with alpha times this MultiVector. This method will always multiply, even if alpha is zero. That means, for example, that if *this contains NaN entries before calling this method, the NaN entries will remain after this method finishes.
Definition at line 1231 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Scale each column in place: this[j] = alpha[j]*this[j].
Replace each column j of this MultiVector with alpha[j] times the current column j of this MultiVector. This method will always multiply, even if all the entries of alpha are zero. That means, for example, that if *this contains NaN entries before calling this method, the NaN entries will remain after this method finishes.
Definition at line 1261 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Scale in place: this = alpha * A.
Replace this MultiVector with scaled values of A. This method will always multiply, even if alpha is zero. That means, for example, that if *this contains NaN entries before calling this method, the NaN entries will remain after this method finishes. It is legal for the input A to alias this MultiVector.
Definition at line 1290 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Update: this = beta*this + alpha*A.
Update this MultiVector with scaled values of A. If beta is zero, overwrite *this unconditionally, even if it contains NaN entries. It is legal for the input A to alias this MultiVector.
Definition at line 1418 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Update: this = gamma*this + alpha*A + beta*B.
Update this MultiVector with scaled values of A and B. If gamma is zero, overwrite *this unconditionally, even if it contains NaN entries. It is legal for the inputs A or B to alias this MultiVector.
Definition at line 1462 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute 1-norm of each vector in multi-vector.
Definition at line 973 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute 2-norm of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int).
Definition at line 855 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute Inf-norm of each vector in multi-vector.
Definition at line 1008 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute Weighted 2-norm (RMS Norm) of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int).
Definition at line 901 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined for non-floating point scalar types (e.g., int).
Definition at line 1043 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
If beta is zero, overwrite *this unconditionally, even if it contains NaN entries. This imitates the semantics of analogous BLAS routines like DGEMM.
Definition at line 2075 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Multiply a Vector A elementwise by a MultiVector B.
Compute this = scalarThis * this + scalarAB * B @ A where </tt> denotes element-wise multiplication. In pseudocode, if C denotes *this MultiVector:
for all rows i and columns j of C.
B must have the same dimensions as *this, while A must have the same number of rows but a single column.
Definition at line 2206 of file Tpetra_MultiVector_def.hpp.
|
inlineinherited |
Number of columns in the multivector.
Definition at line 793 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Local number of rows on the calling process.
Definition at line 421 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Global number of rows in the multivector.
Definition at line 427 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Stride between columns in the multivector.
This is only meaningful if isConstantStride() returns true.
Definition at line 433 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Whether this multivector has constant stride between columns.
Definition at line 415 of file Tpetra_MultiVector_def.hpp.
|
virtualinherited |
Remove processes owning zero rows from the Map and their communicator.
| newMap | [in] This must be the result of calling the removeEmptyProcesses() method on the row Map. If it is not, this method's behavior is undefined. This pointer will be null on excluded processes. |
Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 2635 of file Tpetra_MultiVector_def.hpp.
|
protectedinherited |
Persisting view of j-th column in the given ArrayRCP.
This method considers isConstantStride(). The ArrayRCP may correspond either to a compute buffer or a host view.
|
protectedvirtualinherited |
Whether data redistribution between sourceObj and this object is legal.
This method is called in DistObject::doTransfer() to check whether data redistribution between the two objects is legal.
Implements Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 444 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Perform copies and permutations that are local to this process.
| source | [in] On entry, the source object, from which we are distributing. We distribute to the destination object, which is *this object. |
| numSameIDs | [in] The umber of elements that are the same on the source and destination (this) objects. These elements are owned by the same process in both the source and destination objects. No permutation occurs. |
| numPermuteIDs | [in] The number of elements that are locally permuted between the source and destination objects. |
| permuteToLIDs | [in] List of the elements that are permuted. They are listed by their LID in the destination object. |
| permuteFromLIDs | [in] List of the elements that are permuted. They are listed by their LID in the source object. |
Implements Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 468 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Number of packets to send per LID.
Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 575 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Perform any packing or preparation required for communication.
| source | [in] Source object for the redistribution. |
| exportLIDs | [in] List of the entries (as local IDs in the source object) we will be sending to other images. |
| exports | [out] On exit, the buffer for data to send. |
| numPacketsPerLID | [out] On exit, the implementation of this method must do one of two things: set numPacketsPerLID[i] to contain the number of packets to be exported for exportLIDs[i] and set constantNumPackets to zero, or set constantNumPackets to a nonzero value. If the latter, the implementation need not fill numPacketsPerLID. |
| constantNumPackets | [out] On exit, 0 if numPacketsPerLID has variable contents (different size for each LID). If nonzero, then it is expected that the number of packets per LID is constant, and that constantNumPackets is that value. |
| distor | [in] The Distributor object we are using. |
Implements Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 583 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Perform any unpacking and combining after communication.
| importLIDs | [in] List of the entries (as LIDs in the destination object) we received from other images. |
| imports | [in] Buffer containing data we received. |
| numPacketsPerLID | [in] If constantNumPackets is zero, then numPacketsPerLID[i] contains the number of packets imported for importLIDs[i]. |
| constantNumPackets | [in] If nonzero, then numPacketsPerLID is constant (same value in all entries) and constantNumPackets is that value. If zero, then numPacketsPerLID[i] is the number of packets imported for importLIDs[i]. |
| distor | [in] The Distributor object we are using. |
| CM | [in] The combine mode to use when combining the imported entries with existing entries. |
Implements Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 666 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Hook for creating a const view.
doTransfer() calls this on the source object. By default, it does nothing, but the source object can use this as a hint to fetch data from a compute buffer on an off-CPU device (such as a GPU) into host memory.
Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 2542 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Hook for creating a nonconst view.
doTransfer() calls this on the destination (*this) object. By default, it does nothing, but the destination object can use this as a hint to fetch data from a compute buffer on an off-CPU device (such as a GPU) into host memory.
| rwo | [in] Whether to create a write-only or a read-and-write view. For Kokkos Node types where compute buffers live in a separate memory space (e.g., in the device memory of a discrete accelerator like a GPU), a write-only view only requires copying from host memory to the compute buffer, whereas a read-and-write view requires copying both ways (once to read, from the compute buffer to host memory, and once to write, back to the compute buffer). |
Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 2570 of file Tpetra_MultiVector_def.hpp.
|
protectedvirtualinherited |
Hook for releasing views.
doTransfer() calls this on both the source and destination objects, once it no longer needs to access that object's data. By default, this method does nothing. Implementations may use this as a hint to free host memory which is a view of a compute buffer, once the host memory view is no longer needed. Some implementations may prefer to mirror compute buffers in host memory; for these implementations, releaseViews() may do nothing.
Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.
Definition at line 2596 of file Tpetra_MultiVector_def.hpp.
|
inherited |
Import data into this object using an Import object ("forward mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use this method with your precomputed Import object if you want to do an Import, else use doExport() with a precomputed Export object.
| source | [in] The "source" object for redistribution. |
| importer | [in] Precomputed data redistribution plan. Its source Map must be the same as the input DistObject's Map, and its target Map must be the same as this->getMap(). |
| CM | [in] How to combine incoming data with the same global index. |
|
inherited |
Import data into this object using an Export object ("reverse mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use the version of doImport() that takes a precomputed Import object in that case.
| source | [in] The "source" object for redistribution. |
| exporter | [in] Precomputed data redistribution plan. Its target Map must be the same as the input DistObject's Map, and its source Map must be the same as this->getMap(). (Note the difference from forward mode.) |
| CM | [in] How to combine incoming data with the same global index. |
|
inherited |
Export data into this object using an Export object ("forward mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use this method with your precomputed Export object if you want to do an Export, else use doImport() with a precomputed Import object.
| source | [in] The "source" object for redistribution. |
| exporter | [in] Precomputed data redistribution plan. Its source Map must be the same as the input DistObject's Map, and its target Map must be the same as this->getMap(). |
| CM | [in] How to combine incoming data with the same global index. |
|
inherited |
Export data into this object using an Import object ("reverse mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use the version of doExport() that takes a precomputed Export object in that case.
| source | [in] The "source" object for redistribution. |
| importer | [in] Precomputed data redistribution plan. Its target Map must be the same as the input DistObject's Map, and its source Map must be the same as this->getMap(). (Note the difference from forward mode.) |
| CM | [in] How to combine incoming data with the same global index. |
|
inherited |
Whether this is a globally distributed object.
For a definition of "globally distributed" (and its opposite, "locally replicated"), see the documentation of Map's isDistributed() method.
|
inlineinherited |
The Map describing the parallel distribution of this object.
Note that some Tpetra objects might be distributed using multiple Map objects. For example, CrsMatrix has both a row Map and a column Map. It is up to the subclass to decide which Map to use when invoking the DistObject constructor. (CrsMatrix uses the row Map.)
Definition at line 317 of file Tpetra_DistObject_decl.hpp.
|
inherited |
Print this object to the given output stream.
We generally assume that all MPI processes can print to the given stream.
|
protectedvirtualinherited |
Redistribute data across memory images.
| src | [in] The source object, to redistribute into the target object, which is *this object. |
| CM | [in] The combine mode that describes how to combine values that map to the same global ID on the same process. |
| permuteToLIDs | [in] See copyAndPermute(). |
| permuteFromLIDs | [in] See copyAndPermute(). |
| remoteLIDs | [in] List of entries (as local IDs) in the destination object to receive from other processes. |
| exportLIDs | [in] See packAndPrepare(). |
| distor | [in/out] The Distributor object that knows how to redistribute data. |
| revOp | [in] Whether to do a forward or reverse mode redistribution. |
|
related |
Nonmember MultiVector constructor with view semantics using user-allocated data.
| map | [in] The Map describing the distribution of rows of the multivector. |
| view | [in/out] A pointer to column-major dense matrix data. This will be the multivector's data on the calling process. The multivector will use the pointer directly, without copying. |
| LDA | [in] The leading dimension (a.k.a. "stride") of the column-major input data. |
| numVectors | [in] The number of columns in the input data. This will be the number of vectors in the returned multivector. |
To Kokkos and Tpetra developers: If you add a new Kokkos Node type that is a host Node type (where memory lives in user space, not in a different space as on a GPU), you will need to add a specialization of Tpetra::details::ViewAccepter for your new Node type.
Definition at line 1084 of file Tpetra_MultiVector_decl.hpp.
|
related |
Non-member function to create a Vector from a specified Map.
Definition at line 194 of file Tpetra_Vector_decl.hpp.
|
related |
Non-member function to create a Vector with view semantics using user-allocated data.
This use case is not supported for all nodes. Specifically, it is not typically supported for accelerator-based nodes like Kokkos::ThrustGPUNode.
Definition at line 206 of file Tpetra_Vector_decl.hpp.
|
related |
Nonmember MultiVector constructor: make a MultiVector from a given Map.
| map | [in] Map describing the distribution of rows of the resulting MultiVector. |
| numVectors | [in] Number of columns of the resulting MultiVector. |
Definition at line 1047 of file Tpetra_MultiVector_decl.hpp.
|
protectedinherited |
The Kokkos::MultiVector containing the compute buffer of data.
Definition at line 893 of file Tpetra_MultiVector_decl.hpp.
|
protectedinherited |
Indices of columns this multivector is viewing.
If this array has nonzero size, then this multivector is a view of another multivector (the "original" multivector). In that case, whichVectors_ contains the indices of the columns of the original multivector. Furthermore, isConstantStride() returns false in this case.
If this array has zero size, then this multivector is not a view of any other multivector. Furthermore, the stride between columns of this multivector is a constant: thus, isConstantStride() returns true.
Definition at line 907 of file Tpetra_MultiVector_decl.hpp.
|
mutableprotectedinherited |
Nonconst host view created in createViewsNonConst().
Definition at line 1019 of file Tpetra_MultiVector_decl.hpp.
|
mutableprotectedinherited |
Const host view created in createViews().
Definition at line 1022 of file Tpetra_MultiVector_decl.hpp.
|
mutableprotectedinherited |
Whether releaseViews() has yet raised an efficiency warning.
Definition at line 1029 of file Tpetra_MultiVector_decl.hpp.
|
mutableprotectedinherited |
Whether createViews() has yet raised an efficiency warning.
Definition at line 1031 of file Tpetra_MultiVector_decl.hpp.
|
mutableprotectedinherited |
Whether createViewsNonConst() has yet raised an efficiency warning.
Definition at line 1033 of file Tpetra_MultiVector_decl.hpp.
|
protectedinherited |
The Map over which this object is distributed.
Definition at line 612 of file Tpetra_DistObject_decl.hpp.
1.8.11