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

The Bisection Hilbert triplet scheme. More...

#include <BisectionHilbert.hpp>

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

Public Member Functions

virtual ~BisectionHilbert ()
 Base deconstructor. More...
 
 BisectionHilbert ()
 Base constructor. More...
 
 BisectionHilbert (std::string file, T zero=0)
 Base constructor. More...
 
 BisectionHilbert (std::vector< Triplet< T > > &input, unsigned long int m, unsigned long int n, T zero)
 Base constructor. More...
 
- Public Member Functions inherited from BlockHilbert< T >
virtual ~BlockHilbert ()
 Base deconstructor. More...
 
 BlockHilbert ()
 Base constructor. More...
 
 BlockHilbert (std::string file, T zero=0, char bisect=0)
 Base constructor. More...
 
 BlockHilbert (std::vector< Triplet< T > > &input, LI m, LI n, T zero)
 Base constructor. More...
 
 BlockHilbert (std::vector< Triplet< T > > &input, LI m, LI n, char bisect, T zero)
 Base constructor. More...
 
virtual void load (std::vector< Triplet< T > > &input, const LI m, const LI n, const T zero)
 
virtual void getFirstIndexPair (LI &row, LI &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 ()
 Function to query the amount of storage required by this sparse matrix. More...
 
- Public Member Functions inherited from SparseMatrix< T, LI >
 SparseMatrix ()
 Base constructor. More...
 
 SparseMatrix (const LInzs, const LInr, const LInc, 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...
 

Additional Inherited Members

- Public Attributes inherited from SparseMatrix< T, LI >
zero_element
 The element considered to be zero. More...
 
- Protected Member Functions inherited from BlockHilbert< T >
char bisect (std::vector< HilbertTriplet< std::vector< Triplet< T > > > > &build, std::vector< Triplet< T > > &input, const unsigned long int blocki, const unsigned long int blockj, const unsigned char depth)
 Recursive bisection, leaf case. More...
 
void bisect (std::vector< HilbertTriplet< std::vector< Triplet< T > > > > &build)
 Automatically performs recursive bisection on the input nonzeroes to achieve sparse blocking. More...
 
std::vector< HilbertTriplet
< std::vector< Triplet< T > > > > 
buildBisectionBlocks (std::vector< Triplet< T > > &input)
 Builds block array by bisection. More...
 
std::vector< HilbertTriplet
< std::vector< Triplet< T > > > > 
buildBlocks (std::vector< Triplet< T > > &input)
 Builds block array by ordering them in fixed-size sparse submatrices.
 
bool cmp (HilbertTriplet< std::vector< Triplet< T > > > &left, HilbertTriplet< std::vector< Triplet< T > > > &right)
 HilbertCoordinate comparison function. More...
 
unsigned long int find (HilbertTriplet< std::vector< Triplet< T > > > &x, ULI &left, ULI &right, ULI &minexp)
 Binary search for finding a given triplet in a given range. More...
 
- Protected Attributes inherited from BlockHilbert< T >
char bisection
 Whether we use fixed block grid or a bisection-based grid.
 
ULI minexp
 Minimum number of expansions.
 
std::vector< HilbertTriplet
< std::vector< Triplet< T > > > > 
hilbert
 Vector storing the block indices and their Hilbert coordinates.
 
HBICRS< T > * ds
 The actual data structure.
 
- Protected Attributes inherited from SparseMatrix< T, LI >
LI nor
 Number of rows. More...
 
LI noc
 Number of columns.
 
LI nnz
 Number of non-zeros. More...
 
- Static Protected Attributes inherited from BlockHilbert< T >
static const ULI BLOCK_M = 2048
 Minimum number of rows in a block.
 
static const ULI BLOCK_N = 2048
 Minimum number of columns in a block.
 
static const ULI MAX_BLOCKS = 1024*128
 Maximum number of blocks.
 
static const ULI MAX_DEPTH = 64
 Maximum depth of bisection. More...
 
static const signed char DS = 2
 Which data structure to use for each block. More...
 

Detailed Description

template<typename T>
class BisectionHilbert< T >

The Bisection Hilbert triplet scheme.

In effect similar to (HierarchicalBICRS), but uses Hilbert coordinates to determine the order of the blocks, and a bisection algorithm to construct the individual blocks. Wraps around the BisectionHilbert class which already implements this scheme.

Constructor & Destructor Documentation

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

Base deconstructor.

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

Base constructor.

References BlockHilbert< T >::bisection.

template<typename T>
BisectionHilbert< T >::BisectionHilbert ( std::string  file,
zero = 0 
)
inline

Base constructor.

Will read in from Matrix Market file.

Parameters
fileThe input filename.
zeroWhat is considered zero for this sparse matrix instance.
See also
SparseMatrix::SparseMatrix( file, zero )

References BlockHilbert< T >::bisection, and SparseMatrix< T, LI >::loadFromFile().

template<typename T>
BisectionHilbert< T >::BisectionHilbert ( std::vector< Triplet< T > > &  input,
unsigned long int  m,
unsigned long int  n,
zero 
)
inline

Base constructor.

Warning: the zero parameter is currently NOT USED!

Parameters
inputRaw input of normal triplets.
mTotal number of rows.
nTotal number of columns.
zeroWhat elements is considered to-be zero.

References BlockHilbert< T >::bisection, and BlockHilbert< T >::load().


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