Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Public Member Functions
Kokkos::Mkl::MatrixDescriptor Class Reference

Wrapper for MKL's sparse matrix descriptor array. More...

#include <Kokkos_Mkl_MatrixDescriptor.hpp>

List of all members.

Public Member Functions

 MatrixDescriptor (const bool symmetric, const bool hermitian, const bool triangular, const bool skewSymmetric, const bool diagonal, const Teuchos::EUplo uplo, const Teuchos::EDiag diag, const int indexBase)
 Construct a matrix descriptor.
 MatrixDescriptor ()
 Default constructor (fills in the descriptor with default values).
const char *const getRawPtr () const
 Get a raw pointer to the matrix descriptor array.
Teuchos::EDiag getDiag () const
 Get whether or not the matrix has an implicitly stored unit diagonal.
Teuchos::EUplo getUplo () const
 Get whether or not the matrix is lower or upper triangular (or neither).
int getIndexBase () const
 Return the index base specified by the given matrix descriptor.
void print (Teuchos::FancyOStream &out) const
 Print the matrix descriptor in human-readable YAML format.

Detailed Description

Wrapper for MKL's sparse matrix descriptor array.

Note:
This class is not meant for end users. We use it in the implementation of Kokkos::MklSparseOps.

MKL's sparse kernels use an array of characters to describe the storage format of a sparse matrix. This class wraps the matrix descriptor array and provides methods for filling in the array, validation, and printing.

Definition at line 61 of file Kokkos_Mkl_MatrixDescriptor.hpp.


Constructor & Destructor Documentation

Kokkos::Mkl::MatrixDescriptor::MatrixDescriptor ( const bool  symmetric,
const bool  hermitian,
const bool  triangular,
const bool  skewSymmetric,
const bool  diagonal,
const Teuchos::EUplo  uplo,
const Teuchos::EDiag  diag,
const int  indexBase 
)

Construct a matrix descriptor.

The properties symmetric, Hermitian, skew-symmetric, and triangular below all refer to the storage of the matrix as well as to its mathematical properties. In all these cases, MKL will only read the lower or upper triangle of the matrix, depending on the value of the uplo parameter. If you specify one of these properties, you must set uplo to either Teuchos::LOWER_TRI or Teuchos::UPPER_TRI.

Parameters:
symmetric[in] Whether the matrix $A$ is symmetric, i.e., $A = A^T$.
hermitian[in] Whether the matrix $A$ is Hermitian, i.e., $A = A^H$. If Scalar is complex, then symmetric means something different than Hermitian. Otherwise, they mean the same thing.
triangular[in] Whether the matrix $A$ is triangular. MKL interprets this as meaning that it should ignore any entries not in the part of the matrix specified by the uplo argument.
skewSymmetric[in] Whether the matrix $A$ is skew-symmetric (a.k.a. antisymmetric), i.e., $A = -A^T$.
diagonal[in] Whether the matrix is diagonal.
uplo[in] If the matrix is triangular, then this refers to whether the matrix is lower (Teuchos::LOWER_TRI) or upper (Teuchos::UPPER_TRI) triangular. If the matrix is symmetric, Hermitian, or skew-symmetric, then this refers to whether MKL should read only the lower or the upper triangle of the matrix. Otherwise, this parameter is ignored. You may set uplo=TeuchosUNDEF_TRI in that case.
diag[in] If diag=TeuchosUNIT_DIAG, then the diagonal entries of the matrix are not stored explicitly, but implicitly all have the value one. Otherwise, if diag=TeuchosNON_UNIT_DIAG, any diagonal entries of the matrix must be stored explicitly (or they will be considered to be zero). This is ignored if the matrix is skew-symmetric, or if it is "general" (neither symmetric, nor Hermitiian, nor triangular, nor diagonal).
indexBase[in] 0 for zero-based indices, 1 for one-based indices.

Definition at line 120 of file Kokkos_Mkl_MatrixDescriptor.cpp.

Kokkos::Mkl::MatrixDescriptor::MatrixDescriptor ( )

Default constructor (fills in the descriptor with default values).

Definition at line 134 of file Kokkos_Mkl_MatrixDescriptor.cpp.


Member Function Documentation

const char* const Kokkos::Mkl::MatrixDescriptor::getRawPtr ( ) const [inline]

Get a raw pointer to the matrix descriptor array.

The array has at least 6 entries, even though MKL currently only uses the first 4 entries.

Warning:
This pointer is only valid during the lifetime of the MatrixDescriptor object.

Definition at line 122 of file Kokkos_Mkl_MatrixDescriptor.hpp.

Teuchos::EDiag Kokkos::Mkl::MatrixDescriptor::getDiag ( ) const

Get whether or not the matrix has an implicitly stored unit diagonal.

Definition at line 257 of file Kokkos_Mkl_MatrixDescriptor.cpp.

Teuchos::EUplo Kokkos::Mkl::MatrixDescriptor::getUplo ( ) const

Get whether or not the matrix is lower or upper triangular (or neither).

Definition at line 268 of file Kokkos_Mkl_MatrixDescriptor.cpp.

int Kokkos::Mkl::MatrixDescriptor::getIndexBase ( ) const

Return the index base specified by the given matrix descriptor.

Definition at line 242 of file Kokkos_Mkl_MatrixDescriptor.cpp.

void Kokkos::Mkl::MatrixDescriptor::print ( Teuchos::FancyOStream out) const

Print the matrix descriptor in human-readable YAML format.

Parameters:
out[out] Output stream to which to print. We guarantee not to write to this stream or otherwise have externally visible side effects unless the matrix descriptor is valid.
descr[in] The MKL sparse matrix descriptor array, as would be created by fillMatrixDescriptor().
Note:
We use FancyOStream instead of plain std::ostream because FancyOStream lets us set tabs to indent each line of output. This is nice for formatted human-readable YAML output.

Definition at line 47 of file Kokkos_Mkl_MatrixDescriptor.cpp.


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