Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Classes
Kokkos::SeqSparseOps< Scalar, Ordinal, Node > Class Template Reference

Implementation of local sequential sparse matrix-vector multiply and solve routines, for host-based Kokkos Node types. More...

#include <Kokkos_SeqSparseOps.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 SeqSparseOps< Scalar,
Ordinal, Node > 
sparse_ops_type
 The type of this object, the sparse operator object.

Public Member Functions

Constructors/Destructor
 SeqSparseOps (const Teuchos::RCP< Node > &node)
 Constructor.
 ~SeqSparseOps ()
 Destructor.
Accessor routines.
Teuchos::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 := beta * 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 Teuchos::RCP< const SeqCrsGraph< Ordinal, Node > > &graph, const Teuchos::RCP< const SeqCrsMatrix< Scalar, Ordinal, Node > > &matrix)
 Initialize sparse operations with a graph and matrix.
static Teuchos::ArrayRCP< size_t > allocRowPtrs (const ArrayView< const size_t > &numEntriesPerRow)
 Allocate and initialize the storage for the row pointers.
template<class T >
static Teuchos::ArrayRCP< T > allocStorage (const Teuchos::ArrayView< const size_t > &rowPtrs)
 Allocate and initialize the storage for a sparse graph or matrix.
static void finalizeGraph (Teuchos::EUplo uplo, Teuchos::EDiag diag, SeqCrsGraph< Ordinal, Node > &graph, const Teuchos::RCP< Teuchos::ParameterList > &params)
 Finalize a graph.
static void finalizeMatrix (const SeqCrsGraph< Ordinal, Node > &graph, SeqCrsMatrix< Scalar, Ordinal, Node > &matrix, const Teuchos::RCP< Teuchos::ParameterList > &params)
 Finalize the matrix of an already-finalized graph.
static void finalizeGraphAndMatrix (Teuchos::EUplo uplo, Teuchos::EDiag diag, SeqCrsGraph< Ordinal, Node > &graph, SeqCrsMatrix< Scalar, Ordinal, Node > &matrix, const Teuchos::RCP< Teuchos::ParameterList > &params)
 Finalize a graph and a matrix.

Detailed Description

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

Implementation of local sequential 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 304 of file Kokkos_SeqSparseOps.hpp.


Member Typedef Documentation

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

The type of the individual entries of the sparse matrix.

Definition at line 310 of file Kokkos_SeqSparseOps.hpp.

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

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

Definition at line 312 of file Kokkos_SeqSparseOps.hpp.

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

The Kokkos Node type.

Definition at line 314 of file Kokkos_SeqSparseOps.hpp.

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

The type of this object, the sparse operator object.

Definition at line 316 of file Kokkos_SeqSparseOps.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
node[in/out] Kokkos Node instance.

Definition at line 583 of file Kokkos_SeqSparseOps.hpp.

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

Destructor.

Definition at line 596 of file Kokkos_SeqSparseOps.hpp.


Member Function Documentation

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

The Kokkos Node with which this object was instantiated.

Definition at line 600 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
Teuchos::ArrayRCP< size_t > Kokkos::SeqSparseOps< Scalar, Ordinal, Node >::allocRowPtrs ( const ArrayView< const size_t > &  numEntriesPerRow) [static]

Allocate and initialize the storage for the row pointers.

Definition at line 1086 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class T >
Teuchos::ArrayRCP< T > Kokkos::SeqSparseOps< Scalar, Ordinal, Node >::allocStorage ( const Teuchos::ArrayView< const size_t > &  rowPtrs) [static]

Allocate and initialize the storage for a sparse graph or matrix.

Definition at line 1100 of file Kokkos_SeqSparseOps.hpp.

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

Finalize a graph.

Definition at line 532 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::SeqSparseOps< Scalar, Ordinal, Node >::finalizeMatrix ( const SeqCrsGraph< Ordinal, Node > &  graph,
SeqCrsMatrix< Scalar, Ordinal, Node > &  matrix,
const Teuchos::RCP< Teuchos::ParameterList > &  params 
) [static]

Finalize the matrix of an already-finalized graph.

Definition at line 547 of file Kokkos_SeqSparseOps.hpp.

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

Finalize a graph and a matrix.

Definition at line 561 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
void Kokkos::SeqSparseOps< Scalar, Ordinal, Node >::setGraphAndMatrix ( const Teuchos::RCP< const SeqCrsGraph< Ordinal, Node > > &  graph,
const Teuchos::RCP< const SeqCrsMatrix< Scalar, Ordinal, Node > > &  matrix 
)

Initialize sparse operations with a graph and matrix.

Definition at line 607 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::SeqSparseOps< 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 of the sparse matrix-(multi)vector multiply.
X[in] Input multivector.
Y[out] Result multivector. Contents will be overwritten.

Definition at line 902 of file Kokkos_SeqSparseOps.hpp.

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

Y := beta * 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 of the sparse matrix-(multi)vector multiply.
X[in] Input multivector.
beta[in] Scalar constant $\beta$ by which to multiply Y when summing with the result of the sparse matrix-(multi)vector multiply.
Y[in/out] Result multivector.

Definition at line 917 of file Kokkos_SeqSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::SeqSparseOps< Scalar, Ordinal, Node >::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.

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).
Y[in] Input multivector.
X[out] Result multivector.

Definition at line 727 of file Kokkos_SeqSparseOps.hpp.


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