Kokkos::HbMatrix< OrdinalType, ScalarType > Class Template Reference

Kokkos::HbMatrix: Kokkos compressed index sparse matrix base class. More...

#include <Kokkos_HbMatrix.hpp>

Inheritance diagram for Kokkos::HbMatrix< OrdinalType, ScalarType >:

[legend]
Collaboration diagram for Kokkos::HbMatrix< OrdinalType, ScalarType >:
[legend]
List of all members.

Public Member Functions

Constructors/Destructor.
 HbMatrix (void)
 Default HbMatrix constuctor.
 HbMatrix (const HbMatrix &source)
 Copy constructor.
virtual ~HbMatrix ()
 HbMatrix Destructor.
Classical Harwell-Boeing Format Initialization Methods
int initializeStructure (OrdinalType numRows, OrdinalType numCols, bool isRowOriented, OrdinalType *pntr, OrdinalType *indx)
 Initialize structure of matrix (Classical Harwell-Boeing Format).
int initializeValues (ScalarType *values)
 Initialize structure of matrix (Classical Harwell-Boeing Format).
Generalized Harwell-Boeing Format Initialization Methods
int initializeStructure (OrdinalType numRows, OrdinalType numCols, bool isRowOriented, OrdinalType *profile, OrdinalType **indx)
 Initialize structure of matrix (Generalized Harwell-Boeing Format).
int initializeValues (ScalarType **values)
 Initialize structure of matrix (Generalized Harwell-Boeing Format).
Matrix entry access methods.
int getIndices (OrdinalType i, OrdinalType &numRowEntries, OrdinalType *&indices) const
 Returns number of entries in ith row/column, and pointer to an array of these indices.
int getValues (OrdinalType i, ScalarType *&values) const
 Returns a pointer to an array of values for the ith row/column.
Matrix Attribute set methods.
virtual int setIsUpperTriangular (bool tf)
 Set whether or not the compressed index matrix has no entries below the diagonal, assumed false.
virtual int setIsLowerTriangular (bool tf)
 Set whether or not the compressed index matrix has no entries above the diagonal, assumed false.
virtual int setHasDiagonalEntries (bool tf)
 Set whether or not the compressed index matrix has explicit diagonal entries.
virtual int setHasImplicitUnitDiagonal (bool tf)
 Set whether or not the compressed index matrix should be treated as unit diagonal, assumed false.
Validity tests.
virtual int checkStructure () const
 Check if the matrix structure is valid for user-assertion of Upper/Lower Triangular and implicit unit diagonal.
Matrix Attribute access methods.
bool getIsClassicHbMatrix () const
 Returns true if the compressed index matrix was formed using a classic HB matrix.
bool getIsRowOriented () const
 Returns true if the compressed index matrix should be interpreted as a row matrix.
virtual bool getIsUpperTriangular () const
 Returns true if the compressed index matrix has no entries below the diagonal.
virtual bool getIsLowerTriangular () const
 Returns true if the compressed index matrix has no entries above the diagonal.
virtual bool getHasImplicitUnitDiagonal () const
 Returns true if the compressed index matrix has no diagonal entries, but should be treated as unit diagonal.
OrdinalType getNumRows () const
 Number of rows.
OrdinalType getNumCols () const
 Number of columns.
OrdinalType getNumEntries () const
 Number of matrix entries.

Protected Attributes

OrdinalType numRows_
OrdinalType numCols_
OrdinalType numEntries_
ScalarType ** values_
ScalarType * allValues_
OrdinalType ** indices_
OrdinalType * allIndices_
OrdinalType * pntr_
OrdinalType * profile_
bool isRowOriented_
bool isUpperTriangular_
bool isLowerTriangular_
bool hasImplicitUnitDiagonal_
bool hasDiagonalEntries_
bool isClassicHbMatrix_

Detailed Description

template<typename OrdinalType, typename ScalarType>
class Kokkos::HbMatrix< OrdinalType, ScalarType >

Kokkos::HbMatrix: Kokkos compressed index sparse matrix base class.

The Kokkos::HbMatrix implements the Kokkos::CisMatrix interface using either a Harwell-Boeing matrix or generalized form of one.


Member Function Documentation

template<typename OrdinalType, typename ScalarType>
int HbMatrix::checkStructure  )  const [virtual]
 

Check if the matrix structure is valid for user-assertion of Upper/Lower Triangular and implicit unit diagonal.

Returns:
Integer error code, equals zero if structure is valid, negative value means potential fatal assertion. Error codes:
  • -1 - User asserts upper triangular, but it's not.
  • 1 - User does not assert upper triangular, but it is.
  • -2 - User asserts lower triangular, but it's not.
  • 2 - User does not assert lower triangular, but it is.
  • -3 - User asserts implicit unit diagonal, but values are given.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::getIndices OrdinalType  i,
OrdinalType &  numRowEntries,
OrdinalType *&  indices
const [virtual]
 

Returns number of entries in ith row/column, and pointer to an array of these indices.

Extract the number of entries and a pointer to the indices in the ith row/column of the matrix. Note that the indices are not copied by this method. Memory allocation is handled by the matrix object itself.

Parameters:
i (In) The row (if isRowOriented() is true) or column that should be returned.
numRowEntries (Out) The number of entries in the ith row/column.
indices (Out) A pointer to the list of indices in the ith row/column.
Returns:
Integer error code, set to 0 if successful.

Implements Kokkos::CisMatrix< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::getValues OrdinalType  i,
ScalarType *&  values
const [virtual]
 

Returns a pointer to an array of values for the ith row/column.

Extract the values in the ith row/column of the matrix. Note that the values are not copied by this method. Memory allocation is handled by the matrix object itself.

Parameters:
i (In) The row (if isRowOriented() is true) or column that should be returned.
numEntries (Out) The number of entries in the ith row/column.
indices (Out) A pointer to the list of indices in the ith row/column.
Returns:
Integer error code, set to 0 if successful.

Implements Kokkos::CisMatrix< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::initializeStructure OrdinalType  numRows,
OrdinalType  numCols,
bool  isRowOriented,
OrdinalType *  profile,
OrdinalType **  indx
 

Initialize structure of matrix (Generalized Harwell-Boeing Format).

This interface supports matrices that are stored in a generalized Harwell-Boeing format.

Parameters:
numRows (In) Row dimension.
numCols (In) Column dimension.
isRowOriented (In) If true, the compressed index storage will be interpreted as row indices. If false, then indices will be interpreted as column indices.
profile (In) Array of index counts for indx. pntr[i] equals the number of entries in the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
indx (In) An array of pointers to arrays of indices. indx[i][0] contains the first index of the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::initializeStructure OrdinalType  numRows,
OrdinalType  numCols,
bool  isRowOriented,
OrdinalType *  pntr,
OrdinalType *  indx
 

Initialize structure of matrix (Classical Harwell-Boeing Format).

This interface supports matrices that are stored in the classical Harwell-Boeing format.

Parameters:
numRows (In) Row dimension.
numCols (In) Column dimension.
isRowOriented - (In) If true, the compressed index storage will be interpreted as row indices. If false, then indices will be interpreted as column indices.
pntr (In) Array of offsets into indx. indx[pntr[i]] contains the first index of the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
indx (In) Packed array of indices. indx[pntr[i]] contains the first index of the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::initializeValues ScalarType **  values  ) 
 

Initialize structure of matrix (Generalized Harwell-Boeing Format).

This interface supports matrices that are stored in the classical Harwell-Boeing format.

Parameters:
values (In) An array of pointers to arrays of matrix values. values[[i][0] contains the first entry of the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int HbMatrix::initializeValues ScalarType *  values  ) 
 

Initialize structure of matrix (Classical Harwell-Boeing Format).

This interface supports matrices that are stored in the classical Harwell-Boeing format.

Parameters:
values (In) Packed array of matrix values. values[pntr[i]] contains the first entry of the ith row (if isRowOriented is true) or ith column (if isRowOriented is false).
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
virtual int Kokkos::HbMatrix< OrdinalType, ScalarType >::setHasImplicitUnitDiagonal bool  tf  )  [inline, virtual]
 

Set whether or not the compressed index matrix should be treated as unit diagonal, assumed false.

Warning:
This method will not accept a "true" argument unless setHasDiagonalEntries() has be called with a "false" argument first.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:37:00 2008 for Kokkos by doxygen 1.3.9.1