Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Classes | Protected Member Functions | Protected Attributes
Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node > Class Template Reference

Default implementation of sparse matrix-vector multiply and solve routines, for host-based Kokkos Node types. More...

#include <Kokkos_DefaultSparseOps.hpp>

List of all members.

Classes

struct  rebind
 Sparse operations type for a different scalar type. More...

Public Types

Typedefs and structs
typedef Scalar ScalarType
 The type of the individual entries of the sparse matrix.
typedef Ordinal OrdinalType
 The type of the (local) indices describing the structure of the sparse matrix.
typedef Node NodeType
 The Kokkos Node type.

Public Member Functions

Constructors/Destructor
 DefaultHostSparseOps (const RCP< Node > &node)
 Constructor accepting and retaining a node object.
 ~DefaultHostSparseOps ()
 Destructor.
Accessor routines.
RCP< Node > getNode () const
 The Kokkos Node with which this object was instantiated.
Initialization of structure
void initializeStructure (const CrsGraphHostCompute< Ordinal, Node, DefaultHostSparseOps< void, Ordinal, Node > > &graph)
 Initialize structure of matrix, using CrsGraphHostCompute.
void initializeValues (const CrsMatrixHostCompute< Scalar, Ordinal, Node, DefaultHostSparseOps< void, Ordinal, Node > > &matrix)
 Initialize values of matrix, using CrsMatrixHostCompute.
void clear ()
 Clear all matrix structure and values.
Computational methods
template<class DomainScalar , class RangeScalar >
void multiply (Teuchos::ETransp trans, RangeScalar alpha, const MultiVector< DomainScalar, Node > &X, MultiVector< RangeScalar, Node > &Y) const
 Y := alpha * Op(A) * X.
template<class DomainScalar , class RangeScalar >
void multiply (Teuchos::ETransp trans, RangeScalar alpha, const MultiVector< DomainScalar, Node > &X, RangeScalar beta, MultiVector< RangeScalar, Node > &Y) const
 Y := Y + alpha * Op(A) * X.
template<class DomainScalar , class RangeScalar >
void solve (Teuchos::ETransp trans, Teuchos::EUplo uplo, Teuchos::EDiag diag, const MultiVector< DomainScalar, Node > &Y, MultiVector< RangeScalar, Node > &X) const
 Solve Y = Op(A) X for X, where we assume A is triangular.
template<class VectorScalar >
void leftScale (const MultiVector< VectorScalar, Node > &X)
 Left-scale the matrix by the given vector.

Protected Member Functions

 DefaultHostSparseOps (const DefaultHostSparseOps &source)
 Copy constructor (protected and unimplemented)

Protected Attributes

RCP< Node > node_
 The Kokkos Node instance given to this object's constructor.

Detailed Description

template<class Scalar, class Ordinal, class Node>
class Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >

Default implementation of sparse matrix-vector multiply and solve routines, for host-based Kokkos Node types.

Template Parameters:
ScalarThe type of entries of the sparse matrix.
OrdinalThe type of (local) indices of the sparse matrix.
NodeThe Kokkos Node type.

Definition at line 73 of file Kokkos_DefaultSparseOps.hpp.


Member Typedef Documentation

template<class Scalar , class Ordinal , class Node >
typedef Scalar Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::ScalarType

The type of the individual entries of the sparse matrix.

Definition at line 79 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Ordinal Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::OrdinalType

The type of the (local) indices describing the structure of the sparse matrix.

Definition at line 81 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Node Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::NodeType

The Kokkos Node type.

Definition at line 83 of file Kokkos_DefaultSparseOps.hpp.


Constructor & Destructor Documentation

template<class Scalar , class Ordinal , class Node >
Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::DefaultHostSparseOps ( const RCP< Node > &  node)

Constructor accepting and retaining a node object.

Definition at line 261 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::~DefaultHostSparseOps ( )

Destructor.

Definition at line 272 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::DefaultHostSparseOps ( const DefaultHostSparseOps< Scalar, Ordinal, Node > &  source) [protected]

Copy constructor (protected and unimplemented)


Member Function Documentation

template<class Scalar , class Ordinal , class Node >
RCP< Node > Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::getNode ( ) const

The Kokkos Node with which this object was instantiated.

Definition at line 276 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::initializeStructure ( const CrsGraphHostCompute< Ordinal, Node, DefaultHostSparseOps< void, Ordinal, Node > > &  graph)

Initialize structure of matrix, using CrsGraphHostCompute.

Definition at line 298 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::initializeValues ( const CrsMatrixHostCompute< Scalar, Ordinal, Node, DefaultHostSparseOps< void, Ordinal, Node > > &  matrix)

Initialize values of matrix, using CrsMatrixHostCompute.

Definition at line 334 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::clear ( )

Clear all matrix structure and values.

Definition at line 281 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::multiply ( Teuchos::ETransp  trans,
RangeScalar  alpha,
const MultiVector< DomainScalar, Node > &  X,
MultiVector< RangeScalar, Node > &  Y 
) const

Y := alpha * Op(A) * X.

Apply the local sparse matrix A (or its transpose or conjugate transpose) to a multivector X, overwriting Y with the result. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to apply the matrix, its transpose, or its conjugate transpose (if applicable).
alpha[in] Scalar constant $\alpha$ by which to multiply the result: $Y := \alpha A X$.
X[in] Input multivector.
Y[out] Result multivector.

Definition at line 471 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::multiply ( Teuchos::ETransp  trans,
RangeScalar  alpha,
const MultiVector< DomainScalar, Node > &  X,
RangeScalar  beta,
MultiVector< RangeScalar, Node > &  Y 
) const

Y := Y + alpha * Op(A) * X.

Apply the local sparse matrix A (or its transpose or conjugate transpose) to a multivector X, accumulating the result into Y. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to apply the matrix, its transpose, or its conjugate transpose (if applicable).
alpha[in] Scalar constant $\alpha$ by which to multiply the result: $Y := Y + \alpha A X$.
X[in] Input multivector.
Y[in/out] Result multivector.

Definition at line 573 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::solve ( Teuchos::ETransp  trans,
Teuchos::EUplo  uplo,
Teuchos::EDiag  diag,
const MultiVector< DomainScalar, Node > &  Y,
MultiVector< RangeScalar, Node > &  X 
) const

Solve Y = Op(A) X for X, where we assume A is triangular.

Solve the (upper or lower) triangular system Y = Op(A) X. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to solve with the matrix, its transpose, or its conjugate transpose (if applicable).
uplo[in] UPPER_TRI if the matrix is upper triangular, else LOWER_TRI if the matrix is lower triangular.
diag[in] UNIT_DIAG if the matrix has unit diagonal, else NON_UNIT_DIAG.
Y[in] Input multivector.
X[out] Result multivector.

Definition at line 365 of file Kokkos_DefaultSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class VectorScalar >
void Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::leftScale ( const MultiVector< VectorScalar, Node > &  X)

Left-scale the matrix by the given vector.

Definition at line 679 of file Kokkos_DefaultSparseOps.hpp.


Member Data Documentation

template<class Scalar , class Ordinal , class Node >
RCP<Node> Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >::node_ [protected]

The Kokkos Node instance given to this object's constructor.

Definition at line 242 of file Kokkos_DefaultSparseOps.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends