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

Kokkos::BaseSparseSolve: A reference class for computing sparse matrix triangular solve operations. More...

#include <Kokkos_BaseSparseSolve.hpp>

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

Inheritance graph
[legend]
Collaboration diagram for Kokkos::BaseSparseSolve< OrdinalType, ScalarType >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors/Destructor
 BaseSparseSolve ()
 BaseSparseSolve constuctor with variable number of indices per row.
 BaseSparseSolve (const BaseSparseSolve &source)
 Copy constructor.
virtual ~BaseSparseSolve ()
 BaseSparseSolve Destructor.
Abstract Kokkos::CisMatrix Interface Initialization Methods
virtual int initializeStructure (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepStructure=false)
 Initialize structure of matrix.
virtual int initializeValues (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepValues=false, bool checkStructure=false)
 Initialize values of matrix.
Computational methods
virtual int apply (const Vector< OrdinalType, ScalarType > &x, Vector< OrdinalType, ScalarType > &y, bool transA=false, bool conjA=false) const
 Returns the result of a Kokkos_BaseSparseSolve multiplied by a vector x in y.
virtual int apply (const MultiVector< OrdinalType, ScalarType > &x, MultiVector< OrdinalType, ScalarType > &y, bool transA=false, bool conjA=false) const
 Returns the result of a Kokkos_BaseSparseSolve multiplied by multiple vectors in x, results in y.
Operator attribute access methods
virtual bool getCanUseStructure () const
 Returns true if this implementation of Kokkos::BaseSparseSolve can benefit from the user keeping the passed in structure.
virtual bool getCanUseValues () const
 Returns true if this implementation of Kokkos::BaseSparseSolve can benefit from the user keeping the passed in values.
virtual const CisMatrix< OrdinalType,
ScalarType > & 
getMatrix () const
 Returns a reference to the most recent Kokkos::CisMatrix that was passed into the this object.
virtual const Permutation<
OrdinalType, ScalarType > & 
getLeftPermutation () const
 Returns a reference to the left Kokkos::Permutation object, which is the identity for this implementation.
virtual const Permutation<
OrdinalType, ScalarType > & 
getRightPermutation () const
 Returns a reference to the right Kokkos::Permutation object, which is the identity for this implementation.

Protected Member Functions

void copyProfile ()
void copyStructure ()
void deleteStructureAndProfile ()
void copyOrdinals (OrdinalType len, OrdinalType *vecIn, OrdinalType *vecOut)
void copyScalars (OrdinalType len, ScalarType *vecIn, ScalarType *vecOut)
void copyValues ()
void deleteValues ()

Protected Attributes

CisMatrix< OrdinalType, ScalarType > * matrixForStructure_
CisMatrix< OrdinalType, ScalarType > * matrixForValues_
Permutation< OrdinalType,
ScalarType > 
leftPermutation_
Permutation< OrdinalType,
ScalarType > 
rightPermutation_
bool willKeepStructure_
bool willKeepValues_
bool isRowOriented_
bool haveStructure_
bool haveValues_
bool isUpper_
bool hasUnitDiagonal_
OrdinalType numRows_
OrdinalType numCols_
OrdinalType numRC_
OrdinalType numEntries_
ScalarType ** values_
OrdinalType ** indices_
OrdinalType * profile_
ScalarType * allValues_
OrdinalType * allIndices_
double costOfSolve_

Detailed Description

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

Kokkos::BaseSparseSolve: A reference class for computing sparse matrix triangular solve operations.

The Kokkos::BaseSparseSolve provide basic functionality for computing sparse triangular solves with one or more right-hand-side vectors. This class is templated on the ordinal (integer) and scalar (floating point) types, so it can compute using any reasonable data type. It implements the Kokkos::SparseOperation base class.

Constructing Kokkos::BaseSparseSolve objects

Constructing Kokkos::BaseSparseSolve objects is a multi-step process. The basic steps are as follows:

  1. Create Kokkos::BaseSparseSolve instance: The constructor takes no arguments.
  2. Register the structure of a Kokkos::CisMatrix object using initializeStructure(): We provide this method so that derived implementations can take advantage of multiple problems that have the same structure. In this situation, initializeStructure() would be called once and then initializeValues() would be called repeatedly, amortizing the cost of setting up the structure. This method may be called only once.
  3. Register the values of a Kokkos::CisMatrix object using initializeValues(): This method is used to pass values to the multiply class. It can be called repeatedly if multiple matrices have the same structure.

Counting Floating Point Operations

Each Kokkos::BaseSparseSolve object keeps track of the number of floating point operations performed using the specified object as the this argument to the function. The getFlops() function returns this number as a double precision number. Using this information, in conjunction with the Kokkos::Time class, one can get accurate performance numbers. The resetFlops() function resets the floating point counter.


Member Function Documentation

template<typename OrdinalType, typename ScalarType>
int Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::apply ( const MultiVector< OrdinalType, ScalarType > &  x,
MultiVector< OrdinalType, ScalarType > &  y,
bool  transA = false,
bool  conjA = false 
) const [virtual]

Returns the result of a Kokkos_BaseSparseSolve multiplied by multiple vectors in x, results in y.

Parameters:
x (In) A Kokkos::MultiVector to solve with.
y (Out) A Kokkos::MultiVector containing results. Note that any implementation must support x and y being the same object.
transA (In) If true, solve using the transpose of matrix, otherwise just use matrix.
conjA (In) If true, solve using the conjugate of matrix values, otherwise just use matrix values.
Returns:
Integer error code, set to 0 if successful.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
int Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::apply ( const Vector< OrdinalType, ScalarType > &  x,
Vector< OrdinalType, ScalarType > &  y,
bool  transA = false,
bool  conjA = false 
) const [virtual]

Returns the result of a Kokkos_BaseSparseSolve multiplied by a vector x in y.

Parameters:
x (In) A Kokkos::Vector to solve with.
y (Out) A Kokkos::Vector containing results. Note that any implementation must support x and y being the same object.
transA (In) If true, solve using the transpose of matrix, otherwise just use matrix.
conjA (In) If true, solve using the conjugate of matrix values, otherwise just use matrix values.
Returns:
Integer error code, set to 0 if successful.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
virtual bool Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::getCanUseStructure (  )  const [inline, virtual]

Returns true if this implementation of Kokkos::BaseSparseSolve can benefit from the user keeping the passed in structure.

Some implementations of optimized kernels do not rely on the user's data except for the initial analysis of structure. Other implementations, in order to reduce memory requirements, may find it beneficial to rely on the user's data. Since it is very possible that the user would retain this data anyway, we want to allow for this possibility. This method is related to the willKeepStructure parameter passed in to the initializeStructure() method.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
virtual bool Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::getCanUseValues (  )  const [inline, virtual]

Returns true if this implementation of Kokkos::BaseSparseSolve can benefit from the user keeping the passed in values.

Some implementations of optimized kernels do not rely on the user's data except for the initial copying of values. Other implementations, in order to reduce memory requirements, may find it beneficial to rely on the user's data. Since it is very possible that the user would retain this data anyway, we want to allow for this possibility. This method is related to the willKeepValues parameter passed in to the initializeValues() method.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
int Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::initializeStructure ( const CisMatrix< OrdinalType, ScalarType > &  A,
bool  willKeepStructure = false 
) [virtual]

Initialize structure of matrix.

This interface supports matrices that implement the Kokkos::CisMatrix matrix interface.

Parameters:
A (In) An instance of a class that implements the Kokkos::CisMatrix. All necessary information about the matrix can be obtained via this interface, including whether or not the matrix is upper or lower triangular, and whether or not the diagonal is part of the structure, or should be implicitly assume to be unit diagonal.
willKeepStructure (In) If set to true, the user is asserting that the strucuture of the matrix, as defined in the getIndices() method of the CisMatrix object A will be kept. Specifically, the pointer to an array of indices returned for each i in that method will continue to point to valid index data. By default, this argument is set to false, implying that the calling routine is not required to maintain the validity of this data. If the calling routine is planning to keep this data anyway, setting this argument to true can reduce the overall memory requirements.
Returns:
Integer error code, set to 0 if successful.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.

template<typename OrdinalType, typename ScalarType>
int Kokkos::BaseSparseSolve< OrdinalType, ScalarType >::initializeValues ( const CisMatrix< OrdinalType, ScalarType > &  A,
bool  willKeepValues = false,
bool  checkStructure = false 
) [virtual]

Initialize values of matrix.

This interface supports matrices that implement the Kokkos::CisMatrix matrix interface

Parameters:
A (In) An instance of a class that implements the Kokkos::CisMatrix. All necessary information about the matrix can be obtained via this interface, including whether or not the matrix is upper or lower triangular, and whether or not the diagonal is part of the structure, or should be implicitly assume to be unit diagonal.
willKeepValues (In) If set to true, the user is asserting that the strucuture of the matrix, as defined in the getIndices() method of the CisMatrix object A will be kept. Specifically, the pointer to an array of indices returned for each i in that method will continue to point to valid index data. By default, this argument is set to false, implying that the calling routine is not required to maintain the validity of this data. If the calling routine is planning to keep this data anyway, setting this argument to true can reduce the overall memory requirements.
checkStructure (In) If set to true, the structure of A will be checked against the structure of the matrix passed in to the initializeStructure() methods. This parameter is false by default.
Returns:
Integer error code, set to 0 if successful, returns - 1 if checkStructure is true and structure is changed.

Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.


The documentation for this class was generated from the following file:
Generated on Wed May 12 21:42:02 2010 for Kokkos by  doxygen 1.4.7