SparseLibrary  Version 1.6.0
Public Member Functions | Protected Attributes | List of all members
CompressedHilbert< T > Class Template Reference

A Hilbert scheme backed by a specialised storage format. More...

#include <CompressedHilbert.hpp>

Inheritance diagram for CompressedHilbert< T >:
Inheritance graph
[legend]
Collaboration diagram for CompressedHilbert< T >:
Collaboration graph
[legend]

Public Member Functions

virtual ~CompressedHilbert ()
 Base deconstructor. More...
 
 CompressedHilbert ()
 Base constructor. More...
 
 CompressedHilbert (std::string file, T zero=0)
 Base constructor initialising from file. More...
 
 CompressedHilbert (std::vector< Triplet< T > > &input, const ULI m, const ULI n, const T zero=0)
 Base constructor initialising from direct input. More...
 
virtual void load (std::vector< Triplet< T > > &input, const ULI m, const ULI n, const T zero)
 
virtual void getFirstIndexPair (ULI &row, ULI &col)
 Returns the first nonzero index, per reference. More...
 
virtual void zxa (const T *x, T *z)
 Calculates z=xA. More...
 
virtual void zax (const T *x, T *z)
 Calculates z=Ax. More...
 
virtual size_t bytesUsed ()
 
- Public Member Functions inherited from SparseMatrix< T, ULI >
 SparseMatrix ()
 Base constructor. More...
 
 SparseMatrix (const ULInzs, const ULInr, const ULInc, 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...
 
virtual unsigned long int m ()
 Queries the number of rows this matrix contains. More...
 
virtual unsigned long int n ()
 Queries the number of columns this matrix contains. More...
 
virtual unsigned long int nzs ()
 Queries the number of nonzeroes stored in this matrix. More...
 
virtual T * mv (const T *x)
 Calculates and returns z=Ax. More...
 
virtual void zax (const T *__restrict__ x, T *__restrict__ z)=0
 In-place z=Ax function. More...
 
virtual void zxa (const T *__restrict__ x, T *__restrict__ z)=0
 In-place z=xA function. 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 Attributes

T * values
 Array of nonzero values.
 
HilbertArrayInterface< T > * indices
 Pointer to indices in Hilbert-coordinate form.
 
- Protected Attributes inherited from SparseMatrix< T, ULI >
ULI nor
 Number of rows. More...
 
ULI noc
 Number of columns.
 
ULI nnz
 Number of non-zeros. More...
 

Additional Inherited Members

- Public Attributes inherited from SparseMatrix< T, ULI >
zero_element
 The element considered to be zero. More...
 

Detailed Description

template<typename T>
class CompressedHilbert< T >

A Hilbert scheme backed by a specialised storage format.

This implementation does not use blocking, as that would require a two-fold datastructure (COO or BICRS on the lower end). The block size would then best be of the size of a char (256x256) or of a short int (65536x65536).

Constructor & Destructor Documentation

template<typename T >
virtual CompressedHilbert< T >::~CompressedHilbert ( )
inlinevirtual
template<typename T >
CompressedHilbert< T >::CompressedHilbert ( )
inline
template<typename T >
CompressedHilbert< T >::CompressedHilbert ( std::string  file,
zero = 0 
)
inline

Base constructor initialising from file.

References SparseMatrix< T, ULI >::loadFromFile().

template<typename T >
CompressedHilbert< T >::CompressedHilbert ( std::vector< Triplet< T > > &  input,
const ULI  m,
const ULI  n,
const T  zero = 0 
)
inline

Base constructor initialising from direct input.

References CompressedHilbert< T >::load().

Member Function Documentation

template<typename T >
virtual size_t CompressedHilbert< T >::bytesUsed ( )
inlinevirtual
Returns
The number of bytes used by this storage scheme.

Implements Matrix< T >.

References CompressedHilbert< T >::indices.

template<typename T >
virtual void CompressedHilbert< T >::getFirstIndexPair ( ULI &  row,
ULI &  col 
)
inlinevirtual

Returns the first nonzero index, per reference.

Implements SparseMatrix< T, ULI >.

References CompressedHilbert< T >::indices.

template<typename T >
virtual void CompressedHilbert< T >::load ( std::vector< Triplet< T > > &  input,
const ULI  m,
const ULI  n,
const T  zero 
)
inlinevirtual
template<typename T >
virtual void CompressedHilbert< T >::zax ( const T *  x,
T *  z 
)
inlinevirtual

Calculates z=Ax.

Note z is not implicitly zeroed before multiplication.

Parameters
xThe (initialised) input vector.
zThe (initialised) output vector.

References CompressedHilbert< T >::indices, SparseMatrix< T, ULI >::nnz, and CompressedHilbert< T >::values.

template<typename T >
virtual void CompressedHilbert< T >::zxa ( const T *  x,
T *  z 
)
inlinevirtual

Calculates z=xA.

Note z is not implicitly zeroed before multiplication.

Parameters
xThe (initialised) input vector.
zThe (initialised) output vector.

References CompressedHilbert< T >::indices, SparseMatrix< T, ULI >::nnz, and CompressedHilbert< T >::values.


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