SparseLibrary
Version 1.6.0
|
Automatically transforms a row-major scheme into an column-major scheme. More...
#include <CCSWrapper.hpp>
Public Member Functions | |
CCSWrapper () | |
Default constructor (initialises with invalid data). More... | |
CCSWrapper (std::string file, T zero=0) | |
Base file-based constructor. More... | |
CCSWrapper (const IND nnz, const IND nor, const IND noc, T zero) | |
Base empty matrix constructor (sets nnz, rows, columns only). More... | |
CCSWrapper (std::vector< Triplet< T > > &input, IND m, IND n, T zero) | |
Base Triplet-based constructor. More... | |
virtual | ~CCSWrapper () |
Base destructor. More... | |
virtual void | load (std::vector< Triplet< T > > &input, IND m, IND n, T zero) |
Triplet-based loader; first transposes, then calls nested constructor. More... | |
virtual void | loadFromFile (const std::string file, const T zero=0) |
File-based loader; reads file, then passes to Triplet-based loader. More... | |
virtual ULI | m () |
Returns the number of matrix rows (taking into account transposition). More... | |
virtual ULI | n () |
Returns the number of matrix columns (taking into account transposition). More... | |
virtual ULI | nzs () |
Returns the number of nonzeroes. More... | |
virtual void | getFirstIndexPair (IND &row, IND &col) |
virtual T * | mv (const T *x) |
virtual void | zax (const T *__restrict__ x, T *__restrict__ z) |
virtual void | zxa (const T *__restrict__ x, T *__restrict__ z) |
virtual size_t | bytesUsed () |
Public Member Functions inherited from SparseMatrix< T, IND > | |
SparseMatrix () | |
Base constructor. More... | |
SparseMatrix (const IND nzs, const IND nr, const IND nc, const T zero) | |
Base constructor. More... | |
virtual | ~SparseMatrix () |
Base deconstructor. More... | |
void | loadFromFile (const std::string file, const T zero=0) |
Function which loads a matrix from a matrix market file. More... | |
Public Member Functions inherited from Matrix< T > | |
Matrix () | |
Base constructor. More... | |
virtual | ~Matrix () |
Base deconstructor. More... | |
virtual void | zax (const T *__restrict__ x, T *__restrict__ z, const size_t k, const clockid_t clock_id=0, double *elapsed_time=NULL) |
Wrapper function to call the zax kernel multiple times successively, while timing the duration of the operation. More... | |
template<size_t k> | |
void | ZaX (const T *__restrict__ const *__restrict__ const X, T *__restrict__ const *__restrict__ const Z) |
In-place Z=AX function, where A is m x n, Z = m x k, and X is n x k. More... | |
template<size_t k> | |
void | ZXa (const T *__restrict__ const *__restrict__ const X, T *__restrict__ const *__restrict__ const Z) |
In-place Z=XA function, where A is m x n, Z = k x n, and X is k x m. More... | |
virtual void | zxa (const T *__restrict__ x, T *__restrict__ z, const unsigned long int repeat, const clockid_t clock_id=0, double *elapsed_time=NULL) |
Wrapper function to call the zxa kernel multiple times successively, while timing the operation duration. More... | |
Protected Member Functions | |
void | transposeVector (std::vector< Triplet< T > > &input) |
Helper function that transposes an input matrix in Triplet format, in-place. More... | |
Protected Attributes | |
SparseMatrixType * | ds |
Pointer to the underlying data structure. More... | |
Protected Attributes inherited from SparseMatrix< T, IND > | |
IND | nor |
Number of rows. More... | |
IND | noc |
Number of columns. | |
IND | nnz |
Number of non-zeros. More... | |
Additional Inherited Members | |
Public Attributes inherited from SparseMatrix< T, IND > | |
T | zero_element |
The element considered to be zero. More... | |
Automatically transforms a row-major scheme into an column-major scheme.
Can wrap around any SparseMatrix type, and automatically switches input row indices with input column indices, and switches the z=Ax operation with z=xA, and vice versa.
|
inline |
Default constructor (initialises with invalid data).
|
inline |
Base file-based constructor.
References CCSWrapper< T, SparseMatrixType, IND >::loadFromFile().
|
inline |
Base empty matrix constructor (sets nnz, rows, columns only).
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inline |
Base Triplet-based constructor.
References CCSWrapper< T, SparseMatrixType, IND >::load().
|
inlinevirtual |
Base destructor.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inlinevirtual |
Implements Matrix< T >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inlinevirtual |
Implements SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inlinevirtual |
Triplet-based loader; first transposes, then calls nested constructor.
Implements SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds, and CCSWrapper< T, SparseMatrixType, IND >::transposeVector().
Referenced by CCSWrapper< T, SparseMatrixType, IND >::CCSWrapper(), and CCSWrapper< T, SparseMatrixType, IND >::loadFromFile().
|
inlinevirtual |
File-based loader; reads file, then passes to Triplet-based loader.
References CCSWrapper< T, SparseMatrixType, IND >::load(), CCSWrapper< T, SparseMatrixType, IND >::m(), CCSWrapper< T, SparseMatrixType, IND >::n(), and FileToVT::parse().
Referenced by CCSWrapper< T, SparseMatrixType, IND >::CCSWrapper().
|
inlinevirtual |
Returns the number of matrix rows (taking into account transposition).
Reimplemented from SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
Referenced by CCSWrapper< T, SparseMatrixType, IND >::loadFromFile(), and CCSWrapper< T, SparseMatrixType, IND >::mv().
|
inlinevirtual |
Reimplemented from SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds, and CCSWrapper< T, SparseMatrixType, IND >::m().
|
inlinevirtual |
Returns the number of matrix columns (taking into account transposition).
Reimplemented from SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
Referenced by CCSWrapper< T, SparseMatrixType, IND >::loadFromFile().
|
inlinevirtual |
Returns the number of nonzeroes.
Reimplemented from SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inlineprotected |
Helper function that transposes an input matrix in Triplet format, in-place.
input | The input matrix. |
Referenced by CCSWrapper< T, SparseMatrixType, IND >::load().
|
inlinevirtual |
Implements SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
inlinevirtual |
Implements SparseMatrix< T, IND >.
References CCSWrapper< T, SparseMatrixType, IND >::ds.
|
protected |
Pointer to the underlying data structure.
Referenced by CCSWrapper< T, SparseMatrixType, IND >::bytesUsed(), CCSWrapper< T, SparseMatrixType, IND >::CCSWrapper(), CCSWrapper< T, SparseMatrixType, IND >::getFirstIndexPair(), CCSWrapper< T, SparseMatrixType, IND >::load(), CCSWrapper< T, SparseMatrixType, IND >::m(), CCSWrapper< T, SparseMatrixType, IND >::mv(), CCSWrapper< T, SparseMatrixType, IND >::n(), CCSWrapper< T, SparseMatrixType, IND >::nzs(), CCSWrapper< T, SparseMatrixType, IND >::zax(), CCSWrapper< T, SparseMatrixType, IND >::zxa(), and CCSWrapper< T, SparseMatrixType, IND >::~CCSWrapper().