#include <Kokkos_OskiSparseMultiply.hpp>
Classes | |
struct | EntryStruct |
Public Member Functions | |
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. | |
Constructors/Destructor | |
OskiSparseMultiply () | |
OskiSparseMultiply constuctor with variable number of indices per row. | |
OskiSparseMultiply (const OskiSparseMultiply &source) | |
Copy constructor. | |
virtual | ~OskiSparseMultiply () |
OskiSparseMultiply Destructor. | |
Abstract Kokkos::OskiMatrix Interface Initialization Methods | |
virtual int | initializeStructure (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepStructure=true) |
Initialize structure of matrix. | |
virtual int | initializeValues (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepValues=true, 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_SparseOperation 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_OskiSparseMultiply multiplied by multiple vectors in x, results in y. | |
Operator attribute access methods | |
virtual bool | getCanUseStructure () const |
Returns true for this implementation. | |
virtual bool | getCanUseValues () const |
Returns true for this implementation. | |
virtual const CisMatrix < OrdinalType, ScalarType > & | getMatrix () const |
Returns a reference to the most recent Kokkos::OskiMatrix that was passed into the this object. | |
Protected Types | |
typedef struct EntryStruct | Entry |
Protected Member Functions | |
void | copyEntries () |
void | deleteStructureAndValues () |
Protected Attributes | |
CisMatrix< OrdinalType, ScalarType > * | matrixForStructure_ |
CisMatrix< OrdinalType, ScalarType > * | matrixForValues_ |
Permutation< OrdinalType, ScalarType > | leftPermutation_ |
Permutation< OrdinalType, ScalarType > | rightPermutation_ |
bool | isRowOriented_ |
bool | haveStructure_ |
bool | haveValues_ |
bool | hasUnitDiagonal_ |
OrdinalType | numRows_ |
OrdinalType | numCols_ |
OrdinalType | numRC_ |
OrdinalType | numEntries_ |
OrdinalType * | profile_ |
double | costOfMatVec_ |
Entry * | allEntries_ |
The Kokkos::OskiOskiSparseMultiply provide basic functionality for computing sparse matrix times vector, or sparse matrix times multivector operations. This class is templated on the ordinal (integer) and scalar (floating point) types, so it can compute using any reasonable data type. Support for those data types must have been compiled into OSKI.
Constructing Kokkos::OskiSparseMultiply objects
Constructing Kokkos::OskiSparseMultiply objects is a multi-step process. The basic steps are as follows:
Counting Floating Point Operations
Each Kokkos::OskiSparseMultiply 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.
int Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::apply | ( | const MultiVector< OrdinalType, ScalarType > & | x, | |
MultiVector< OrdinalType, ScalarType > & | y, | |||
bool | transA = false , |
|||
bool | conjA = false | |||
) | const [inline, virtual] |
Returns the result of a Kokkos_OskiSparseMultiply multiplied by multiple vectors in x, results in y.
x | (In) A Kokkos::OskiMultiVector to multiply by. | |
y | (Out) A Kokkos::OskiMultiVector containing results. | |
transA | (In) If true, multiply by the transpose of matrix, otherwise just use matrix. | |
conjA | (In) If true, multiply by the conjugate of matrix values, otherwise just use matrix values. |
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.
int Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::apply | ( | const Vector< OrdinalType, ScalarType > & | x, | |
Vector< OrdinalType, ScalarType > & | y, | |||
bool | transA = false , |
|||
bool | conjA = false | |||
) | const [inline, virtual] |
Returns the result of a Kokkos_SparseOperation multiplied by a vector x in y.
x | (In) A Kokkos::Vector to operate on. | |
y | (Out) A Kokkos::Vector containing results. | |
transA | (In) If true, apply the transpose of matrix, otherwise just use matrix. | |
conjA | (In) If true, applythe conjugate of matrix values, otherwise just use matrix values. |
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.
virtual bool Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::getCanUseStructure | ( | ) | const [inline, virtual] |
Returns true for this implementation.
This implementation will use the user's copy of the matrix structure.
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.
virtual bool Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::getCanUseValues | ( | ) | const [inline, virtual] |
Returns true for this implementation.
This implementation will use the user's copy of the matrix values.
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.
int Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::initializeStructure | ( | const CisMatrix< OrdinalType, ScalarType > & | A, | |
bool | willKeepStructure = true | |||
) | [inline, virtual] |
Initialize structure of matrix.
This interface supports matrices that implement the Kokkos::OskiMatrix matrix interface.
A | (In) An instance of a class that implements the Kokkos::OskiMatrix. All necessary information about the matrix can be obtained via this interface. | |
willKeepStructure | (In) This argument is unused by this implementation of the SparseOperation class since structure and values will be shared. |
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.
int Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >::initializeValues | ( | const CisMatrix< OrdinalType, ScalarType > & | A, | |
bool | willKeepValues = true , |
|||
bool | checkStructure = false | |||
) | [inline, virtual] |
Initialize values of matrix.
This interface supports matrices that implement the Kokkos::OskiMatrix matrix interface.
A | (In) An instance of a class that implements the Kokkos::OskiMatrix. All necessary information about the matrix can be obtained via this interface. | |
willKeepValues | (In) This argument is unused by this implementation of the SparseOperation class since structure and values will be shared. | |
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. |
Implements Kokkos::SparseOperation< OrdinalType, ScalarType >.