|
SparseLibrary
Version 1.6.0
|
The Hilbert scheme backed by (C)BICRS. More...
#include <Hilbert.hpp>


Public Member Functions | |
| virtual | ~Hilbert () |
| Base deconstructor. More... | |
| Hilbert () | |
| Base constructor. More... | |
| Hilbert (std::string file, T zero=0) | |
| Base constructor. More... | |
| Hilbert (std::vector< Triplet< T > > &input, ULI m, ULI n, T zero) | |
| Base constructor. 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 () |
| Gets the number of bytes used by this storage scheme. More... | |
| void | saveBinary (const std::string fn) |
| Saves the current Hilbert structure in binary triplet form. More... | |
| void | loadBinary (const std::string fn) |
| Loads from binary triplets, assumes Hilbert ordering already done. | |
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... | |
Static Protected Member Functions | |
| static Matrix< T > * | getDataStructure (std::vector< Triplet< T > > &tds, const ULI m, const ULI n, T zero) |
| Gets the data structure. More... | |
Protected Attributes | |
| ULI | minexp |
| Minimum number of expansions. | |
| std::vector< HilbertTriplet< T > > | ds |
| Vector storing the non-zeros and their locations. More... | |
| Matrix< T > * | ads |
| Actual data structure. More... | |
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 > | |
| T | zero_element |
| The element considered to be zero. More... | |
The Hilbert scheme backed by (C)BICRS.
In effect similar to the Hilbert Triplet scheme (HTS), but uses BICRS to store the nonzeroes.
Base deconstructor.
References Hilbert< T >::ads.
Base constructor.
References Hilbert< T >::ads.
Base constructor.
Will read in from Matrix Market file.
References Hilbert< T >::ads, and SparseMatrix< T, ULI >::loadFromFile().
|
inline |
Base constructor.
Warning: the zero parameter is currently NOT USED!
| input | Raw input of normal triplets. |
| m | Total number of rows. |
| n | Total number of columns. |
| zero | What elements is considered to-be zero. |
References Hilbert< T >::ads, and Hilbert< T >::load().
|
inlinevirtual |
Gets the number of bytes used by this storage scheme.
Implements Matrix< T >.
References Hilbert< T >::ads.
|
inlinestaticprotected |
Gets the data structure.
Convience function, enables quick changes in Hilbert backing structure.
References CBICRS_factory< _t_value >::getCBICRS(), SparseMatrix< T, ULI >::m(), and SparseMatrix< T, ULI >::n().
Referenced by Hilbert< T >::load(), and Hilbert< T >::loadBinary().
|
inlinevirtual |
Returns the first nonzero index, per reference.
Implements SparseMatrix< T, ULI >.
References Hilbert< T >::ds.
|
inlinevirtual |
Implements SparseMatrix< T, ULI >.
References Hilbert< T >::ads, Hilbert< T >::ds, Hilbert< T >::getDataStructure(), SparseMatrix< T, ULI >::m(), SparseMatrix< T, ULI >::n(), SparseMatrix< T, ULI >::nnz, SparseMatrix< T, ULI >::noc, SparseMatrix< T, ULI >::nor, and SparseMatrix< T, ULI >::zero_element.
Referenced by Hilbert< T >::Hilbert().
|
inline |
Saves the current Hilbert structure in binary triplet form.
| fn | Filename to save to. |
References Hilbert< T >::ds, SparseMatrix< T, ULI >::noc, SparseMatrix< T, ULI >::nor, and HilbertTriplet< T >::save().
|
inlinevirtual |
Calculates z=Ax.
z is not set to 0 at the start of this method!
| x | The (initialised) input vector. |
| z | The (initialised) output vector. |
References Hilbert< T >::ads.
|
inlinevirtual |
Calculates z=xA.
z is not set to 0 at the start of this method!
| x | The (initialised) input vector. |
| z | The (initialised) output vector. |
References Hilbert< T >::ads.
Actual data structure.
Referenced by Hilbert< T >::bytesUsed(), Hilbert< T >::Hilbert(), Hilbert< T >::load(), Hilbert< T >::loadBinary(), Hilbert< T >::zax(), Hilbert< T >::zxa(), and Hilbert< T >::~Hilbert().
|
protected |
Vector storing the non-zeros and their locations.
Referenced by Hilbert< T >::getFirstIndexPair(), Hilbert< T >::load(), and Hilbert< T >::saveBinary().
1.8.7