Tpetra parallel linear algebra  Version of the Day
Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions | List of all members
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > Class Template Reference

A distributed dense vector. More...

#include <Tpetra_Vector_decl.hpp>

Inheritance diagram for Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >:
Inheritance graph
[legend]

Public Types

Typedefs to facilitate template metaprogramming
typedef Scalar scalar_type
 This class' first template parameter; the type of each entry in the Vector. More...
 
typedef base_type::impl_scalar_type impl_scalar_type
 The type used internally in place of Scalar. More...
 
typedef LocalOrdinal local_ordinal_type
 This class' second template parameter; the type of local indices. More...
 
typedef GlobalOrdinal global_ordinal_type
 This class' third template parameter; the type of global indices. More...
 
typedef Node::device_type device_type
 The Kokkos device type. More...
 
typedef Node node_type
 The Kokkos Node type. More...
 
typedef base_type::dot_type dot_type
 Type of an inner ("dot") product result. More...
 
typedef base_type::mag_type mag_type
 Type of a norm result. More...
 
typedef base_type::dual_view_type dual_view_type
 Kokkos::DualView specialization used by this class. More...
 
typedef base_type::map_type map_type
 The type of the Map specialization used by this class. More...
 
Typedefs to facilitate template metaprogramming.
typedef Node::execution_space execution_space
 Type of the (new) Kokkos execution space. More...
 
Typedefs
typedef Kokkos::Details::ArithTraits< Scalar >::val_type 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_type > &newMap)
 Remove processes owning zero rows from the Map and their communicator. More...
 
void setCopyOrView (const Teuchos::DataAccess copyOrView)
 Set whether this has copy (copyOrView = Teuchos::Copy) or view (copyOrView = Teuchos::View) semantics. More...
 
Teuchos::DataAccess getCopyOrView () const
 Get whether this has copy (copyOrView = Teuchos::Copy) or view (copyOrView = Teuchos::View) semantics. More...
 
void assign (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &src)
 Copy the contents of src into *this (deep copy). More...
 
Constructors and destructor
 Vector (const Teuchos::RCP< const map_type > &map, const bool zeroOut=true)
 Basic constructor. More...
 
 Vector (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &source)
 Copy constructor (always a shallow copy). More...
 
 Vector (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &source, const Teuchos::DataAccess copyOrView)
 Copy constructor (shallow or deep copy). More...
 
 Vector (const Teuchos::RCP< const map_type > &map, const Teuchos::ArrayView< const Scalar > &A)
 Set vector values from an existing array (copy) More...
 
 Vector (const Teuchos::RCP< const map_type > &map, const dual_view_type &view)
 Expert mode constructor, that takes a Kokkos::DualView of the Vector's data, and returns a Vector that views those data. More...
 
 Vector (const Teuchos::RCP< const map_type > &map, const dual_view_type &view, const dual_view_type &origView)
 Expert mode constructor, that takes a Kokkos::DualView of the Vector's data and the "original" Kokkos::DualView of the data, and returns a Vector that views those data. More...
 
virtual ~Vector ()
 Destructor. More...
 
Clone method
template<class Node2 >
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node2, Node2::classic > > clone (const Teuchos::RCP< Node2 > &node2)
 Return a deep copy of *this with a different Node type (and therefore a different Device type). More...
 
Post-construction modification routines
void replaceGlobalValue (const GlobalOrdinal globalRow, const Scalar &value) const
 Replace current value at the specified location with specified value. More...
 
void sumIntoGlobalValue (const GlobalOrdinal globalRow, const Scalar &value, const bool atomic=base_type::useAtomicUpdatesByDefault) const
 Add value to existing value, using global (row) index. More...
 
void replaceLocalValue (const LocalOrdinal myRow, const Scalar &value) const
 Replace current value at the specified location with specified values. More...
 
void sumIntoLocalValue (const LocalOrdinal myRow, const Scalar &value, const bool atomic=base_type::useAtomicUpdatesByDefault) const
 Add value to existing value, using local (row) index. More...
 
Extraction methods
void get1dCopy (const Teuchos::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...
 
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > offsetView (const Teuchos::RCP< const map_type > &subMap, const size_t offset) const
 
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > offsetViewNonConst (const Teuchos::RCP< const map_type > &subMap, const size_t offset)
 
Mathematical methods
dot_type dot (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &y) const
 Computes dot product of this Vector against input Vector x. More...
 
mag_type norm1 () const
 Return 1-norm of this Vector. More...
 
mag_type norm2 () const
 Compute 2-norm of this Vector. More...
 
mag_type normInf () const
 Compute Inf-norm of this Vector. More...
 
mag_type TPETRA_DEPRECATED normWeighted (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &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...
 
Constructors and destructor
template<class Node2 >
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone (const Teuchos::RCP< Node2 > &node2) const
 Return a deep copy of this MultiVector, with a different Node type. More...
 
Data Copy and View get methods
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > subCopy (const Teuchos::Range1D &colRng) const
 Return a MultiVector with copies of selected columns. More...
 
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > 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, classic > > 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, classic > > 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, classic > > subViewNonConst (const Teuchos::Range1D &colRng)
 Return a MultiVector with views of selected columns. More...
 
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > subViewNonConst (const Teuchos::ArrayView< const size_t > &cols)
 Return a MultiVector with views of selected columns. More...
 
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > getVector (const size_t j) const
 Return a Vector which is a const view of column j. More...
 
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > getVectorNonConst (const 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 (const Teuchos::ArrayView< Scalar > &A, const size_t LDA) const
 Fill the given array with a copy of this multivector's local values. More...
 
void get2dCopy (const 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...
 
KokkosClassic::MultiVector< Scalar, Node > getLocalMV () const
 A view of the underlying KokkosClassic::MultiVector object. More...
 
dual_view_type getDualView () const
 Get the Kokkos::DualView which implements local storage. More...
 
template<class TargetDeviceType >
void sync ()
 Update data on device or host only if data in the other space has been marked as modified. More...
 
template<class TargetDeviceType >
void modify ()
 Mark data as modified on the given device TargetDeviceType. More...
 
template<class TargetDeviceType >
Kokkos::Impl::if_c< std::is_same< typename device_type::memory_space, typename TargetDeviceType::memory_space >::value, typename dual_view_type::t_dev, typename dual_view_type::t_host >::type getLocalView () const
 Return a view of the local data on a specific device. More...
 
Mathematical methods
void dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Teuchos::ArrayView< dot_type > &dots) const
 Compute the dot product of each corresponding pair of vectors (columns) in A and B. More...
 
template<typename T >
std::enable_if< !(std::is_same< dot_type, T >::value), void >::type dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Teuchos::ArrayView< T > &dots) const
 Compute the dot product of each corresponding pair of vectors (columns) in A and B. More...
 
template<typename T >
std::enable_if< !(std::is_same< dot_type, T >::value), void >::type dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, std::vector< T > &dots) const
 Like the above dot() overload, but for std::vector output. More...
 
void dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Kokkos::View< dot_type *, device_type > &dots) const
 Compute the dot product of each corresponding pair of vectors (columns) in A and B, storing the result in a device View. More...
 
template<typename T >
std::enable_if< !(std::is_same< dot_type, T >::value), void >::type dot (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Kokkos::View< T *, device_type > &dots) const
 Compute the dot product of each corresponding pair of vectors (columns) in A and B, storing the result in a device view. More...
 
void abs (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A)
 Put element-wise absolute values of input Multi-vector in target: A = abs(this) More...
 
void reciprocal (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &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 (const Teuchos::ArrayView< const Scalar > &alpha)
 Scale each column in place: this[j] = alpha[j]*this[j]. More...
 
void scale (const Kokkos::View< const impl_scalar_type *, device_type > &alpha)
 Scale each column in place: this[j] = alpha[j]*this[j]. More...
 
void scale (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A)
 Scale in place: this = alpha * A. More...
 
void update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Scalar &beta)
 Update: this = beta*this + alpha*A. More...
 
void update (const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const Scalar &beta, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &B, const Scalar &gamma)
 Update: this = gamma*this + alpha*A + beta*B. More...
 
void norm1 (const Kokkos::View< mag_type *, device_type > &norms) const
 Compute the one-norm of each vector (column), storing the result in a device view. More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type norm1 (const Kokkos::View< T *, device_type > &norms) const
 Compute the one-norm of each vector (column), storing the result in a device view. More...
 
void norm1 (const Teuchos::ArrayView< mag_type > &norms) const
 Compute the one-norm of each vector (column). More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type norm1 (const Teuchos::ArrayView< T > &norms) const
 Compute the one-norm of each vector (column). More...
 
void norm2 (const Kokkos::View< mag_type *, device_type > &norms) const
 Compute the two-norm of each vector (column), storing the result in a device view. More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type norm2 (const Kokkos::View< T *, device_type > &norms) const
 Compute the two-norm of each vector (column), storing the result in a device view. More...
 
void norm2 (const Teuchos::ArrayView< mag_type > &norms) const
 Compute the two-norm of each vector (column). More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type norm2 (const Teuchos::ArrayView< T > &norms) const
 Compute the two-norm of each vector (column). More...
 
void normInf (const Kokkos::View< mag_type *, device_type > &norms) const
 Compute the infinity-norm of each vector (column), storing the result in a device view. More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type normInf (const Kokkos::View< T *, device_type > &norms) const
 Compute the two-norm of each vector (column), storing the result in a device view. More...
 
void normInf (const Teuchos::ArrayView< mag_type > &norms) const
 Compute the infinity-norm of each vector (column). More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type normInf (const Teuchos::ArrayView< T > &norms) const
 Compute the infinity-norm of each vector (column). More...
 
void TPETRA_DEPRECATED normWeighted (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &weights, const Teuchos::ArrayView< mag_type > &norms) const
 Compute Weighted 2-norm (RMS Norm) of each column. More...
 
template<typename T >
std::enable_if< !(std::is_same< mag_type, T >::value), void >::type TPETRA_DEPRECATED normWeighted (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &weights, const Teuchos::ArrayView< T > &norms) const
 Compute the weighted 2-norm (RMS Norm) of each column. More...
 
void meanValue (const Teuchos::ArrayView< impl_scalar_type > &means) const
 Compute mean (average) value of each column. More...
 
template<typename T >
std::enable_if<!std::is_same< impl_scalar_type, T >::value, void >::type meanValue (const Teuchos::ArrayView< T > &means) const
 
void multiply (Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &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, classic > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &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...
 
Methods for use only by experts
virtual void removeEmptyProcessesInPlace (const Teuchos::RCP< const map_type > &newMap)
 Remove processes which contain no elements in this object's Map. 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...
 
virtual Teuchos::RCP< const map_typegetMap () 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

virtual void doTransfer (const SrcDistObject &src, CombineMode CM, size_t numSameIDs, const Teuchos::ArrayView< const local_ordinal_type > &permuteToLIDs, const Teuchos::ArrayView< const local_ordinal_type > &permuteFromLIDs, const Teuchos::ArrayView< const local_ordinal_type > &remoteLIDs, const Teuchos::ArrayView< const local_ordinal_type > &exportLIDs, Distributor &distor, ReverseOption revOp)
 Redistribute data across memory images. More...
 
Misc. implementation details
bool vectorIndexOutOfRange (const size_t VectorIndex) const
 
template<class T >
Teuchos::ArrayRCP< T > getSubArrayRCP (Teuchos::ArrayRCP< T > arr, size_t j) const
 Persisting view of j-th column in the given ArrayRCP. More...
 
size_t getOrigNumLocalRows () const
 "Original" number of rows in the (local) data. More...
 
size_t getOrigNumLocalCols () const
 "Original" number of columns in the (local) data. More...
 
Implementation of Tpetra::DistObject
virtual bool checkSizes (const SrcDistObject &sourceObj)
 Whether data redistribution between sourceObj and this object is legal. More...
 
virtual size_t constantNumberOfPackets () const
 Number of packets to send per LID. More...
 
virtual bool useNewInterface ()
 Whether this class implements the old or new interface of DistObject. More...
 
virtual void copyAndPermuteNew (const SrcDistObject &sourceObj, size_t numSameIDs, const Kokkos::View< const local_ordinal_type *, execution_space > &permuteToLIDs, const Kokkos::View< const local_ordinal_type *, execution_space > &permuteFromLIDs)
 
virtual void packAndPrepareNew (const SrcDistObject &sourceObj, const Kokkos::View< const local_ordinal_type *, execution_space > &exportLIDs, Kokkos::View< impl_scalar_type *, execution_space > &exports, const Kokkos::View< size_t *, execution_space > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor)
 
virtual void unpackAndCombineNew (const Kokkos::View< const LocalOrdinal *, execution_space > &importLIDs, const Kokkos::View< const impl_scalar_type *, execution_space > &imports, const Kokkos::View< size_t *, execution_space > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM)
 
void createViews () const
 Hook for creating a const view. More...
 
void createViewsNonConst (KokkosClassic::ReadWriteOption rwo)
 Hook for creating a nonconst view. More...
 
void releaseViews () const
 Hook for releasing views. More...
 
Methods implemented by subclasses and used by doTransfer().

The doTransfer() method uses the subclass' implementations of these methods to implement data transfer. Subclasses of DistObject must implement these methods. This is an instance of the Template Method Pattern. ("Template" here doesn't mean "C++ template"; it means "pattern with holes that are filled in by the subclass' method implementations.")

virtual void copyAndPermuteNew (const SrcDistObject &source, size_t numSameIDs, const Kokkos::View< const local_ordinal_type *, execution_space > &permuteToLIDs, const Kokkos::View< const local_ordinal_type *, execution_space > &permuteFromLIDs)
 
virtual void packAndPrepareNew (const SrcDistObject &source, const Kokkos::View< const local_ordinal_type *, execution_space > &exportLIDs, Kokkos::View< packet_type *, execution_space > &exports, const Kokkos::View< size_t *, execution_space > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor)
 
virtual void unpackAndCombineNew (const Kokkos::View< const local_ordinal_type *, execution_space > &importLIDs, const Kokkos::View< const packet_type *, execution_space > &imports, const Kokkos::View< size_t *, execution_space > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM)
 
virtual void copyAndPermute (const SrcDistObject &source, size_t numSameIDs, const Teuchos::ArrayView< const local_ordinal_type > &permuteToLIDs, const Teuchos::ArrayView< const local_ordinal_type > &permuteFromLIDs)
 Perform copies and permutations that are local to this process. More...
 
virtual void packAndPrepare (const SrcDistObject &source, const Teuchos::ArrayView< const local_ordinal_type > &exportLIDs, Teuchos::Array< packet_type > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor)
 Perform any packing or preparation required for communication. More...
 
virtual void unpackAndCombine (const Teuchos::ArrayView< const local_ordinal_type > &importLIDs, const Teuchos::ArrayView< const packet_type > &imports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM)
 Perform any unpacking and combining after communication. More...
 

Protected Attributes

dual_view_type view_
 The Kokkos::DualView containing the MultiVector's data. More...
 
dual_view_type origView_
 The "original view" of the MultiVector's data. More...
 
Teuchos::Array< size_t > whichVectors_
 Indices of columns this multivector is viewing. More...
 
Teuchos::RCP< const map_typemap_
 The Map over which this object is distributed. More...
 

Related Functions

(Note that these are not member functions.)

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > createMultiVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const size_t numVectors)
 Nonmember MultiVector "constructor": Create a MultiVector from a given Map. More...
 
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > createCopy (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &src)
 Return a deep copy of the given Vector. More...
 
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > createVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
 Nonmember Vector "constructor": Create a Vector from a given Map. More...
 
template<class DS , class DL , class DG , class DN , const bool dstClassic, class SS , class SL , class SG , class SN , const bool srcClassic>
void deep_copy (MultiVector< DS, DL, DG, DN, dstClassic > &dst, const MultiVector< SS, SL, SG, SN, srcClassic > &src)
 Copy the contents of the MultiVector src into dst. More...
 
template<class ST , class LO , class GO , class NT , const bool classic = NT::classic>
MultiVector< ST, LO, GO, NT, classic > createCopy (const MultiVector< ST, LO, GO, NT, classic > &src)
 Return a deep copy of the given MultiVector. More...
 

Post-construction modification routines

void replaceGlobalValue (GlobalOrdinal globalRow, size_t col, const impl_scalar_type &value) const
 Replace value, using global (row) index. More...
 
template<typename T >
std::enable_if<!std::is_same< T, impl_scalar_type >::value &&std::is_convertible< T, impl_scalar_type >::value, void >::type replaceGlobalValue (GlobalOrdinal globalRow, size_t col, const T &value) const
 Like the above replaceGlobalValue, but only enabled if T differs from impl_scalar_type. More...
 
void sumIntoGlobalValue (const GlobalOrdinal globalRow, const size_t col, const impl_scalar_type &value, const bool atomic=useAtomicUpdatesByDefault) const
 Add value to existing value, using global (row) index. More...
 
template<typename T >
std::enable_if<!std::is_same< T, impl_scalar_type >::value &&std::is_convertible< T, impl_scalar_type >::value, void >::type sumIntoGlobalValue (const GlobalOrdinal globalRow, const size_t col, const T &value, const bool atomic=useAtomicUpdatesByDefault) const
 Like the above sumIntoGlobalValue, but only enabled if T differs from impl_scalar_type. More...
 
void replaceLocalValue (LocalOrdinal localRow, size_t col, const impl_scalar_type &value) const
 Replace value, using local (row) index. More...
 
template<typename T >
std::enable_if<!std::is_same< T, impl_scalar_type >::value &&std::is_convertible< T, impl_scalar_type >::value, void >::type replaceLocalValue (LocalOrdinal localRow, size_t col, const T &value) const
 Like the above replaceLocalValue, but only enabled if T differs from impl_scalar_type. More...
 
void sumIntoLocalValue (const LocalOrdinal localRow, const size_t col, const impl_scalar_type &value, const bool atomic=useAtomicUpdatesByDefault) const
 Add value to existing value, using local (row) index. More...
 
template<typename T >
std::enable_if<!std::is_same< T, impl_scalar_type >::value &&std::is_convertible< T, impl_scalar_type >::value, void >::type sumIntoLocalValue (LocalOrdinal localRow, size_t col, const T &value, const bool atomic=useAtomicUpdatesByDefault) const
 Like the above sumIntoLocalValue, but only enabled if T differs from impl_scalar_type. More...
 
void putScalar (const Scalar &value)
 Set all values in the multivector with the given value. More...
 
template<typename T >
std::enable_if<!std::is_same< T, impl_scalar_type >::value &&std::is_convertible< T, impl_scalar_type >::value, void >::type putScalar (const T &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 Teuchos::RCP< const map_type > &map)
 Replace the underlying Map in place. More...
 
void reduce ()
 Sum values of a locally replicated multivector across all processes. More...
 
static const bool useAtomicUpdatesByDefault
 Whether sumIntoLocalValue and sumIntoGlobalValue should use atomic updates by default. More...
 

Generic implementation of various norms

void normImpl (const Kokkos::View< mag_type *, device_type > &norms, const EWhichNorm whichNorm) const
 Compute the norm of each vector (column), storing the result in a device View. More...
 

Detailed Description

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
class Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >

A distributed dense vector.

Template Parameters
ScalarThe type of each entry of the vector. (You can use real-valued or complex-valued types here, unlike in Epetra, where the scalar type is always double.)
LocalOrdinalThe type of local indices. See the documentation of Map for requirements.
GlobalOrdinalThe type of global indices. See the documentation of Map for requirements.
NodeThe Kokkos Node type. See the documentation of Map for requirements.
classicDO NOT SPECIFY THIS EXPLICITLY. This exists only for backwards compatibility. It must always be false.

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. Please see the documentation of MultiVector for more details.

Definition at line 83 of file Tpetra_Vector_decl.hpp.

Member Typedef Documentation

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef Scalar Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::scalar_type

This class' first template parameter; the type of each entry in the Vector.

Definition at line 100 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef base_type::impl_scalar_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::impl_scalar_type

The type used internally in place of Scalar.

Some Scalar types might not work with Kokkos on all execution spaces, due to missing CUDA device macros or volatile overloads. The C++ standard type std::complex<T> has this problem. To fix this, we replace std::complex<T> values internally with the (usually) bitwise identical type Kokkos::complex<T>. The latter is the impl_scalar_type corresponding to Scalar = std::complex.

Definition at line 110 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef LocalOrdinal Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::local_ordinal_type

This class' second template parameter; the type of local indices.

Definition at line 112 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef GlobalOrdinal Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::global_ordinal_type

This class' third template parameter; the type of global indices.

Definition at line 114 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef Node::device_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::device_type

The Kokkos device type.

Definition at line 116 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef Node Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::node_type

The Kokkos Node type.

Definition at line 119 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef base_type::dot_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot_type

Type of an inner ("dot") product result.

This is usually the same as impl_scalar_type, but may differ if impl_scalar_type is e.g., an uncertainty quantification type from the Stokhos package.

Definition at line 126 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef base_type::mag_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::mag_type

Type of a norm result.

This is usually the same as the type of the magnitude (absolute value) of impl_scalar_type, but may differ if impl_scalar_type is e.g., an uncertainty quantification type from the Stokhos package.

Definition at line 134 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef base_type::dual_view_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dual_view_type

Kokkos::DualView specialization used by this class.

Definition at line 137 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef base_type::map_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::map_type

The type of the Map specialization used by this class.

Definition at line 140 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
typedef Node::execution_space Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::execution_space
inherited

Type of the (new) Kokkos execution space.

The execution space implements parallel operations, like parallel_for, parallel_reduce, and parallel_scan. It also has a default memory space, in which the Tpetra object's data live.

Definition at line 464 of file Tpetra_MultiVector_decl.hpp.

typedef Kokkos::Details::ArithTraits<Scalar >::val_type Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::packet_type
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 202 of file Tpetra_DistObject_decl.hpp.

Member Enumeration Documentation

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
enum Tpetra::MultiVector::EWhichNorm
protectedinherited

Input argument for normImpl() (which see).

Definition at line 2108 of file Tpetra_MultiVector_decl.hpp.

enum Tpetra::DistObject::ReverseOption
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 449 of file Tpetra_DistObject_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Teuchos::RCP< const map_type > &  map,
const bool  zeroOut = true 
)
explicit

Basic constructor.

Parameters
map[in] The Vector's Map. The Map describes the distribution of rows over process(es) in the Map's communicator.
zeroOut[in] If true (the default), require that all the Vector's entries be zero on return. If false, the Vector's entries have undefined values on return, and must be set explicitly.

Definition at line 60 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  source)

Copy constructor (always a shallow copy).

In this, the Kokkos refactor version of Tpetra, the "copy constructor" does a shallow copy. Use the nonmember function deep_copy() to do a deep copy from one existing Vector to another, and use the two-argument copy constructor below (with copyOrView=Teuchos::Copy) to create a Vector which is a deep copy of an existing Vector.

Definition at line 67 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  source,
const Teuchos::DataAccess  copyOrView 
)

Copy constructor (shallow or deep copy).

Parameters
source[in] The Vector to copy.
copyOrView[in] If Teuchos::View, return a shallow copy (a view) of source. If Teuchos::Copy, return a deep copy of source. Regardless, the result has "view semantics." This means that copy construction or assignment (operator=) with the resulting object will always do a shallow copy, and will transmit view semantics to the result of the shallow copy.

Definition at line 73 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Teuchos::RCP< const map_type > &  map,
const Teuchos::ArrayView< const Scalar > &  A 
)

Set vector values from an existing array (copy)

Definition at line 80 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Teuchos::RCP< const map_type > &  map,
const dual_view_type view 
)

Expert mode constructor, that takes a Kokkos::DualView of the Vector's data, and returns a Vector that views those data.

Warning
This constructor is only for expert users. We make no promises about backwards compatibility for this interface. It may change or go away at any time.

See the documentation of the MultiVector (parent class) constructor that takes the same arguments.

Parameters
map[in] Map describing the distribution of rows.
view[in] View of the data (shallow copy).

Definition at line 87 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::Vector ( const Teuchos::RCP< const map_type > &  map,
const dual_view_type view,
const dual_view_type origView 
)

Expert mode constructor, that takes a Kokkos::DualView of the Vector's data and the "original" Kokkos::DualView of the data, and returns a Vector that views those data.

Warning
This constructor is only for expert users. We make no promises about backwards compatibility for this interface. It may change or go away at any time.

See the documentation of the MultiVector (parent class) constructor that takes the same arguments.

Parameters
map[in] Map describing the distribution of rows.
view[in] View of the data (shallow copy).
origView[in] "Original" view of the data (shallow copy).

Definition at line 94 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::~Vector ( )
virtual

Destructor.

Definition at line 102 of file Tpetra_Vector_def.hpp.

Member Function Documentation

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<class Node2 >
Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node2, Node2::classic> > Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::clone ( const Teuchos::RCP< Node2 > &  node2)

Return a deep copy of *this with a different Node type (and therefore a different Device type).

Template Parameters
Node2The returned Vector's Node type.
Parameters
node2[in] The returned Vector's Kokkos Node instance.
template<class Scalar, class LocalOrdinal , class GlobalOrdinal, class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceGlobalValue ( const GlobalOrdinal  globalRow,
const Scalar &  value 
) const

Replace current value at the specified location with specified value.

Precondition
globalRow must be a valid global element on this node, according to the row map.

Definition at line 108 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal, class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoGlobalValue ( const GlobalOrdinal  globalRow,
const Scalar &  value,
const bool  atomic = base_type::useAtomicUpdatesByDefault 
) const

Add value to existing value, using global (row) index.

Add the given value to the existing value at row globalRow (a global index).

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
globalRow[in] Global row index of the entry to modify. This must be a valid global row index on the calling process with respect to the Vector's Map.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 115 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal , class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceLocalValue ( const LocalOrdinal  myRow,
const Scalar &  value 
) const

Replace current value at the specified location with specified values.

Precondition
localRow must be a valid local element on this node, according to the row map.

Definition at line 125 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal , class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoLocalValue ( const LocalOrdinal  myRow,
const Scalar &  value,
const bool  atomic = base_type::useAtomicUpdatesByDefault 
) const

Add value to existing value, using local (row) index.

Add the given value to the existing value at row localRow (a local index).

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
localRow[in] Local row index of the entry to modify.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 132 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get1dCopy ( const Teuchos::ArrayView< Scalar > &  A) const

Return multi-vector values in user-provided two-dimensional array (using Teuchos memory management classes).

Definition at line 142 of file Tpetra_Vector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
Teuchos::ArrayRCP<Scalar> Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getDataNonConst ( )
inline

View of the local values of this vector.

Definition at line 307 of file Tpetra_Vector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
Teuchos::ArrayRCP<const Scalar> Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getData ( ) const
inline

Const view of the local values of this vector.

Definition at line 313 of file Tpetra_Vector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  y) const

Computes dot product of this Vector against input Vector x.

Definition at line 150 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::mag_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm1 ( ) const

Return 1-norm of this Vector.

Definition at line 170 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::mag_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm2 ( ) const

Compute 2-norm of this Vector.

Definition at line 180 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::mag_type Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normInf ( ) const

Compute Inf-norm of this Vector.

Definition at line 190 of file Tpetra_Vector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::mag_type TPETRA_DEPRECATED Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normWeighted ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  weights) const

Compute Weighted 2-norm (RMS Norm) of this Vector.

Warning
This method is DEPRECATED.

Definition at line 201 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Scalar Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::meanValue ( ) const

Compute mean (average) value of this Vector.

Definition at line 160 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
std::string Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::description ( ) const
virtual

A simple one-line description of this object.

Reimplemented from Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >.

Definition at line 210 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const
virtual

Print the object with some verbosity level to a FancyOStream.

Reimplemented from Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >.

Definition at line 232 of file Tpetra_Vector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<class Node2 >
Teuchos::RCP<MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::clone ( const Teuchos::RCP< Node2 > &  node2) const
inherited

Return a deep copy of this MultiVector, with a different Node type.

Parameters
node2[in/out] The new Node type.
Warning
We prefer that you use Tpetra::deep_copy (see below) rather than this method. This method will go away at some point.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal, class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceGlobalValue ( GlobalOrdinal  globalRow,
size_t  col,
const impl_scalar_type value 
) const
inherited

Replace value, using global (row) index.

Replace the current value at row globalRow (a global index) and column col with the given value. The column index is zero based.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Precondition
globalRow must be a valid global element on this process, according to the row Map.

Definition at line 3696 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if<! std::is_same<T, impl_scalar_type>::value && std::is_convertible<T, impl_scalar_type>::value, void>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceGlobalValue ( GlobalOrdinal  globalRow,
size_t  col,
const T &  value 
) const
inlineinherited

Like the above replaceGlobalValue, but only enabled if T differs from impl_scalar_type.

This method only exists if the template parameter T and impl_scalar_type differ. If C++11 is enabled, we further require that it be possible to convert T to impl_scalar_type.

This method is mainly useful for backwards compatibility, when Scalar differs from impl_scalar_type.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Definition at line 831 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal, class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoGlobalValue ( const GlobalOrdinal  globalRow,
const size_t  col,
const impl_scalar_type value,
const bool  atomic = useAtomicUpdatesByDefault 
) const
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 col. The column index is zero based.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
globalRow[in] Global row index of the entry to modify. This must be a valid global row index on the calling process with respect to the MultiVector's Map.
col[in] Column index of the entry to modify.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 3721 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if<! std::is_same<T, impl_scalar_type>::value && std::is_convertible<T, impl_scalar_type>::value, void>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoGlobalValue ( const GlobalOrdinal  globalRow,
const size_t  col,
const T &  value,
const bool  atomic = useAtomicUpdatesByDefault 
) const
inlineinherited

Like the above sumIntoGlobalValue, but only enabled if T differs from impl_scalar_type.

This method only exists if the template parameter T and impl_scalar_type differ. If C++11 is enabled, we further require that it be possible to convert T to impl_scalar_type.

This method is mainly useful for backwards compatibility, when Scalar differs from impl_scalar_type.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
globalRow[in] Global row index of the entry to modify. This must be a valid global row index on the calling process with respect to the MultiVector's Map.
col[in] Column index of the entry to modify.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 894 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal, class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceLocalValue ( LocalOrdinal  localRow,
size_t  col,
const impl_scalar_type value 
) const
inherited

Replace value, using local (row) index.

Replace the current value at row localRow (a local index) and column col with the given value. The column index is zero based.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Precondition
localRow must be a valid local element on this process, according to the row Map.

Definition at line 3633 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if<! std::is_same<T, impl_scalar_type>::value && std::is_convertible<T, impl_scalar_type>::value, void>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceLocalValue ( LocalOrdinal  localRow,
size_t  col,
const T &  value 
) const
inlineinherited

Like the above replaceLocalValue, but only enabled if T differs from impl_scalar_type.

This method only exists if the template parameter T and impl_scalar_type differ. If C++11 is enabled, we further require that it be possible to convert T to impl_scalar_type.

This method is mainly useful for backwards compatibility, when Scalar differs from impl_scalar_type.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Definition at line 942 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal, class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoLocalValue ( const LocalOrdinal  localRow,
const size_t  col,
const impl_scalar_type value,
const bool  atomic = useAtomicUpdatesByDefault 
) const
inherited

Add value to existing value, using local (row) index.

Add the given value to the existing value at row localRow (a local index) and column col. The column index is zero based.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
localRow[in] Local row index of the entry to modify.
col[in] Column index of the entry to modify.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 3662 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if<! std::is_same<T, impl_scalar_type>::value && std::is_convertible<T, impl_scalar_type>::value, void>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sumIntoLocalValue ( LocalOrdinal  localRow,
size_t  col,
const T &  value,
const bool  atomic = useAtomicUpdatesByDefault 
) const
inlineinherited

Like the above sumIntoLocalValue, but only enabled if T differs from impl_scalar_type.

This method only exists if the template parameter T and impl_scalar_type differ. If C++11 is enabled, we further require that it be possible to convert T to impl_scalar_type.

This method is mainly useful for backwards compatibility, when Scalar differs from impl_scalar_type.

This method affects the host memory version of the data. If the DeviceType template parameter is a device that has two memory spaces, and you want to modify the non-host version of the data, you must access the DualView directly by calling getDualView(). Please see modify(), sync(), and the discussion of DualView semantics elsewhere in the documentation.

Parameters
localRow[in] Local row index of the entry to modify.
col[in] Column index of the entry to modify.
value[in] Incoming value to add to the entry.
atomic[in] Whether to use an atomic update. If this class' execution space is not Kokkos::Serial, then this is true by default, else it is false by default.

Definition at line 1001 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::putScalar ( const Scalar &  value)
inherited

Set all values in the multivector with the given value.

Definition at line 1928 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if<! std::is_same<T, impl_scalar_type>::value && std::is_convertible<T, impl_scalar_type>::value, void>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::putScalar ( const T &  value)
inlineinherited

Set all values in the multivector with the given value.

This method only exists if the template parameter T and impl_scalar_type differ. If C++11 is enabled, we further require that it be possible to convert T to impl_scalar_type.

Definition at line 1020 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::randomize ( )
inherited

Set all values in the multivector to pseudorandom numbers.

Note
The implementation of this method may depend on the Kokkos Node type and on what third-party libraries you have available. Do not expect repeatable results.
Behavior of this method may or may not depend on external use of the C library routines srand() and rand().
Warning
This method does not promise to use a distributed-memory parallel pseudorandom number generator. Corresponding values on different processes might be correlated. It also does not promise to use a high-quality pseudorandom number generator within each process.

Definition at line 1880 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::replaceMap ( const Teuchos::RCP< const map_type > &  map)
inherited

Replace the underlying Map in place.

Warning
The normal use case of this method, with an input Map that is compatible with the object's current Map and has the same communicator, is safe. However, if the input Map has a different communicator (with a different number of processes, in particular) than this object's current Map, the semantics of this method are tricky. We recommend that only experts try the latter use case.
Precondition
If the new Map's communicator is similar to the original Map's communicator, then the original Map and new Map must be compatible: 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.
If the new Map's communicator contains more processes than the original Map's communicator, then the projection of the original Map onto the new communicator must be compatible with the new Map.
If the new Map's communicator contains fewer processes than the original Map's communicator, then the projection of the new Map onto the original communicator must be compatible with the original Map.

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.)

Warning
This method must always be called as a collective operation on all processes in the original communicator (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.
Note
This method does not do data redistribution. If you need to move data around, use Import or Export.

Definition at line 2005 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::reduce ( )
inherited

Sum values of a locally replicated multivector across all processes.

Warning
This method may only be called for locally replicated MultiVectors.
Precondition
isDistributed() == false

Definition at line 3538 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subCopy ( const Teuchos::Range1D &  colRng) const
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:

  • a MultiVector with a subset of the columns of the target MultiVector
  • a raw C pointer or array of raw C pointers
  • one of the Teuchos memory management classes Not all of these methods are valid for a particular MultiVector. For instance, calling a method that accesses a view of the data in a 1-D format (i.e., get1dView) requires that the target MultiVector has constant stride.

Definition at line 2752 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subCopy ( const Teuchos::ArrayView< const size_t > &  cols) const
inherited

Return a MultiVector with copies of selected columns.

Definition at line 2723 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subView ( const Teuchos::Range1D &  colRng) const
inherited

Return a const MultiVector with const views of selected columns.

Definition at line 2953 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subView ( const Teuchos::ArrayView< const size_t > &  cols) const
inherited

Return a const MultiVector with const views of selected columns.

Definition at line 2905 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subViewNonConst ( const Teuchos::Range1D &  colRng)
inherited

Return a MultiVector with views of selected columns.

Definition at line 3073 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
Teuchos::RCP<MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node, classic> > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::subViewNonConst ( const Teuchos::ArrayView< const size_t > &  cols)
inherited

Return a MultiVector with views of selected columns.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getVector ( const size_t  j) const
inherited

Return a Vector which is a const view of column j.

Definition at line 3083 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getVectorNonConst ( const size_t  j)
inherited

Return a Vector which is a nonconst view of column j.

Definition at line 3110 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< const Scalar > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getData ( size_t  j) const
inherited

Const view of the local values in a particular vector of this multivector.

Definition at line 2607 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< Scalar > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getDataNonConst ( size_t  j)
inherited

View of the local values in a particular vector of this multivector.

Definition at line 2648 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get1dCopy ( const Teuchos::ArrayView< Scalar > &  A,
const size_t  LDA 
) const
inherited

Fill the given array with a copy of this multivector's local values.

Parameters
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 3120 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get2dCopy ( const Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > &  ArrayOfPtrs) const
inherited

Fill the given array with a copy of this multivector's local values.

Parameters
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 3196 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< const Scalar > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get1dView ( ) const
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 3232 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get2dView ( ) const
inherited

Return const persisting pointers to values.

Definition at line 3308 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< Scalar > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get1dViewNonConst ( )
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 3259 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::get2dViewNonConst ( )
inherited

Return non-const persisting pointers to values.

Definition at line 3286 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
KokkosClassic::MultiVector< Scalar, Node > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getLocalMV ( ) const
inherited

A view of the underlying KokkosClassic::MultiVector object.

This method is for expert users only. It may change or be removed at any time.

Note
To Tpetra developers: This object's value type is Scalar and not impl_scalar_type, precisely because it supports a backwards compatibility use case.

Definition at line 3768 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dual_view_type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getDualView ( ) const
inherited

Get the Kokkos::DualView which implements local storage.

Instead of getting the Kokkos::DualView, we highly recommend calling the templated view() method, that returns a Kokkos::View of the MultiVector's data in a given memory space. Since that MultiVector itself implements DualView semantics, it's much better to use MultiVector's interface to do "DualView things," like calling modify() and sync().

Warning
This method is ONLY for expert developers. Its interface may change or it may disappear at any time.

Definition at line 3804 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<class TargetDeviceType >
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::sync ( )
inlineinherited

Update data on device or host only if data in the other space has been marked as modified.

If TargetDeviceType is the same as this MultiVector's device type, then copy data from host to device. Otherwise, copy data from device to host. In either case, only copy if the source of the copy has been modified.

This is a one-way synchronization only. If the target of the copy has been modified, this operation will discard those modifications. It will also reset both device and host modified flags.

Note
This method doesn't know on its own whether you modified the data in either memory space. You must manually mark the MultiVector as modified in the space in which you modified it, by calling the modify() method with the appropriate template parameter.

Definition at line 1353 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<class TargetDeviceType >
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::modify ( )
inlineinherited

Mark data as modified on the given device TargetDeviceType.

If TargetDeviceType is the same as this MultiVector's device type, then mark the device's data as modified. Otherwise, mark the host's data as modified.

Definition at line 1363 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<class TargetDeviceType >
Kokkos::Impl::if_c< std::is_same< typename device_type::memory_space, typename TargetDeviceType::memory_space>::value, typename dual_view_type::t_dev, typename dual_view_type::t_host>::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getLocalView ( ) const
inlineinherited

Return a view of the local data on a specific device.

Template Parameters
TargetDeviceTypeThe Kokkos Device type whose data to return.

Please don't be afraid of the if_c expression in the return value's type. That just tells the method what the return type should be: dual_view_type::t_dev if the TargetDeviceType template parameter matches this Tpetra object's device type, else dual_view_type::t_host.

For example, suppose you create a Tpetra::MultiVector for the Kokkos::Cuda device, like this:

typedef Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Cuda> > node_type;
RCP<const map_type> map = ...;
mv_type DV (map, 3);

If you want to get the CUDA device Kokkos::View, do this:

typedef typename mv_type::dual_view_type dual_view_type;
typedef typename dual_view_type::t_dev device_view_type;
device_view_type cudaView = DV.getLocalView<Kokkos::Cuda> ();

and if you want to get the host mirror of that View, do this:

typedef typename dual_view_type::host_mirror_space host_execution_space;
typedef typename dual_view_type::t_host host_view_type;
host_view_type hostView = DV.getLocalView<host_execution_space> ();

Definition at line 1405 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Teuchos::ArrayView< dot_type > &  dots 
) const
inherited

Compute the dot product of each corresponding pair of vectors (columns) in A and B.

The "dot product" is the standard Euclidean inner product. If the type of entries of the vectors (impl_scalar_type) is complex, then A is transposed, not *this. For example, if x and y each have one column, then x.dot (y, dots) computes $y^* x = \bar{y}^T x = \sum_i \bar{y}_i \cdot x_i$.

Precondition
*this and A have the same number of columns (vectors).
dots has at least as many entries as the number of columns in A.
Postcondition
dots[j] == (this->getVector[j])->dot (* (A.getVector[j]))

Definition at line 1328 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<dot_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Teuchos::ArrayView< T > &  dots 
) const
inlineinherited

Compute the dot product of each corresponding pair of vectors (columns) in A and B.

Template Parameters
TThe output type of the dot products.

This method only exists if dot_type and T are different types. For example, if impl_scalar_type and dot_type differ, then this method ensures backwards compatibility with the previous interface (that returned dot products as impl_scalar_type rather than as dot_type). The complicated enable_if expression just ensures that the method only exists if dot_type and T are different types; the method still returns void, as above.

Definition at line 1443 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<dot_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
std::vector< T > &  dots 
) const
inlineinherited

Like the above dot() overload, but for std::vector output.

Definition at line 1458 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Kokkos::View< dot_type *, device_type > &  dots 
) const
inherited

Compute the dot product of each corresponding pair of vectors (columns) in A and B, storing the result in a device View.

The "dot product" is the standard Euclidean inner product. If the type of entries of the vectors (impl_scalar_type) is complex, then A is transposed, not *this. For example, if x and y each have one column, then x.dot (y, dots) computes $y^* x = \bar{y}^T x = \sum_i \bar{y}_i \cdot x_i$.

Parameters
A[in] MultiVector with which to dot *this.
dots[out] Device View with getNumVectors() entries.
Precondition
this->getNumVectors () == A.getNumVectors ()
dots.dimension_0 () == A.getNumVectors ()
Postcondition
dots(j) == (this->getVector[j])->dot (* (A.getVector[j]))

Definition at line 1231 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<dot_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::dot ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Kokkos::View< T *, device_type > &  dots 
) const
inlineinherited

Compute the dot product of each corresponding pair of vectors (columns) in A and B, storing the result in a device view.

Template Parameters
TThe output type of the dot products.

This method only exists if dot_type and T are different types. For example, if Scalar and dot_type differ, then this method ensures backwards compatibility with the previous interface (that returned dot products as Scalar rather than as dot_type). The complicated enable_if expression just ensures that the method only exists if dot_type and T are different types; the method still returns void, as above.

Definition at line 1505 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::abs ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A)
inherited

Put element-wise absolute values of input Multi-vector in target: A = abs(this)

Definition at line 2400 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::reciprocal ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A)
inherited

Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).

Definition at line 2344 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::scale ( const Scalar &  alpha)
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 2099 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::scale ( const Teuchos::ArrayView< const Scalar > &  alpha)
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 2160 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::scale ( const Kokkos::View< const impl_scalar_type *, device_type > &  alpha)
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 2184 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::scale ( const Scalar &  alpha,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A 
)
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 2260 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::update ( const Scalar &  alpha,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Scalar &  beta 
)
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 2446 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::update ( const Scalar &  alpha,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const Scalar &  beta,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  B,
const Scalar &  gamma 
)
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 2531 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm1 ( const Kokkos::View< mag_type *, device_type > &  norms) const
inherited

Compute the one-norm of each vector (column), storing the result in a device view.

The one-norm of a vector is the sum of squares of the magnitudes of the vector's entries. On exit, norms(j) is the one-norm of column j of this MultiVector.

Parameters
norms[out] Device View with getNumVectors() entries.
Precondition
norms.dimension_0 () == this->getNumVectors ()
Postcondition
norms(j) == (this->getVector[j])->norm1 (* (A.getVector[j]))

Definition at line 1481 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm1 ( const Kokkos::View< T *, device_type > &  norms) const
inlineinherited

Compute the one-norm of each vector (column), storing the result in a device view.

Template Parameters
TThe output type of the dot products.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms products as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1620 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm1 ( const Teuchos::ArrayView< mag_type > &  norms) const
inherited

Compute the one-norm of each vector (column).

The one-norm of a vector is the sum of squares of the magnitudes of the vector's entries. On exit, norms[j] is the one-norm of column j of this MultiVector.

Definition at line 1464 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type,T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm1 ( const Teuchos::ArrayView< T > &  norms) const
inlineinherited

Compute the one-norm of each vector (column).

Template Parameters
TThe output type of the norms.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1656 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm2 ( const Kokkos::View< mag_type *, device_type > &  norms) const
inherited

Compute the two-norm of each vector (column), storing the result in a device view.

The two-norm of a vector is the standard Euclidean norm, the square root of the sum of squares of the magnitudes of the vector's entries. On exit, norms(k) is the two-norm of column k of this MultiVector.

Parameters
norms[out] Device View with getNumVectors() entries.
Precondition
norms.dimension_0 () == this->getNumVectors ()
Postcondition
norms(j) == (this->getVector[j])->dot (* (A.getVector[j]))

Definition at line 1363 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm2 ( const Kokkos::View< T *, device_type > &  norms) const
inlineinherited

Compute the two-norm of each vector (column), storing the result in a device view.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1695 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm2 ( const Teuchos::ArrayView< mag_type > &  norms) const
inherited

Compute the two-norm of each vector (column).

The two-norm of a vector is the standard Euclidean norm, the square root of the sum of squares of the magnitudes of the vector's entries. On exit, norms[k] is the two-norm of column k of this MultiVector.

Definition at line 1346 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type,T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::norm2 ( const Teuchos::ArrayView< T > &  norms) const
inlineinherited

Compute the two-norm of each vector (column).

Template Parameters
TThe output type of the norms.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms products as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1731 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normInf ( const Kokkos::View< mag_type *, device_type > &  norms) const
inherited

Compute the infinity-norm of each vector (column), storing the result in a device view.

The infinity-norm of a vector is the maximum of the magnitudes of the vector's entries. On exit, norms(j) is the infinity-norm of column j of this MultiVector.

Definition at line 1507 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type, T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normInf ( const Kokkos::View< T *, device_type > &  norms) const
inlineinherited

Compute the two-norm of each vector (column), storing the result in a device view.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1764 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normInf ( const Teuchos::ArrayView< mag_type > &  norms) const
inherited

Compute the infinity-norm of each vector (column).

The infinity-norm of a vector is the maximum of the magnitudes of the vector's entries. On exit, norms[j] is the infinity-norm of column j of this MultiVector.

Definition at line 1490 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type,T>::value), void >::type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normInf ( const Teuchos::ArrayView< T > &  norms) const
inlineinherited

Compute the infinity-norm of each vector (column).

Template Parameters
TThe output type of the norms.

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms products as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1799 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void TPETRA_DEPRECATED Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normWeighted ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  weights,
const Teuchos::ArrayView< mag_type > &  norms 
) const
inherited

Compute Weighted 2-norm (RMS Norm) of each column.

Warning
This method has been DEPRECATED.

The results of this method are undefined for scalar types that are not floating-point types (e.g., int).

Definition at line 1372 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
template<typename T >
std::enable_if< ! (std::is_same<mag_type,T>::value), void >::type TPETRA_DEPRECATED Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normWeighted ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  weights,
const Teuchos::ArrayView< T > &  norms 
) const
inlineinherited

Compute the weighted 2-norm (RMS Norm) of each column.

Warning
This method is DEPRECATED.

The outcome of this routine is undefined for non-floating point scalar types (e.g., int).

This method only exists if mag_type and T are different types. For example, if Teuchos::ScalarTraits<Scalar>::magnitudeType and mag_type differ, then this method ensures backwards compatibility with the previous interface (that returned norms as Teuchos::ScalarTraits<Scalar>::magnitudeType rather than as mag_type). The complicated enable_if expression just ensures that the method only exists if mag_type and T are different types; the method still returns void, as above.

Definition at line 1840 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::meanValue ( const Teuchos::ArrayView< impl_scalar_type > &  means) const
inherited

Compute mean (average) value of each column.

The outcome of this routine is undefined for non-floating point scalar types (e.g., int).

Definition at line 1767 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::multiply ( Teuchos::ETransp  transA,
Teuchos::ETransp  transB,
const Scalar &  alpha,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  B,
const Scalar &  beta 
)
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 3330 of file Tpetra_MultiVector_def.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::elementWiseMultiply ( Scalar  scalarAB,
const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  A,
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  B,
Scalar  scalarThis 
)
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:

C(i,j) = scalarThis * C(i,j) + scalarAB * B(i,j) * A(i,1);

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.

We do not require that A, B, and *this have compatible Maps, as long as the number of rows in A, B, and *this on each process is the same. For example, one or more of these vectors might have a locally replicated Map, or a Map with a local communicator (MPI_COMM_SELF). This case may occur in block relaxation algorithms when applying a diagonal scaling.

Definition at line 3481 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getNumVectors ( ) const
inherited

Number of columns in the multivector.

Definition at line 1060 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getLocalLength ( ) const
inherited

Local number of rows on the calling process.

Definition at line 667 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
global_size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getGlobalLength ( ) const
inherited

Global number of rows in the multivector.

Definition at line 679 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getStride ( ) const
inherited

Stride between columns in the multivector.

This is only meaningful if isConstantStride() returns true.

Warning
This may be different on different processes.

Definition at line 691 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
bool Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::isConstantStride ( ) const
inherited

Whether this multivector has constant stride between columns.

Warning
This may be different on different processes.

Definition at line 660 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::removeEmptyProcessesInPlace ( const Teuchos::RCP< const map_type > &  newMap)
virtualinherited

Remove processes owning zero rows from the Map and their communicator.

Warning
This method is ONLY for use by experts. We highly recommend using the nonmember function of the same name defined in Tpetra_DistObject_decl.hpp.
We make NO promises of backwards compatibility. This method may change or disappear at any time.
Parameters
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.

Definition at line 3970 of file Tpetra_MultiVector_def.hpp.

virtual void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::removeEmptyProcessesInPlace ( const Teuchos::RCP< const map_type > &  newMap)
virtualinherited

Remove processes which contain no elements in this object's Map.

Warning
This method is ONLY for use by experts. We highly recommend using the nonmember function of the same name defined in this file.
We make NO promises of backwards compatibility. This method may change or disappear at any time.

On input, this object is distributed over the Map returned by getMap() (the "original Map," with its communicator, the "original communicator"). The input newMap of this method must be the same as the result of calling getMap()->removeEmptyProcesses(). On processes in the original communicator which contain zero elements ("excluded processes," as opposed to "included processes"), the input newMap must be Teuchos::null (which is what getMap()->removeEmptyProcesses() returns anyway).

On included processes, reassign this object's Map (that would be returned by getMap()) to the input newMap, and do any work that needs to be done to restore correct semantics. On excluded processes, free any data that needs freeing, and do any other work that needs to be done to restore correct semantics.

This method has collective semantics over the original communicator. On exit, the only method of this object which is safe to call on excluded processes is the destructor. This implies that subclasses' destructors must not contain communication operations.

Returns
The object's new Map. Its communicator is a new communicator, distinct from the old Map's communicator, which contains a subset of the processes in the old communicator.
Note
The name differs from Map's method removeEmptyProcesses(), in order to emphasize that the operation on DistObject happens in place, modifying the input, whereas the operation removeEmptyProcess() on Map does not modify the input.
To implementers of DistObject subclasses: The default implementation of this class throws std::logic_error.
template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::setCopyOrView ( const Teuchos::DataAccess  copyOrView)
inlineinherited

Set whether this has copy (copyOrView = Teuchos::Copy) or view (copyOrView = Teuchos::View) semantics.

Warning
The Kokkos refactor version of MultiVector only implements view semantics. If you attempt to call this method with copyOrView == Teuchos::Copy, it will throw std::invalid_argument.
This method is only for expert use. It may change or disappear at any time.

Definition at line 2004 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
Teuchos::DataAccess Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getCopyOrView ( ) const
inlineinherited

Get whether this has copy (copyOrView = Teuchos::Copy) or view (copyOrView = Teuchos::View) semantics.

Note
The Kokkos refactor version of MultiVector only implements view semantics. This is not currently true for the "classic" version of MultiVector, though that will change in the near future.
Warning
This method is only for expert use. It may change or disappear at any time.

Definition at line 2023 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node, const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::assign ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  src)
inherited

Copy the contents of src into *this (deep copy).

Parameters
src[in] Source MultiVector (input of the deep copy).
Precondition
! src.getMap ().is_null () && ! this->getMap ().is_null ()
src.getMap ()->isCompatible (* (this->getMap ())
Postcondition
Any outstanding views of src or *this remain valid.
Note
To implementers: The postcondition implies that the implementation must not reallocate any memory of *this, or otherwise change its dimensions. This is not an assignment operator; it does not change anything in *this other than the contents of storage.

Definition at line 3978 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::normImpl ( const Kokkos::View< mag_type *, device_type > &  norms,
const EWhichNorm  whichNorm 
) const
protectedinherited

Compute the norm of each vector (column), storing the result in a device View.

This method consolidates all common code between the infinity-norm, 1-norm, and 2-norm calculations. On exit, norms(j) is the norm (of the selected type) of column j of this MultiVector.

Definition at line 1697 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
template<class T >
Teuchos::ArrayRCP< T > Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getSubArrayRCP ( Teuchos::ArrayRCP< T >  arr,
size_t  j 
) const
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.

Definition at line 3749 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getOrigNumLocalRows ( ) const
protectedinherited

"Original" number of rows in the (local) data.

Definition at line 2766 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::getOrigNumLocalCols ( ) const
protectedinherited

"Original" number of columns in the (local) data.

Definition at line 2773 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
bool Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::checkSizes ( const SrcDistObject sourceObj)
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 709 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
size_t Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::constantNumberOfPackets ( ) const
protectedvirtualinherited

Number of packets to send per LID.

Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.

Definition at line 732 of file Tpetra_MultiVector_def.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
virtual bool Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::useNewInterface ( )
inlineprotectedvirtualinherited

Whether this class implements the old or new interface of DistObject.

Reimplemented from Tpetra::DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node >.

Definition at line 2161 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::createViews ( ) const
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 3950 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::createViewsNonConst ( KokkosClassic::ReadWriteOption  rwo)
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.

Parameters
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 3956 of file Tpetra_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic>
void Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::releaseViews ( ) const
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 3962 of file Tpetra_MultiVector_def.hpp.

void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::doImport ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Import< LocalOrdinal, GlobalOrdinal, Node > &  importer,
CombineMode  CM 
)
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.

Parameters
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.
void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::doImport ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Export< LocalOrdinal, GlobalOrdinal, Node > &  exporter,
CombineMode  CM 
)
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.

Parameters
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.
void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::doExport ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Export< LocalOrdinal, GlobalOrdinal, Node > &  exporter,
CombineMode  CM 
)
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.

Parameters
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.
void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::doExport ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Import< LocalOrdinal, GlobalOrdinal, Node > &  importer,
CombineMode  CM 
)
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.

Parameters
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.
bool Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::isDistributed ( ) const
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.

virtual Teuchos::RCP<const map_type> Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::getMap ( ) const
inlinevirtualinherited

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.

Definition at line 347 of file Tpetra_DistObject_decl.hpp.

void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::print ( std::ostream &  os) const
inherited

Print this object to the given output stream.

We generally assume that all MPI processes can print to the given stream.

virtual void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::doTransfer ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  src,
CombineMode  CM,
size_t  numSameIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  permuteToLIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  permuteFromLIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  remoteLIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  exportLIDs,
Distributor distor,
ReverseOption  revOp 
)
protectedvirtualinherited

Redistribute data across memory images.

Parameters
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.
virtual void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::copyAndPermute ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
size_t  numSameIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  permuteToLIDs,
const Teuchos::ArrayView< const local_ordinal_type > &  permuteFromLIDs 
)
inlineprotectedvirtualinherited

Perform copies and permutations that are local to this process.

Parameters
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.

Definition at line 565 of file Tpetra_DistObject_decl.hpp.

virtual void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::packAndPrepare ( const SrcDistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Teuchos::ArrayView< const local_ordinal_type > &  exportLIDs,
Teuchos::Array< packet_type > &  exports,
const Teuchos::ArrayView< size_t > &  numPacketsPerLID,
size_t &  constantNumPackets,
Distributor distor 
)
inlineprotectedvirtualinherited

Perform any packing or preparation required for communication.

Parameters
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.

Definition at line 600 of file Tpetra_DistObject_decl.hpp.

virtual void Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::unpackAndCombine ( const Teuchos::ArrayView< const local_ordinal_type > &  importLIDs,
const Teuchos::ArrayView< const packet_type > &  imports,
const Teuchos::ArrayView< size_t > &  numPacketsPerLID,
size_t  constantNumPackets,
Distributor distor,
CombineMode  CM 
)
inlineprotectedvirtualinherited

Perform any unpacking and combining after communication.

Parameters
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.

Definition at line 638 of file Tpetra_DistObject_decl.hpp.

Friends And Related Function Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > createMultiVector ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
const size_t  numVectors 
)
related

Nonmember MultiVector "constructor": Create a MultiVector from a given Map.

Parameters
map[in] Map describing the distribution of rows of the resulting MultiVector.
numVectors[in] Number of columns of the resulting MultiVector.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > createCopy ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > &  src)
related

Return a deep copy of the given Vector.

Definition at line 301 of file Tpetra_Vector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node , const bool classic = Node::classic>
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic > > createVector ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map)
related

Nonmember Vector "constructor": Create a Vector from a given Map.

Parameters
map[in] Map describing the distribution of rows of the resulting Vector.

Definition at line 384 of file Tpetra_Vector_decl.hpp.

template<class DS , class DL , class DG , class DN , const bool dstClassic, class SS , class SL , class SG , class SN , const bool srcClassic>
void deep_copy ( MultiVector< DS, DL, DG, DN, dstClassic > &  dst,
const MultiVector< SS, SL, SG, SN, srcClassic > &  src 
)
related

Copy the contents of the MultiVector src into dst.

Precondition
The two inputs must have the same communicator.
The Map of src must be compatible with the Map of dst.
The two inputs must have the same number of columns.

Copy the contents of the MultiVector src into the MultiVector dst. ("Copy the contents" means the same thing as "deep copy.") The two MultiVectors need not necessarily have the same template parameters, but the assignment of their entries must make sense. Furthermore, their Maps must be compatible, that is, the MultiVectors' local dimensions must be the same on all processes.

This method must always be called as a collective operation on all processes over which the multivector is distributed. This is because the method reserves the right to check for compatibility of the two Maps, at least in debug mode, and throw if they are not compatible.

Definition at line 2245 of file Tpetra_MultiVector_decl.hpp.

template<class ST , class LO , class GO , class NT , const bool classic = NT::classic>
MultiVector< ST, LO, GO, NT, classic > createCopy ( const MultiVector< ST, LO, GO, NT, classic > &  src)
related

Return a deep copy of the given MultiVector.

Note
MultiVector's constructor returns a shallow copy of its input, by default. If you want a deep copy, use the two-argument copy constructor with Teuchos::Copy as the second argument, or call this function (createCopy).

Definition at line 4234 of file Tpetra_MultiVector_def.hpp.

Member Data Documentation

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
const bool Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::useAtomicUpdatesByDefault
staticprotectedinherited
Initial value:
=
true

Whether sumIntoLocalValue and sumIntoGlobalValue should use atomic updates by default.

Warning
This is an implementation detail.

Definition at line 783 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
dual_view_type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::view_
mutableprotectedinherited

The Kokkos::DualView containing the MultiVector's data.

This has to be declared mutable, so that get1dView() can retain its current const marking, even though it has always implied a device->host synchronization. Lesson to the reader: Use const sparingly!

Definition at line 2057 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
dual_view_type Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::origView_
mutableprotectedinherited

The "original view" of the MultiVector's data.

Methods like offsetView() return a view of a contiguous subset of rows. At some point, we might like to get all of the rows back, by taking another view of a superset of rows. For example, we might like to get a column Map view of a (domain Map view of a (column Map MultiVector)). Tpetra's implementation of Gauss-Seidel and SOR in CrsMatrix relies on this functionality. However, Kokkos (rightfully) forbids us from taking a superset of rows of the current view.

We deal with this at the Tpetra level by keeping around the original view of all the rows (and columns), which is origView_. Methods like offsetView() then use origView_, not view_, to make the subview for the returned MultiVector. Furthermore, offsetView() can do error checking by getting the original number of rows from origView_.

This may pose some problems for offsetView if it is given an offset other than zero, but that case is hardly exercised, so I am not going to worry about it for now.

Note that the "original" view isn't always original. It always has the original number of rows. However, some special cases of constructors that take a whichVectors argument, when whichVectors.size() is 1, may point origView_ to the column to view. Those constructors do this so that the resulting MultiVector has constant stride. This special case does not affect correctness of offsetView and related methods.

Definition at line 2088 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar = Details::DefaultTypes::scalar_type, class LocalOrdinal = Details::DefaultTypes::local_ordinal_type, class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type, class Node = Details::DefaultTypes::node_type, const bool classic = Node::classic>
Teuchos::Array<size_t> Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node, classic >::whichVectors_
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 2102 of file Tpetra_MultiVector_decl.hpp.

Teuchos::RCP<const map_type> Tpetra::DistObject< Scalar , LocalOrdinal, GlobalOrdinal, Node, Node::classic >::map_
protectedinherited

The Map over which this object is distributed.

Definition at line 695 of file Tpetra_DistObject_decl.hpp.


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