SparseLibrary  Version 1.6.0
Public Member Functions | List of all members
Matrix< T > Class Template Referenceabstract

Defines operations common to all matrices, which are implemented in this library. More...

#include <Matrix.hpp>

Inheritance diagram for Matrix< T >:
Inheritance graph
[legend]

Public Member Functions

 Matrix ()
 Base constructor. More...
 
virtual ~Matrix ()
 Base deconstructor. More...
 
virtual unsigned long int m ()=0
 
virtual unsigned long int n ()=0
 
virtual unsigned long int nzs ()
 
virtual T * mv (const T *x)=0
 Calculates z=Ax (where A is this matrix). More...
 
virtual void zax (const T *__restrict__ x, T *__restrict__ z)=0
 In-place z=Ax function. 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...
 
virtual void zxa (const T *__restrict__ x, T *__restrict__ z)=0
 In-place z=xA function. 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...
 
virtual size_t bytesUsed ()=0
 Function to query the amount of storage required by this sparse matrix. More...
 

Detailed Description

template<typename T>
class Matrix< T >

Defines operations common to all matrices, which are implemented in this library.

Constructor & Destructor Documentation

template<typename T>
Matrix< T >::Matrix ( )
inline

Base constructor.

template<typename T>
virtual Matrix< T >::~Matrix ( )
inlinevirtual

Base deconstructor.

Member Function Documentation

template<typename T>
virtual size_t Matrix< T >::bytesUsed ( )
pure virtual
template<typename T>
virtual unsigned long int Matrix< T >::m ( )
pure virtual
template<typename T>
virtual T* Matrix< T >::mv ( const T *  x)
pure virtual
template<typename T>
virtual unsigned long int Matrix< T >::n ( )
pure virtual
template<typename T>
virtual unsigned long int Matrix< T >::nzs ( )
inlinevirtual
template<typename T>
virtual void Matrix< T >::zax ( const T *__restrict__  x,
T *__restrict__  z 
)
pure virtual
template<typename T>
virtual void Matrix< T >::zax ( const T *__restrict__  x,
T *__restrict__  z,
const size_t  k,
const clockid_t  clock_id = 0,
double *  elapsed_time = NULL 
)
inlinevirtual

Wrapper function to call the zax kernel multiple times successively, while timing the duration of the operation.

Essentially computes z=A^k. The timing functionalities are optional.

Parameters
xThe input vector.
zThe output vector.
kHow many times to repeat the z=Ax operation.
clock_idThe POSIX realtime clock ID (optional).
elapsed_timeTo which double the time taken should be added (optional; set to NULL to disable timing).
See also
Matrix::zax
template<typename T>
template<size_t k>
void Matrix< T >::ZaX ( const T *__restrict__ const *__restrict__ const  X,
T *__restrict__ const *__restrict__ const  Z 
)
inline

In-place Z=AX function, where A is m x n, Z = m x k, and X is n x k.

The default implementation is to perform k successive z=Ax operations. Efficient schemes should override this default implementation to achieve higher performance.

Template Parameters
kHow many linear maps to compute. This is a template parameter so that the compiler can optimise better.
Parameters
XThe k input vectors of length n each.
ZThe k output vectors of length m each; each is assumed to be pre-initialised.
See also
Matrix::zax
template<typename T>
virtual void Matrix< T >::zxa ( const T *__restrict__  x,
T *__restrict__  z 
)
pure virtual
template<typename T>
template<size_t k>
void Matrix< T >::ZXa ( const T *__restrict__ const *__restrict__ const  X,
T *__restrict__ const *__restrict__ const  Z 
)
inline

In-place Z=XA function, where A is m x n, Z = k x n, and X is k x m.

Transposed variant of Matrix::ZaX, analogue to Matrix::zxa being the transposed operation of Matrix::zax.

Template Parameters
kHow many linear maps to compute. This is a template parameter so that the compiler can optimise better.
Parameters
XThe k input vectors of length m each.
ZThe k output vectors of length n each.
See also
Matrix::ZaX
Matrix::zxa
template<typename T>
virtual void Matrix< T >::zxa ( const T *__restrict__  x,
T *__restrict__  z,
const unsigned long int  repeat,
const clockid_t  clock_id = 0,
double *  elapsed_time = NULL 
)
inlinevirtual

Wrapper function to call the zxa kernel multiple times successively, while timing the operation duration.


The documentation for this class was generated from the following file: