Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Classes
Kokkos::CuspOps< 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_CuspOps.hpp>

List of all members.

Classes

struct  bind_scalar
 Sparse operations type for a different scalar type. More...
struct  graph
 Typedef for local graph class. More...
struct  matrix
 Typedef for local matrix class. More...

Public Types

Typedefs and structs
typedef Scalar scalar_type
 The type of the individual entries of the sparse matrix.
typedef Ordinal ordinal_type
 The type of the (local) indices describing the structure of the sparse matrix.
typedef Node node_type
 The Kokkos Node type.
typedef CuspOps< Scalar,
Ordinal, Node > 
sparse_ops_type
 The type of this object, the sparse operator object.

Public Member Functions

Constructors/Destructor
 CuspOps (const RCP< Node > &node)
 Constructor accepting and retaining a node object.
 ~CuspOps ()
 Destructor.
Accessor routines.
RCP< Node > getNode () const
 The Kokkos Node with which this object was instantiated.
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, const MultiVector< DomainScalar, Node > &Y, MultiVector< RangeScalar, Node > &X) const
 Solve Y = Op(A) X for X, where we assume A is triangular.

Initialization of graph and matrix

void setGraphAndMatrix (const RCP< const CuspCrsGraph< Ordinal, Node > > &graph, const RCP< const CuspCrsMatrix< Scalar, Ordinal, Node > > &matrix)
 Initialize sparse operations with a graph and matrix.
static ArrayRCP< size_t > allocRowPtrs (const RCP< Node > &node, const ArrayView< const size_t > &rowPtrs)
 Allocate and initialize the storage for the matrix values.
template<class T >
static ArrayRCP< T > allocStorage (const RCP< Node > &node, const ArrayView< const size_t > &ptrs)
 Allocate and initialize the storage for a sparse graph.
static void finalizeGraph (Teuchos::EUplo uplo, Teuchos::EDiag diag, CuspCrsGraph< Ordinal, Node > &graph, const RCP< ParameterList > &params)
 Finalize a graph is null for Cusp.
static void finalizeMatrix (const CuspCrsGraph< Ordinal, Node > &graph, CuspCrsMatrix< Scalar, Ordinal, Node > &matrix, const RCP< ParameterList > &params)
 Finalize the matrix of an already-finalized graph.
static void finalizeGraphAndMatrix (Teuchos::EUplo uplo, Teuchos::EDiag diag, CuspCrsGraph< Ordinal, Node > &graph, CuspCrsMatrix< Scalar, Ordinal, Node > &matrix, const RCP< ParameterList > &params)
 Finalize a graph and a matrix.

Detailed Description

template<class Scalar, class Ordinal, class Node>
class Kokkos::CuspOps< 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.
NodeThe Kokkos Node type.

Definition at line 257 of file Kokkos_CuspOps.hpp.


Member Typedef Documentation

template<class Scalar , class Ordinal , class Node >
typedef Scalar Kokkos::CuspOps< Scalar, Ordinal, Node >::scalar_type

The type of the individual entries of the sparse matrix.

Definition at line 263 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Ordinal Kokkos::CuspOps< Scalar, Ordinal, Node >::ordinal_type

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

Definition at line 265 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Node Kokkos::CuspOps< Scalar, Ordinal, Node >::node_type

The Kokkos Node type.

Definition at line 267 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef CuspOps<Scalar,Ordinal,Node> Kokkos::CuspOps< Scalar, Ordinal, Node >::sparse_ops_type

The type of this object, the sparse operator object.

Definition at line 269 of file Kokkos_CuspOps.hpp.


Constructor & Destructor Documentation

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

Constructor accepting and retaining a node object.

Definition at line 596 of file Kokkos_CuspOps.hpp.

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

Destructor.

Definition at line 608 of file Kokkos_CuspOps.hpp.


Member Function Documentation

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

The Kokkos Node with which this object was instantiated.

Definition at line 612 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
ArrayRCP< size_t > Kokkos::CuspOps< Scalar, Ordinal, Node >::allocRowPtrs ( const RCP< Node > &  node,
const ArrayView< const size_t > &  rowPtrs 
) [static]

Allocate and initialize the storage for the matrix values.

Definition at line 571 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class T >
ArrayRCP< T > Kokkos::CuspOps< Scalar, Ordinal, Node >::allocStorage ( const RCP< Node > &  node,
const ArrayView< const size_t > &  ptrs 
) [static]

Allocate and initialize the storage for a sparse graph.

Definition at line 585 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::CuspOps< Scalar, Ordinal, Node >::finalizeGraph ( Teuchos::EUplo  uplo,
Teuchos::EDiag  diag,
CuspCrsGraph< Ordinal, Node > &  graph,
const RCP< ParameterList > &  params 
) [static]

Finalize a graph is null for Cusp.

Definition at line 466 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::CuspOps< Scalar, Ordinal, Node >::finalizeMatrix ( const CuspCrsGraph< Ordinal, Node > &  graph,
CuspCrsMatrix< Scalar, Ordinal, Node > &  matrix,
const RCP< ParameterList > &  params 
) [static]

Finalize the matrix of an already-finalized graph.

Definition at line 503 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::CuspOps< Scalar, Ordinal, Node >::finalizeGraphAndMatrix ( Teuchos::EUplo  uplo,
Teuchos::EDiag  diag,
CuspCrsGraph< Ordinal, Node > &  graph,
CuspCrsMatrix< Scalar, Ordinal, Node > &  matrix,
const RCP< ParameterList > &  params 
) [static]

Finalize a graph and a matrix.

Definition at line 548 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::CuspOps< Scalar, Ordinal, Node >::setGraphAndMatrix ( const RCP< const CuspCrsGraph< Ordinal, Node > > &  graph,
const RCP< const CuspCrsMatrix< Scalar, Ordinal, Node > > &  matrix 
)

Initialize sparse operations with a graph and matrix.

Definition at line 617 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CuspOps< 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 637 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CuspOps< 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 689 of file Kokkos_CuspOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CuspOps< Scalar, Ordinal, Node >::solve ( Teuchos::ETransp  trans,
const MultiVector< DomainScalar, Node > &  Y,
MultiVector< RangeScalar, Node > &  X 
) const [inline]

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 an implicit unit diagonal, else NON_UNIT_DIAG (diagonal entries are explicitly stored in the matrix).
Y[in] Input multivector.
X[out] Result multivector.

Definition at line 437 of file Kokkos_CuspOps.hpp.


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