SparseLibrary
Version 1.6.0
|
Actual storage implementation. More...
#include <HilbertArray.hpp>
Public Member Functions | |
HilbertArray (const std::vector< unsigned long int > &input) | |
Base constructor. More... | |
virtual ULI | getFirstRowIndex () |
Gets the start-location of the first nonzero in this array. More... | |
virtual ULI | getFirstColumnIndex () |
Gets the start-location of the first nonzero in this array. More... | |
virtual void | zxa (const T *__restrict__ const &x, T *__restrict__ const &y, const T *__restrict__ &v, const T *__restrict__ const &v_end) |
Flat implementation of the zax. More... | |
virtual void | zax (const T *__restrict__ const &x, T *__restrict__ const &y, const T *__restrict__ &v, const T *__restrict__ const &v_end) |
Flat implementation of the zax. More... | |
virtual size_t | bytesUsed () |
virtual void | moveToStart (const T *__restrict__ &x, T *__restrict__ &y, const T &v) |
Moves this interface to the start location and perform a single multiply-add there. More... | |
virtual void | moveToNext (const T *__restrict__ &x, T *__restrict__ &y, const T &v) |
Moves this interface and the two given vectors to the next position. More... | |
virtual | ~HilbertArray () |
Base deconstructor. More... | |
Public Member Functions inherited from HilbertArrayInterface< T > | |
virtual | ~HilbertArrayInterface () |
Base deconstructor. More... | |
Protected Member Functions | |
void | decode (const hI coor, mI &row, mI &col) |
Translates a Hilbert coordinate into a row and column index. More... | |
void | decode (hI &cur, const I &inc, mI &row, mI &col) |
Translates a Hilbert coordinate into a row and column index. More... | |
Protected Attributes | |
hI | start_coor |
Hilbert start coordinate. More... | |
I * | array |
Index storage array. More... | |
I *__restrict__ | curpos |
Current position in the array. More... | |
hI | curcoor |
Current Hilbert coordinate. More... | |
mI | currow |
Current row position. More... | |
mI | curcol |
Current column position. More... | |
size_t | bytes |
Keeps track of memory use. More... | |
Actual storage implementation.
T | Nonzero data type. |
I | Hilbert-coordinate increment type. |
hI | Full Hilbert-coordinate data type. |
mI | Full matrix coordinate data type. |
|
inline |
Base constructor.
References HilbertArray< T, I, hI, mI >::array, HilbertArray< T, I, hI, mI >::bytes, HilbertArray< T, I, hI, mI >::curpos, and HilbertArray< T, I, hI, mI >::start_coor.
|
inlinevirtual |
Base deconstructor.
References HilbertArray< T, I, hI, mI >::array.
|
inlinevirtual |
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::bytes.
|
inlineprotected |
Translates a Hilbert coordinate into a row and column index.
coor | Input Hilbert coordinate. |
row | Where to decode the row index. |
col | Where to decode the column index. |
Referenced by HilbertArray< T, I, hI, mI >::getFirstColumnIndex(), HilbertArray< T, I, hI, mI >::getFirstRowIndex(), HilbertArray< T, I, hI, mI >::moveToNext(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().
|
inlineprotected |
Translates a Hilbert coordinate into a row and column index.
Only updates the bits necessary to be updated, i.e., skips the first startPos bits of row and col. Assumes the bits that will be skipped already have the correct value (of course), i.e., this only works with the incremental scheme!
|
inlinevirtual |
Gets the start-location of the first nonzero in this array.
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::currow, HilbertArray< T, I, hI, mI >::decode(), and HilbertArray< T, I, hI, mI >::start_coor.
|
inlinevirtual |
Gets the start-location of the first nonzero in this array.
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::currow, HilbertArray< T, I, hI, mI >::decode(), and HilbertArray< T, I, hI, mI >::start_coor.
|
inlinevirtual |
Moves this interface and the two given vectors to the next position.
x | Points to the start of the input vector. |
y | Points to the start of the output vector. |
v | Non-zero value to use. |
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::curcoor, HilbertArray< T, I, hI, mI >::curpos, HilbertArray< T, I, hI, mI >::currow, and HilbertArray< T, I, hI, mI >::decode().
|
inlinevirtual |
Moves this interface to the start location and perform a single multiply-add there.
x | Points to the start of the input vector. |
y | Points to the start of the output vector. |
v | Nonzero value to use. |
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::array, HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::curcoor, HilbertArray< T, I, hI, mI >::curpos, HilbertArray< T, I, hI, mI >::currow, HilbertArray< T, I, hI, mI >::decode(), and HilbertArray< T, I, hI, mI >::start_coor.
|
inlinevirtual |
Flat implementation of the zax.
Might perform better than using the moveToStart and moveToNext functions from an outside class.
x | Pointer to the input vector. |
y | Pointer to the output vector. |
v | Pointer to the nonzero values array. Warning: the pointer position will be altered! |
v_end | End-location of the nonzero values array (equal to v+nnz). |
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::array, HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::curcoor, HilbertArray< T, I, hI, mI >::curpos, HilbertArray< T, I, hI, mI >::currow, HilbertArray< T, I, hI, mI >::decode(), Matrix2HilbertCoordinates::IntegerToHilbert(), and HilbertArray< T, I, hI, mI >::start_coor.
|
inlinevirtual |
Flat implementation of the zax.
Might perform better than using the moveToStart and moveToNext functions from an outside class.
x | Pointer to the input vector. |
y | Pointer to the output vector. |
v | Pointer to the nonzero values array. Warning: the pointer position will be altered! |
v_end | End-location of the nonzero values array (equal to v+nnz). |
Implements HilbertArrayInterface< T >.
References HilbertArray< T, I, hI, mI >::array, HilbertArray< T, I, hI, mI >::curcol, HilbertArray< T, I, hI, mI >::curcoor, HilbertArray< T, I, hI, mI >::curpos, HilbertArray< T, I, hI, mI >::currow, HilbertArray< T, I, hI, mI >::decode(), and HilbertArray< T, I, hI, mI >::start_coor.
|
protected |
|
protected |
Keeps track of memory use.
Referenced by HilbertArray< T, I, hI, mI >::bytesUsed(), and HilbertArray< T, I, hI, mI >::HilbertArray().
|
protected |
Current column position.
Referenced by HilbertArray< T, I, hI, mI >::getFirstColumnIndex(), HilbertArray< T, I, hI, mI >::getFirstRowIndex(), HilbertArray< T, I, hI, mI >::moveToNext(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().
|
protected |
Current Hilbert coordinate.
Referenced by HilbertArray< T, I, hI, mI >::moveToNext(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().
|
protected |
Current position in the array.
Referenced by HilbertArray< T, I, hI, mI >::HilbertArray(), HilbertArray< T, I, hI, mI >::moveToNext(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().
|
protected |
Current row position.
Referenced by HilbertArray< T, I, hI, mI >::getFirstColumnIndex(), HilbertArray< T, I, hI, mI >::getFirstRowIndex(), HilbertArray< T, I, hI, mI >::moveToNext(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().
|
protected |
Hilbert start coordinate.
Referenced by HilbertArray< T, I, hI, mI >::getFirstColumnIndex(), HilbertArray< T, I, hI, mI >::getFirstRowIndex(), HilbertArray< T, I, hI, mI >::HilbertArray(), HilbertArray< T, I, hI, mI >::moveToStart(), HilbertArray< T, I, hI, mI >::zax(), and HilbertArray< T, I, hI, mI >::zxa().