Tpetra Matrix/Vector Services Version of the Day
Namespaces | Classes | Typedefs | Enumerations | Functions
Tpetra Namespace Reference

Namespace Tpetra contains the class and methods constituting the Tpetra library. More...

Namespaces

namespace  RTI
 

Namespace for Tpetra Reduction/Tranformation Interface.


namespace  Ext
 

Namespace for external Tpetra functionality.


namespace  MatrixMatrix
 

Distributed sparse matrix-matrix multiply and add.


namespace  Experimental
 

Namespace for new Tpetra features that are not ready for public release, but are ready for evaluation by friendly expert users.


namespace  VbrUtils

Classes

class  CrsGraph< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType >, typename KokkosClassic::DefaultKernels< void, LocalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::SparseOps >
 Partial specialization of CrsGraph for the new Kokkos Node types. More...
class  CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType >, typename KokkosClassic::DefaultKernels< Scalar, LocalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::SparseOps >
 Partial specialization of CrsMatrix for the new Kokkos wrapper Nodes. More...
class  Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >
 Describes a parallel distribution of objects over processes (Kokkos refactor specialization of Map). More...
class  Vector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >
 Partial specialization of Vector for Kokkos refactor Node types. More...
class  BlockCrsGraph
 Block-entry counterpart to Tpetra::CrsGraph. More...
class  BlockMap
 Block-entry counterpart to Tpetra::Map. More...
class  BlockMultiVector
 Block-entry specialization of Tpetra::MultiVector. More...
class  project1st
 Binary function that returns its first argument. More...
class  project2nd
 Binary function that returns its second argument. More...
class  firstArg
 DEPRECATED; please use project1st instead. More...
class  secondArg
 DEPRECATED; please use project2nd instead. More...
struct  RowInfo
 Allocation information for a locally owned row in a CrsGraph or CrsMatrix. More...
class  CrsGraph
 A distributed graph accessed by rows (adjacency lists) and stored sparsely. More...
class  CrsMatrix
 Sparse matrix that presents a compressed sparse row interface. More...
class  CrsMatrixMultiplyOp
 A class for wrapping a CrsMatrix multiply in a Operator. More...
class  CrsMatrixSolveOp
 Wrap a CrsMatrix instance's triangular solve in an Operator. More...
class  DefaultPlatform
 Returns a default platform appropriate for the enviroment. More...
class  Directory
 Implement mapping from global ID to process ID and local ID. More...
class  DistObject
 Base class for distributed Tpetra objects that support data redistribution. More...
class  Distributor
 Sets up and executes a communication plan for a Tpetra DistObject. More...
class  Export
 Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distribution. More...
class  HybridPlatform
 A platform class for hybrid nodes. More...
class  Import
 Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distribution. More...
class  ImportExportData
 Implementation detail of Import and Export. More...
class  Map
 Describes a parallel distribution of objects over processes. More...
class  MpiPlatform
 Implementation of the Platform concept for MPI-based platforms. More...
class  MultiVector
 One or more distributed dense vectors. More...
class  MultiVectorFiller
 Adds nonlocal sum-into functionality to Tpetra::MultiVector. More...
class  Operator
 Abstract interface for operators (e.g., matrices and preconditioners). More...
class  Packable
 Abstract base class for objects that can be the source of an Import or Export operation, and that also know how to pack their data to send to the target object. More...
class  RowGraph
 An abstract interface for graphs accessed by rows. More...
class  RowMatrix
 A read-only, row-oriented interface to a sparse matrix. More...
class  RowMatrixTransposer
 Construct and (optionally) redistribute the transpose of a CrsMatrix. More...
class  SerialPlatform
 Implementation of the Platform concept for non-MPI platforms. More...
class  SrcDistObject
 Abstract base class for objects that can be the source of an Import or Export operation. More...
class  VbrMatrix
 VbrMatrix: Variable block row matrix. More...
class  Vector
 A distributed dense vector. More...

Typedefs

typedef Teuchos_Ordinal Array_size_type
 Size type for Teuchos Array objects.
typedef size_t global_size_t
 Global size_t object.

Enumerations

enum  CombineMode {
  ADD, INSERT, REPLACE, ABSMAX,
  ZERO
}
 Rule for combining data in an Import or Export. More...
enum  LocalGlobal { LocallyReplicated, GloballyDistributed }
enum  LookupStatus { AllIDsPresent, IDNotPresent }
enum  ProfileType { StaticProfile, DynamicProfile }
enum  OptimizeOption { DoOptimizeStorage, DoNotOptimizeStorage }
enum  ESweepDirection
 Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR). More...

Functions

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
Teuchos::RCP< MultiVector
< Scalar, LocalOrdinal,
GlobalOrdinal,
Kokkos::Compat::KokkosDeviceWrapperNode
< DeviceType > > > 
createMultiVectorFromView (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > &map, const Teuchos::ArrayRCP< Scalar > &view, const size_t LDA, const size_t numVectors)
 Nonmember MultiVector constructor with view semantics using user-allocated data.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
RCP< Vector< Scalar,
LocalOrdinal, GlobalOrdinal,
Kokkos::Compat::KokkosDeviceWrapperNode
< DeviceType > > > 
createVectorFromView (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > &map, const ArrayRCP< Scalar > &view)
 Non-member function to create a Vector from a specified Map.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
Vector< Scalar, LocalOrdinal,
GlobalOrdinal,
Kokkos::Compat::KokkosDeviceWrapperNode
< DeviceType > > 
createCopy (const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > &src)
 Return a deep copy of the Vector src.
void setCombineModeParameter (Teuchos::ParameterList &plist, const std::string &paramName)
 Set CombineMode parameter in a Teuchos::ParameterList.
bool isInitialized ()
 Whether Tpetra is in an initialized state.
Teuchos::RCP< const
Teuchos::Comm< int > > 
getDefaultComm ()
 Get Tpetra's default communicator.
void initialize (int *argc, char ***argv)
 Initialize Tpetra.
void initialize (int *argc, char ***argv, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
 Initialize Tpetra.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< CrsGraph
< LocalOrdinal, GlobalOrdinal,
Node > > 
createCrsGraph (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow=0, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
 Non-member function to create an empty CrsGraph given a row map and a non-zero profile.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< CrsMatrix
< Scalar, LocalOrdinal,
GlobalOrdinal, Node > > 
createCrsMatrix (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow=0, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
 Non-member function to create an empty CrsMatrix given a row map and a non-zero profile.
template<class CrsMatrixType >
Teuchos::RCP< CrsMatrixType > importAndFillCompleteCrsMatrix (const Teuchos::RCP< const CrsMatrixType > &sourceMatrix, const Import< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > &importer, const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
 Nonmember CrsMatrix constructor that fuses Import and fillComplete().
template<class CrsMatrixType >
Teuchos::RCP< CrsMatrixType > exportAndFillCompleteCrsMatrix (const Teuchos::RCP< const CrsMatrixType > &sourceMatrix, const Export< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > &exporter, const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
 Nonmember CrsMatrix constructor that fuses Export and fillComplete().
template<class Scalar , class MatScalar , class LocalOrdinal , class GlobalOrdinal , class Node , class LocalMatOps >
Teuchos::RCP
< CrsMatrixMultiplyOp< Scalar,
MatScalar, LocalOrdinal,
GlobalOrdinal, Node,
LocalMatOps > > 
createCrsMatrixMultiplyOp (const Teuchos::RCP< const CrsMatrix< MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > &A)
 Non-member function to create a CrsMatrixMultiplyOp.
template<class Scalar , class MatScalar , class LocalOrdinal , class GlobalOrdinal , class Node , class LocalMatOps >
Teuchos::RCP< CrsMatrixSolveOp
< Scalar, MatScalar,
LocalOrdinal, GlobalOrdinal,
Node, LocalMatOps > > 
createCrsMatrixSolveOp (const Teuchos::RCP< const CrsMatrix< MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > &A)
 Non-member function to create CrsMatrixSolveOp.
template<class DistObjectType >
void removeEmptyProcessesInPlace (Teuchos::RCP< DistObjectType > &input, const Teuchos::RCP< const Map< typename DistObjectType::local_ordinal_type, typename DistObjectType::global_ordinal_type, typename DistObjectType::node_type > > &newMap)
 Remove processes which contain no elements in this object's Map.
template<class DistObjectType >
void removeEmptyProcessesInPlace (Teuchos::RCP< DistObjectType > &input)
 Remove processes which contain no elements in this object's Map.
Array< std::string > distributorSendTypes ()
 Valid values for Distributor's "Send type" parameter.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Export
< LocalOrdinal, GlobalOrdinal,
Node > > 
createExport (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &src, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &tgt)
 Non-member constructor for Export objects.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Import
< LocalOrdinal, GlobalOrdinal,
Node > > 
createImport (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &src, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &tgt)
 Nonmember constructor for Import.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Import
< LocalOrdinal, GlobalOrdinal,
Node > > 
createImport (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &src, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &tgt, const Teuchos::RCP< Teuchos::ParameterList > &plist)
 Nonmember constructor for Import that takes a ParameterList.
template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal > > 
createLocalMap (size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
 Nonmember constructor for a locally replicated Map with the default Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createLocalMapWithNode (size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=KokkosClassic::Details::getNode< Node >())
 Nonmember constructor for a locally replicated Map with a specified Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal > > 
createUniformContigMap (global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
 Non-member constructor for a uniformly distributed, contiguous Map with the default Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createUniformContigMapWithNode (global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=KokkosClassic::Details::getNode< Node >())
 Non-member constructor for a uniformly distributed, contiguous Map with a user-specified Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
KokkosClassic::DefaultNode::DefaultNodeType > > 
createContigMap (global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
 Non-member constructor for a (potentially) non-uniformly distributed, contiguous Map with the default Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createContigMapWithNode (global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
 Non-member constructor for a (potentially) non-uniformly distributed, contiguous Map with a user-specified Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
KokkosClassic::DefaultNode::DefaultNodeType > > 
createNonContigMap (const ArrayView< const GlobalOrdinal > &elementList, const RCP< const Teuchos::Comm< int > > &comm)
 Non-member constructor for a non-contiguous Map with the default Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createNonContigMapWithNode (const ArrayView< const GlobalOrdinal > &elementList, const RCP< const Teuchos::Comm< int > > &comm, const RCP< Node > &node)
 Non-member constructor for a non-contiguous Map with a user-specified Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createWeightedContigMapWithNode (int thisNodeWeight, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
 Non-member constructor for a contiguous Map with user-defined weights and a user-specified Kokkos Node.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createOneToOne (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M)
 Creates a one-to-one version of the given Map where each GID is owned by only one process.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
createOneToOne (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M, const Tpetra::Details::TieBreak< LocalOrdinal, GlobalOrdinal > &tie_break)
 Creates a one-to-one version of the given Map where each GID is owned by only one process. The rule to break ties is specifed by the tie break object.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
MultiVector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > 
createCopy (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &src)
 Return a deep copy of the MultiVector src.
template<class DS , class DL , class DG , class DN , class SS , class SL , class SG , class SN >
void deep_copy (MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
 Copy the contents of the MultiVector src into dst.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< MultiVector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node > > 
createMultiVector (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const size_t numVectors)
 Nonmember MultiVector constructor: make a MultiVector from a given Map.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< MultiVector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node > > 
createMultiVectorFromView (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayRCP< Scalar > &view, const size_t LDA, const size_t numVectors)
 Nonmember MultiVector constructor with view semantics using user-allocated data.
template<typename MapType , typename KeyArgType , typename ValueArgType >
MapType::iterator efficientAddOrUpdate (MapType &m, const KeyArgType &k, const ValueArgType &v)
 Efficiently insert or replace an entry in an std::map.
template<class IT1 , class IT2 >
void sort2 (const IT1 &first1, const IT1 &last1, const IT2 &first2)
 Sort the first array, and apply the resulting permutation to the second array.
template<class IT1 , class IT2 , class IT3 >
void sort3 (const IT1 &first1, const IT1 &last1, const IT2 &first2, const IT3 &first3)
 Sort the first array, and apply the same permutation to the second and third arrays.
template<class IT1 , class IT2 >
void merge2 (IT1 &indResultOut, IT2 &valResultOut, IT1 indBeg, IT1 indEnd, IT2 valBeg, IT2 valEnd)
 Merge values in place, additively, with the same index.
template<class IT1 , class IT2 , class BinaryFunction >
void merge2 (IT1 &indResultOut, IT2 &valResultOut, IT1 indBeg, IT1 indEnd, IT2 valBeg, IT2 valEnd, BinaryFunction f)
 Merge values in place with the same index, using any associative binary function.
template<class KeyInputIterType , class ValueInputIterType , class KeyOutputIterType , class ValueOutputIterType , class BinaryFunction >
void keyValueMerge (KeyInputIterType keyBeg1, KeyInputIterType keyEnd1, ValueInputIterType valBeg1, ValueInputIterType valEnd1, KeyInputIterType keyBeg2, KeyInputIterType keyEnd2, ValueInputIterType valBeg2, ValueInputIterType valEnd2, KeyOutputIterType keyOut, ValueOutputIterType valOut, BinaryFunction f)
 Merge two sorted (by keys) sequences of unique (key,value) pairs by combining pairs with equal keys.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< Vector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
createVector (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
 Non-member function to create a Vector from a specified Map.
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< Vector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
createVectorFromView (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const ArrayRCP< Scalar > &view)
 Non-member function to create a Vector with view semantics using user-allocated data.

Detailed Description

Namespace Tpetra contains the class and methods constituting the Tpetra library.

Tpetra_CrsMatrixTransposer: A class for transposing an Tpetra_CrsMatrix object.

Namespace for Tpetra classes and methods.

Tpetra namespace


Typedef Documentation

typedef Teuchos_Ordinal Tpetra::Array_size_type

Size type for Teuchos Array objects.

Definition at line 91 of file Tpetra_ConfigDefs.hpp.

typedef size_t Tpetra::global_size_t

Global size_t object.

Set at configure time, this type is intended to support scenarios where the global memory allocation is larger than that of a single node.

Currently, it is typedefed to size_t.

Examples:
lesson03_power_method.cpp.

Definition at line 152 of file Tpetra_ConfigDefs.hpp.


Enumeration Type Documentation

Rule for combining data in an Import or Export.

Import or Export (data redistribution) operations might need to combine data received from other processes with existing data on the calling process. This enum tells Tpetra how to do that for a specific Import or Export operation. Each Tpetra object may interpret the CombineMode in a different way, so you should check the Tpetra object's documentation for details.

Here is the list of supported combine modes:

  • ADD: Sum new values into existing values
  • INSERT: Insert new values that don't currently exist
  • REPLACE: Replace existing values with new values
  • ABSMAX: If $x_{old}$ is the old value and $x_{new}$ the incoming new value, replace $x_{old}$ with $\max\{ x_{old}, x_{new} \}$.
  • ZERO: Replace old values with zero

ADD and REPLACE are intended for modifying values that already exist. Tpetra objects will generally work correctly if those values don't already exist. (For example, ADD will behave like INSERT if the entry does not yet exist on the calling process.) However, performance may suffer.

The ZERO combine mode is a special case that bypasses communication. It may seem odd to include a "combine mode" that doesn't actually combine. However, this is useful for computations like domain decomposition with overlap. A ZERO combine mode with overlap is different than an ADD combine mode without overlap. (See Ifpack2::AdditiveSchwarz, which inspired inclusion of this combine mode.) Furthermore, Import and Export also encapsulate a local permutation; if you want only to execute the local permutation without communication, you may use the ZERO combine mode.

Enumerator:
ADD 

Sum new values into existing values.

INSERT 

Insert new values that don't currently exist.

REPLACE 

Replace existing values with new values.

ABSMAX 

Replace old value with maximum of magnitudes of old and new values.

ZERO 

Replace old values with zero.

Definition at line 94 of file Tpetra_CombineMode.hpp.

Local versus global allocation of Map elements

Enumerator:
LocallyReplicated 

Indicates that map elements are locally replicated across all nodes

GloballyDistributed 

Indicates that map elements are globally distributed across all nodes

Definition at line 155 of file Tpetra_ConfigDefs.hpp.

Return status of Map lookup

Enumerator:
AllIDsPresent 

Indicates that all queried IDs were present in the Map

IDNotPresent 

Indicates that at least one of the specified IDs was not present in the Map

Definition at line 161 of file Tpetra_ConfigDefs.hpp.

Allocation profile for matrix/graph entries

Enumerator:
StaticProfile 

Indicates a single, static allocation (strict and more efficient)

DynamicProfile 

Indicates multiple, dynamic allocations (flexibile, but less efficient)

Definition at line 167 of file Tpetra_ConfigDefs.hpp.

Optimize storage option

Enumerator:
DoOptimizeStorage 

Indicates that storage should be optimized

DoNotOptimizeStorage 

Indicates that storage should not be optimized

Definition at line 173 of file Tpetra_ConfigDefs.hpp.

Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR).

Definition at line 324 of file Tpetra_ConfigDefs.hpp.


Function Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > createMultiVectorFromView ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > &  map,
const Teuchos::ArrayRCP< Scalar > &  view,
const size_t  LDA,
const size_t  numVectors 
)

Nonmember MultiVector constructor with view semantics using user-allocated data.

Warning:
This function is not supported for all Kokkos Node types. Specifically, it is not typically supported for GPU accelerator-based nodes like KokkosClassic::ThrustGPUNode.
Parameters:
map[in] The Map describing the distribution of rows of the multivector.
view[in/out] A pointer to column-major dense matrix data. This will be the multivector's data on the calling process. The multivector will use the pointer directly, without copying.
LDA[in] The leading dimension (a.k.a. "stride") of the column-major input data.
numVectors[in] The number of columns in the input data. This will be the number of vectors in the returned multivector.

To Kokkos and Tpetra developers: If you add a new Kokkos Node type that is a host Node type (where memory lives in user space, not in a different space as on a GPU), you will need to add a specialization of Tpetra::details::ViewAccepter for your new Node type.

Definition at line 3632 of file Tpetra_KokkosRefactor_MultiVector_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > createVectorFromView ( const RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > &  map,
const ArrayRCP< Scalar > &  view 
)

Non-member function to create a Vector from a specified Map.

Non-member function to create a Vector with view semantics using user-allocated data.

This use case is not supported for all nodes. Specifically, it is not typically supported for accelerator-based nodes like KokkosClassic::ThrustGPUNode.

Definition at line 270 of file Tpetra_KokkosRefactor_Vector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class DeviceType >
Vector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > Tpetra::createCopy ( const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > &  src)

Return a deep copy of the Vector src.

This is the preferred way to make a deep copy of a Vector. The new Kokkos refactor implementations of Tpetra objects have view semantics, which means that the copy constructor and assignment operator (operator=) make shallow copies. To make a deep copy, call the nonmember function createCopy().

Definition at line 340 of file Tpetra_KokkosRefactor_Vector_def.hpp.

void Tpetra::setCombineModeParameter ( Teuchos::ParameterList plist,
const std::string &  paramName 
)

Set CombineMode parameter in a Teuchos::ParameterList.

If you are constructing a Teuchos::ParameterList with a CombineMode parameter, set the parameter by using this function. This will use a special feature of Teuchos -- custom parameter list validation -- so that users can specify CombineMode values by string, rather than enum value. The strings are the same as the enum names: "ADD", "INSERT", "REPLACE", "ABSMAX", and "ZERO". They are not case sensitive.

Using this function to set a CombineMode parameter will ensure that the XML serialization of the resulting Teuchos::ParameterList will refer to the CombineMode enum values using human-readable string names, rather than raw integers.

Parameters:
plist[out] Teuchos::ParameterList to which you want to add the Tpetra::CombineMode parameter.
paramName[in] String name to use for the parameter. For example, you might wish to call the parameter "Combine Mode", "Tpetra::CombineMode", or "combine mode". The parameter's name is case sensitive, even though the string values are not.

Definition at line 48 of file Tpetra_CombineMode.cpp.

bool Tpetra::isInitialized ( )

Whether Tpetra is in an initialized state.

Initialize Tpetra by calling one of the versions of initialize(). After initialize() returns, Tpetra is initialized. Once finalize() returns, Tpetra is no longer initialized.

Definition at line 95 of file Tpetra_Core.cpp.

Teuchos::RCP< const Teuchos::Comm< int > > Tpetra::getDefaultComm ( )

Get Tpetra's default communicator.

Precondition:
One of the Tpetra::initialize() functions has been called.
Returns:
If one of the versions of initialize() was called that takes a default communicator, this function returns that communicator. Otherwise, this function returns MPI_COMM_WORLD (wrapped in a Teuchos wrapper) if Trilinos was built with MPI enabled, or a Teuchos::SerialComm instance otherwise.

Definition at line 99 of file Tpetra_Core.cpp.

void Tpetra::initialize ( int *  argc,
char ***  argv 
)

Initialize Tpetra.

This initializes the following if they have not already been initialized:

If Trilinos was built with MPI enabled, this function sets the default communicator to MPI_COMM_WORLD (wrapped in a Teuchos wrapper). Otherwise, it sets the default communicator to a Teuchos::SerialComm instance.

Parameters:
argc[in/out] Same as first argument of MPI_Init()
argv[in/out] Same as second argument of MPI_Init()

The argc and argv arguments are both passed by pointer, in order to match MPI_Init's interface. MPI_Init() reserves the right to modify command-line arguments, e.g., by reading and removing those that pertain to MPI. Thus, in main(), one would write

 Tpetra::initialize (&argc, &argc);

Definition at line 114 of file Tpetra_Core.cpp.

void Tpetra::initialize ( int *  argc,
char ***  argv,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm 
)

Initialize Tpetra.

This initializes the following if they have not already been initialized:

Parameters:
argc[in/out] Same as first argument of MPI_Init()
argv[in/out] Same as second argument of MPI_Init()
comm[in] Tpetra's default communicator, wrapped in a Teuchos wrapper. This may be either a Teuchos::MpiComm or a Teuchos::SerialComm instance.

The argc and argv arguments are both passed by pointer, in order to match MPI_Init's interface. MPI_Init() reserves the right to modify command-line arguments, e.g., by reading and removing those that pertain to MPI. Thus, in main(), one would write

 Teuchos::RCP<const Teuchos::Comm<int> > comm = ...; // whatever you want
 Tpetra::initialize (&argc, &argc, comm);

Definition at line 175 of file Tpetra_Core.cpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > createCrsGraph ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
size_t  maxNumEntriesPerRow = 0,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null 
)

Non-member function to create an empty CrsGraph given a row map and a non-zero profile.

Returns:
A dynamically allocated (DynamicProfile) graph with specified number of nonzeros per row (defaults to zero).

Definition at line 1771 of file Tpetra_CrsGraph_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createCrsMatrix ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
size_t  maxNumEntriesPerRow = 0,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null 
)

Non-member function to create an empty CrsMatrix given a row map and a non-zero profile.

Returns:
A dynamically allocated (DynamicProfile) matrix with specified number of nonzeros per row (defaults to zero).

Definition at line 2476 of file Tpetra_CrsMatrix_decl.hpp.

template<class CrsMatrixType >
Teuchos::RCP< CrsMatrixType > importAndFillCompleteCrsMatrix ( const Teuchos::RCP< const CrsMatrixType > &  sourceMatrix,
const Import< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > &  importer,
const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &  domainMap = Teuchos::null,
const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &  rangeMap = Teuchos::null,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null 
)

Nonmember CrsMatrix constructor that fuses Import and fillComplete().

Template Parameters:
CrsMatrixTypeA specialization of CrsMatrix.

A common use case is to create an empty destination CrsMatrix, redistribute from a source CrsMatrix (by an Import or Export operation), then call fillComplete() on the destination CrsMatrix. This constructor fuses these three cases, for an Import redistribution.

Fusing redistribution and fillComplete() exposes potential optimizations. For example, it may make constructing the column Map faster, and it may avoid intermediate unoptimized storage in the destination CrsMatrix. These optimizations may improve performance for specialized kernels like sparse matrix-matrix multiply, as well as for redistributing data after doing load balancing.

The resulting matrix is fill complete (in the sense of isFillComplete()) and has optimized storage (in the sense of isStorageOptimized()). By default, its domain Map is the domain Map of the source matrix, and its range Map is the range Map of the source matrix.

Warning:
If the target Map of the Import is a subset of the source Map of the Import, then you cannot use the default range Map. You should instead construct a nonoverlapping version of the target Map and supply that as the nondefault value of the range Map.
Parameters:
sourceMatrix[in] The source matrix from which to import. The source of an Import must have a nonoverlapping distribution.
importer[in] The Import instance containing a precomputed redistribution plan. The source Map of the Import must be the same as the rowMap of sourceMatrix unless the "Reverse Mode" option on the params list, in which case the targetMap of Import must match the rowMap of the sourceMatrix
domainMap[in] Domain Map of the returned matrix. If null, we use the default, which is the domain Map of the source matrix.
rangeMap[in] Range Map of the returned matrix. If null, we use the default, which is the range Map of the source matrix.
params[in/out] Optional list of parameters. If not null, any missing parameters will be filled in with their default values.

Definition at line 2538 of file Tpetra_CrsMatrix_decl.hpp.

template<class CrsMatrixType >
Teuchos::RCP< CrsMatrixType > exportAndFillCompleteCrsMatrix ( const Teuchos::RCP< const CrsMatrixType > &  sourceMatrix,
const Export< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > &  exporter,
const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &  domainMap = Teuchos::null,
const Teuchos::RCP< const Map< typename CrsMatrixType::local_ordinal_type, typename CrsMatrixType::global_ordinal_type, typename CrsMatrixType::node_type > > &  rangeMap = Teuchos::null,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null 
)

Nonmember CrsMatrix constructor that fuses Export and fillComplete().

Template Parameters:
CrsMatrixTypeA specialization of CrsMatrix.

For justification, see the documentation of importAndFillCompleteCrsMatrix() (which is the Import analog of this function).

The resulting matrix is fill complete (in the sense of isFillComplete()) and has optimized storage (in the sense of isStorageOptimized()). By default, its domain Map is the domain Map of the source matrix, and its range Map is the range Map of the source matrix.

Parameters:
sourceMatrix[in] The source matrix from which to export. Its row Map may be overlapping, since the source of an Export may be overlapping.
exporter[in] The Export instance containing a precomputed redistribution plan. The source Map of the Export must be the same as the row Map of sourceMatrix.
domainMap[in] Domain Map of the returned matrix. If null, we use the default, which is the domain Map of the source matrix.
rangeMap[in] Range Map of the returned matrix. If null, we use the default, which is the range Map of the source matrix.
params[in/out] Optional list of parameters. If not null, any missing parameters will be filled in with their default values.

Definition at line 2590 of file Tpetra_CrsMatrix_decl.hpp.

template<class Scalar , class MatScalar , class LocalOrdinal , class GlobalOrdinal , class Node , class LocalMatOps >
Teuchos::RCP< CrsMatrixMultiplyOp< Scalar, MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > createCrsMatrixMultiplyOp ( const Teuchos::RCP< const CrsMatrix< MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > &  A)

Non-member function to create a CrsMatrixMultiplyOp.

The function has the same template parameters of CrsMatrixMultiplyOp.

Parameters:
A[in] The CrsMatrix instance to wrap in an CrsMatrixMultiplyOp.
Returns:
The CrsMatrixMultiplyOp wrapper for the given CrsMatrix.
template<class Scalar , class MatScalar , class LocalOrdinal , class GlobalOrdinal , class Node , class LocalMatOps >
Teuchos::RCP< CrsMatrixSolveOp< Scalar, MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > createCrsMatrixSolveOp ( const Teuchos::RCP< const CrsMatrix< MatScalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > &  A)

Non-member function to create CrsMatrixSolveOp.

template<class DistObjectType >
void Tpetra::removeEmptyProcessesInPlace ( Teuchos::RCP< DistObjectType > &  input,
const Teuchos::RCP< const Map< typename DistObjectType::local_ordinal_type, typename DistObjectType::global_ordinal_type, typename DistObjectType::node_type > > &  newMap 
)

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

Template Parameters:
DistObjectTypeA specialization of DistObject.
Warning:
This method is ONLY for use by experts. The fact that the documentation of this method starts with a "Vocabulary" section should give you proper respect for the complicated semantics of this method in a parallel MPI run.
We make NO promises of backwards compatibility. This method may change or disappear at any time.

Vocabulary:

  • The Map returned by input->getMap() on input to this method is the "original Map."
  • The communicator returned by input->getComm() on input to this method is the "original communicator."
  • All processes in the original communicator which contain zero elements in the original Map are "excluded processes."
  • All other processes in the original communicator are "included processes."

Preconditions:

  • The nonnull object input is distributed over the original Map.
  • The input Map newMap must be the same as the result of calling removeEmptyProcesses() on the original Map.
  • On excluded processes, newMap must be Teuchos::null. (This is what getMap()->removeEmptyProcesses() returns anyway on excluded processes.)

This method has collective semantics over the original communicator. 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. The input DistObject input will be nonnull on return. On excluded processes, free any data in input that need freeing, do any other work that needs to be done to restore correct semantics, and set input to null before returning.

The two-argument version of this function is useful if you have already precomputed the new Map that excludes processes with zero elements. For example, you might want to apply this Map to several different MultiVector instances. The one-argument version of this function is useful if you want the DistObject to compute the new Map itself, because you only plan to use it for that one DistObject instance.

Here is a sample use case. Suppose that input is some subclass of DistObject, like MultiVector, CrsGraph, or CrsMatrix. Suppose also that map_type is the corresponding specialization of Map.

 RCP<const map_type> origRowMap = input->getMap ();
 RCP<const map_type> newRowMap = origRowMap->removeEmptyProcesses ();
 removeEmptyProcessesInPlace (input, newRowMap);
 // Either (both the new Map and input are null), or
 // (both the new Map and input are not null).
 assert ((newRowMap.is_null () && input.is_null ()) ||
         (! newRowMap.is_null () && ! input.is_null ()));

Warning:
On excluded processes, calling this function invalidates any other references to the input DistObject input. Calling any methods (other than the destructor) on the input on excluded processes has undefined behavior in that case, and may result in deadlock.
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.
To implementers of DistObject subclasses: On exit, the only method of this object which is safe to call on excluded processes is the destructor, or this method with the original Map. This implies that subclasses' destructors must not contain communication operations.

Definition at line 168 of file Tpetra_DistObject_def.hpp.

template<class DistObjectType >
void Tpetra::removeEmptyProcessesInPlace ( Teuchos::RCP< DistObjectType > &  input)

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

Template Parameters:
DistObjectTypeA specialization of DistObject.
Warning:
This method is ONLY for use by experts.
We make NO promises of backwards compatibility. This method may change or disappear at any time.

This method behaves just like the two-argument version of removeEmptyProcessesInPlace(), except that it first calls removeEmptyProcesses() on the input DistObject's Map to compute the new Map.

The two-argument version of this function is useful if you have already precomputed the new Map that excludes processes with zero elements. For example, you might want to apply this Map to several different MultiVector instances. The one-argument version of this function is useful if you want the DistObject to compute the new Map itself, because you only plan to use it for that one DistObject instance.

Here is a sample use case. Suppose that input is some subclass of DistObject, like MultiVector, CrsGraph, or CrsMatrix. Suppose also that map_type is the corresponding specialization of Map.

 removeEmptyProcessesInPlace (input);
 RCP<const map_type> newRowMap;
 if (! input.is_null ()) {
   newRowMap = input->getMap ();
 }
 // Either (both the new Map and input are null), or
 // (both the new Map and input are not null).
 assert ((newRowMap.is_null () && input.is_null ()) ||
         (! newRowMap.is_null () && ! input.is_null ()));

Definition at line 181 of file Tpetra_DistObject_def.hpp.

Array< std::string > Tpetra::distributorSendTypes ( )

Valid values for Distributor's "Send type" parameter.

This is mainly useful as an implementation detail of Distributor. You may use it if you would like a programmatic way to get all possible values of the "Send type" parameter of Distributor.

Definition at line 91 of file Tpetra_Distributor.cpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > createExport ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  src,
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  tgt 
)

Non-member constructor for Export objects.

Creates a Export object from the given source and target maps.

Precondition:
src != null
tgt != null
Returns:
The Export object. If src == tgt, returns null. (Debug mode: throws std::runtime_error if one of src or tgt is null.)

Definition at line 329 of file Tpetra_Export_decl.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createImport ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  src,
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  tgt 
)

Nonmember constructor for Import.

Create a Import object from the given source and target Maps.

Precondition:
src != null
tgt != null
Returns:
The Import object. If src == tgt, returns null. (Debug mode: throws std::runtime_error if one of src or tgt is null.)

Definition at line 511 of file Tpetra_Import_decl.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createImport ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  src,
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  tgt,
const Teuchos::RCP< Teuchos::ParameterList > &  plist 
)

Nonmember constructor for Import that takes a ParameterList.

Create a Import object from the given source and target Maps, using the given list of parameters.

Precondition:
src != null
tgt != null
Returns:
The Import object. If src == tgt, returns null. (Debug mode: throws std::runtime_error if one of src or tgt is null.)

Definition at line 541 of file Tpetra_Import_decl.hpp.

template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createLocalMap ( size_t  numElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm 
)

Nonmember constructor for a locally replicated Map with the default Kokkos Node.

This method returns a Map instantiated on the default Kokkos Node type, KokkosClassic::DefaultNode::DefaultNodeType. The Map is configured to use zero-based indexing.

Parameters:
numElements[in] Number of elements on each process. Each process gets the same set of elements, namely 0, 1, ..., numElements - 1.
comm[in] The Map's communicator.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode ( size_t  numElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm,
const Teuchos::RCP< Node > &  node = KokkosClassic::Details::getNode< Node >() 
)

Nonmember constructor for a locally replicated Map with a specified Kokkos Node.

This method returns a Map instantiated on the given Kokkos Node instance. The Map is configured to use zero-based indexing.

Parameters:
numElements[in] Number of elements on each process. Each process gets the same set of elements, namely 0, 1, ..., numElements - 1.
comm[in] The Map's communicator.
node[in] The Kokkos Node instance. If not provided, we will construct an instance of the correct type for you.
template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createUniformContigMap ( global_size_t  numElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm 
)

Non-member constructor for a uniformly distributed, contiguous Map with the default Kokkos Node.

This method returns a Map instantiated on the Kokkos default Node type, KokkosClassic::DefaultNode::DefaultNodeType. The resulting Map uses zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode ( global_size_t  numElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm,
const Teuchos::RCP< Node > &  node = KokkosClassic::Details::getNode< Node >() 
)

Non-member constructor for a uniformly distributed, contiguous Map with a user-specified Kokkos Node.

The resulting Map uses zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, KokkosClassic::DefaultNode::DefaultNodeType > > createContigMap ( global_size_t  numElements,
size_t  localNumElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm 
)

Non-member constructor for a (potentially) non-uniformly distributed, contiguous Map with the default Kokkos Node.

This method returns a Map instantiated on the Kokkos default node type, KokkosClassic::DefaultNode::DefaultNodeType.

The Map is configured to use zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode ( global_size_t  numElements,
size_t  localNumElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm,
const Teuchos::RCP< Node > &  node 
)

Non-member constructor for a (potentially) non-uniformly distributed, contiguous Map with a user-specified Kokkos Node.

The Map is configured to use zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, KokkosClassic::DefaultNode::DefaultNodeType > > createNonContigMap ( const ArrayView< const GlobalOrdinal > &  elementList,
const RCP< const Teuchos::Comm< int > > &  comm 
)

Non-member constructor for a non-contiguous Map with the default Kokkos Node.

This method returns a Map instantiated on the Kokkos default node type, KokkosClassic::DefaultNode::DefaultNodeType.

The Map is configured to use zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createNonContigMapWithNode ( const ArrayView< const GlobalOrdinal > &  elementList,
const RCP< const Teuchos::Comm< int > > &  comm,
const RCP< Node > &  node 
)

Non-member constructor for a non-contiguous Map with a user-specified Kokkos Node.

The Map is configured to use zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createWeightedContigMapWithNode ( int  thisNodeWeight,
global_size_t  numElements,
const Teuchos::RCP< const Teuchos::Comm< int > > &  comm,
const Teuchos::RCP< Node > &  node 
)

Non-member constructor for a contiguous Map with user-defined weights and a user-specified Kokkos Node.

The Map is configured to use zero-based indexing.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  M)

Creates a one-to-one version of the given Map where each GID is owned by only one process.

The user must guarantee there are no duplicate GID on the same processor. Unexepected behavior may result.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  M,
const Tpetra::Details::TieBreak< LocalOrdinal, GlobalOrdinal > &  tie_break 
)

Creates a one-to-one version of the given Map where each GID is owned by only one process. The rule to break ties is specifed by the tie break object.

The user must guarantee there are no duplicate GID on the same processor. Unexepected behavior may result.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > Tpetra::createCopy ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  src)

Return a deep copy of the MultiVector src.

Regarding Copy or View semantics: The returned MultiVector is always a deep copy of src, but always has the same semantics as src. That is, if src has View semantics, then the returned MultiVector has View semantics, and if src has Copy semantics, then the returned MultiVector has Copy semantics.

You may call src.getCopyOrView () to test the semantics of the input MultiVector src. For example, the following will never trigger an assert:

 MultiVector<double> dst = createCopy (src);
 assert (dst.getCopyOrView () == src.getCopyOrView ());

In the Kokkos refactor version of Tpetra, MultiVector always has View semantics. However, the above remarks still apply.

Definition at line 3222 of file Tpetra_MultiVector_def.hpp.

template<class DS , class DL , class DG , class DN , class SS , class SL , class SG , class SN >
void Tpetra::deep_copy ( MultiVector< DS, DL, DG, DN > &  dst,
const MultiVector< SS, SL, SG, SN > &  src 
)

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

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

Nonmember MultiVector constructor: make 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.

Definition at line 1512 of file Tpetra_MultiVector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createMultiVectorFromView ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
const Teuchos::ArrayRCP< Scalar > &  view,
const size_t  LDA,
const size_t  numVectors 
)

Nonmember MultiVector constructor with view semantics using user-allocated data.

Warning:
This function is not supported for all Kokkos Node types. Specifically, it is not typically supported for GPU accelerator-based nodes like KokkosClassic::ThrustGPUNode.
Parameters:
map[in] The Map describing the distribution of rows of the multivector.
view[in/out] A pointer to column-major dense matrix data. This will be the multivector's data on the calling process. The multivector will use the pointer directly, without copying.
LDA[in] The leading dimension (a.k.a. "stride") of the column-major input data.
numVectors[in] The number of columns in the input data. This will be the number of vectors in the returned multivector.

To Kokkos and Tpetra developers: If you add a new Kokkos Node type that is a host Node type (where memory lives in user space, not in a different space as on a GPU), you will need to add a specialization of Tpetra::details::ViewAccepter for your new Node type.

Definition at line 1562 of file Tpetra_MultiVector_decl.hpp.

template<typename MapType , typename KeyArgType , typename ValueArgType >
MapType::iterator Tpetra::efficientAddOrUpdate ( MapType &  m,
const KeyArgType &  k,
const ValueArgType &  v 
)

Efficiently insert or replace an entry in an std::map.

Template Parameters:
MapTypeSpecialization of std::map
KeyArgTypeType of keys of the std::map
ValueArgTypeType of values of the std::map

This function is taken from Scott Meyers' "Effective STL", Item 24. If the given std::map m already contains an entry with key k, replace its value with the given value v. Otherwise, insert (k,v) into the std::map. In both cases, return an iterator that points to the inserted or updated entry.

Definition at line 249 of file Tpetra_Util.hpp.

template<class IT1 , class IT2 >
void Tpetra::sort2 ( const IT1 &  first1,
const IT1 &  last1,
const IT2 &  first2 
)

Sort the first array, and apply the resulting permutation to the second array.

Sort the values in the first array (represented by the exclusive iterator range first1,last1) in ascending order. Apply the permutation resulting from the sort to the second array (represented by a starting iterator first2).

Parameters:
first1A random access iterator pointing to the beginning of the first array.
last1A random access iterator pointing to the end (exclusive) of the first array.
first2A random access iterator pointing to the beginning of the second array. The second array must have no fewer elements than the first array. If the first array has N elements, then the permutation will only be applied to the first N elements of the second array.

Definition at line 545 of file Tpetra_Util.hpp.

template<class IT1 , class IT2 , class IT3 >
void Tpetra::sort3 ( const IT1 &  first1,
const IT1 &  last1,
const IT2 &  first2,
const IT3 &  first3 
)

Sort the first array, and apply the same permutation to the second and third arrays.

Sort the values in the first array (represented by the exclusive iterator range first1,last1) in ascending order. Apply the permutation resulting from the sort to the second array (represented by a starting iterator first2) and third array (represented by a starting iterator first3).

Parameters:
first1A random access iterator pointing to the beginning of the first array.
last1A random access iterator pointing to the end (exclusive) of the first array.
first2A random access iterator pointing to the beginning of the second array.
first3A random access iterator pointing to the beginning of the third array.

Definition at line 579 of file Tpetra_Util.hpp.

template<class IT1 , class IT2 >
void Tpetra::merge2 ( IT1 &  indResultOut,
IT2 &  valResultOut,
IT1  indBeg,
IT1  indEnd,
IT2  valBeg,
IT2  valEnd 
)

Merge values in place, additively, with the same index.

Template Parameters:
IT1Iterator type for the range of indices
IT2Iterator type for the range of values

indBeg, indEnd defines a half-exclusive (does not include the end) range of indices, and valBeg, valEnd its corresponding range of values. The range of values must have the same number of entries as the range of indices. In every nondecreasing subsequence of indices, this method will merge values that have the same index, by adding the values together. When done, it assigns the new end (exclusive) of the index range to indResultOut, and the new end (exclusive) of the value range to valResultOut. (It is legal for the index range not to be sorted, but then only nondecreasing subsequences will get merged.)

For example, if the indices on input are {0, 1, 1, 3, -1, -1, -1, 0}, and their corresponding values on input are {42.0, -4.0, -3.0, 1.5, 1.0, 2.0, 3.0}, then on exit from this function, the indices are {0, 1, 3, -1, 0}, and the values are {42.0, -7.0, 1.5, 6.0, 100.0}.

On entry to the function, indResultOut may alias indEnd, and valResultOut may alias valEnd. For example, the following code is legal:

 std::vector<int> ind (...);
 std::vector<double> val (...);
 // ... fill ind and val ...
 std::vector<int>::iterator indEnd = ind.end ();
 std::vector<int>::iterator valEnd = val.end ();
 merge2 (indEnd, valEnd, ind.begin (), indEnd, val.begin (), valEnd);

However, the following code is not legal, because the return value of std::vector::end() cannot be modified:

 std::vector<int> ind (...);
 std::vector<double> val (...);
 // ... fill ind and val ...
 merge2 (ind.end (), val.end (), ind.begin (), ind.end (),
         val.begin (), val.end ());

Definition at line 646 of file Tpetra_Util.hpp.

template<class IT1 , class IT2 , class BinaryFunction >
void Tpetra::merge2 ( IT1 &  indResultOut,
IT2 &  valResultOut,
IT1  indBeg,
IT1  indEnd,
IT2  valBeg,
IT2  valEnd,
BinaryFunction  f 
)

Merge values in place with the same index, using any associative binary function.

Template Parameters:
IT1Iterator type for the range of indices
IT2Iterator type for the range of values
BinaryFunctionThe type of a function that takes two values and returns another value.

indBeg, indEnd defines a half-exclusive (does not include the end) range of indices, and valBeg, valEnd its corresponding range of values. The range of values must have the same number of entries as the range of indices. In every nondecreasing subsequence of indices, this method will merge values that have the same index, by using the given binary function. When done, it assigns the new end (exclusive) of the index range to indResultOut, and the new end (exclusive) of the value range to valResultOut. (It is legal for the index range not to be sorted, but then only nondecreasing subsequences will get merged.)

For example, if the indices on input are {0, 1, 1, 3, -1, -1, -1, 0}, their corresponding values on input are {42.0, -4.0, -3.0, 1.5, 1.0, 2.0, 3.0}, and the binary function is an instance of std::plus<double>, then on exit from this function, the indices are {0, 1, 3, -1, 0}, and the values are {42.0, -7.0, 1.5, 6.0, 100.0}.

On entry to the function, indResultOut may alias indEnd, and valResultOut may alias valEnd. For example, the following code is legal:

 std::vector<int> ind (...);
 std::vector<double> val (...);
 // ... fill ind and val ...
 std::vector<int>::iterator indEnd = ind.end ();
 std::vector<int>::iterator valEnd = val.end ();
 merge2 (indEnd, valEnd, ind.begin (), indEnd,
         val.begin (), valEnd, std::plus<double> ());

However, the following code is not legal, because the return value of std::vector::end() cannot be modified:

 std::vector<int> ind (...);
 std::vector<double> val (...);
 // ... fill ind and val ...
 merge2 (ind.end (), val.end (), ind.begin (), ind.end (),
         val.begin (), val.end (), std::plus<double> ());

Definition at line 735 of file Tpetra_Util.hpp.

template<class KeyInputIterType , class ValueInputIterType , class KeyOutputIterType , class ValueOutputIterType , class BinaryFunction >
void Tpetra::keyValueMerge ( KeyInputIterType  keyBeg1,
KeyInputIterType  keyEnd1,
ValueInputIterType  valBeg1,
ValueInputIterType  valEnd1,
KeyInputIterType  keyBeg2,
KeyInputIterType  keyEnd2,
ValueInputIterType  valBeg2,
ValueInputIterType  valEnd2,
KeyOutputIterType  keyOut,
ValueOutputIterType  valOut,
BinaryFunction  f 
)

Merge two sorted (by keys) sequences of unique (key,value) pairs by combining pairs with equal keys.

Parameters:
keyBeg1[in] Start of first sequence of keys.
keyEnd1[in] End (exclusive) of first sequence of keys.
valBeg1[in] Start of first sequence of values.
valEnd1[in] End (exclusive) of first sequence of values.
keyBeg2[in] Start of second sequence of keys.
keyEnd2[in] End (exclusive) of second sequence of keys.
valBeg2[in] Start of second sequence of values.
valEnd2[in] End (exclusive) of second sequence of values.
keyOut[in/out] Output sequence of keys.
valOut[in/out] Output sequence of values.
f[in] Binary associative function to use to combine values whose keys are equal. For example, for simple replacement, use a function like std::project1st (in the SGI extensions to the STL) with both template parameters equal to the value type. For addition, use std::plus with template parameter equal to the value type.
Returns:
Number of (key,value) pairs in the merged sequence.
Warning:
For now, this function requires that the two input sequences be made unique by key. Later, we plan to relax that requirement.

Definition at line 803 of file Tpetra_Util.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createVector ( const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map)

Non-member function to create a Vector from a specified Map.

Definition at line 324 of file Tpetra_Vector_decl.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createVectorFromView ( const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map,
const ArrayRCP< Scalar > &  view 
)

Non-member function to create a Vector with view semantics using user-allocated data.

This use case is not supported for all nodes. Specifically, it is not typically supported for accelerator-based nodes like KokkosClassic::ThrustGPUNode.

Definition at line 336 of file Tpetra_Vector_decl.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines