HDK
|
#include <CE_SparseMatrix.h>
Public Types | |
typedef T | value_type |
Public Member Functions | |
CE_SparseMatrixELLT () | |
virtual | ~CE_SparseMatrixELLT () |
void | init (inttype rows, int nzperrow, bool colmajor=true) |
Initialize to the given number of rows and non-zeros per row. More... | |
template<bool colmajor> | |
void | initFromMatrix (const UT_SparseMatrixELLT< T, colmajor, useexint > &src, bool block=true) |
Initialize from the provided UT_SparseMatrixELL. More... | |
void | matchAndCopyToMatrix (UT_SparseMatrixELLT< T, true, useexint > &dst, bool block=true) const |
inttype | getNumRows () const |
Returns the number of rows. More... | |
int | getNonZerosPerRow () const |
Returns the number of non-zeros per row. More... | |
void | multVec (const CE_VectorT< T > &v, CE_VectorT< T > &result) const |
Sparse-matrix vector multiply. More... | |
void | getDiagonalInv (CE_VectorT< T > &result) const |
Get the inverse of the diagonal. More... | |
float | solveConjugateGradient (CE_VectorT< T > &x, const CE_VectorT< T > &b, T tol2=1e-5, int max_iters=-1, int *iterout=NULL) const |
Solve Ax = b using conjugate gradient with Jacobi pre-conditioning,. More... | |
Protected Member Functions | |
void | allocBuffers () const |
void | releaseBuffers () |
cl::Kernel | loadKernel (const char *kernelName, const char *opt=NULL) const |
cl::KernelFunctor | bind (const char *kernelName) const |
Protected Attributes | |
cl::Buffer | myRowValsBuffer |
cl::Buffer | myColumnsBuffer |
inttype | myRows |
int | myNonZeros |
bool | myColMajor |
cl::NDRange | myGlobalRange |
cl::NDRange | myLocalRange |
An ELL-format sparse matrix for OpenCL. This class is fairly limited; its primary purpose is to initialize with an alread-populated UT_SparseMatrixELL, then call its solveConjugateGradient function to solve a linear system using OpenCL.
Definition at line 30 of file CE_SparseMatrix.h.
typedef T CE_SparseMatrixELLT< T, useexint >::value_type |
Definition at line 36 of file CE_SparseMatrix.h.
CE_SparseMatrixELLT< T, useexint >::CE_SparseMatrixELLT | ( | ) |
|
virtual |
|
protected |
|
protected |
void CE_SparseMatrixELLT< T, useexint >::getDiagonalInv | ( | CE_VectorT< T > & | result | ) | const |
Get the inverse of the diagonal.
|
inline |
Returns the number of non-zeros per row.
Definition at line 61 of file CE_SparseMatrix.h.
|
inline |
Returns the number of rows.
Definition at line 58 of file CE_SparseMatrix.h.
void CE_SparseMatrixELLT< T, useexint >::init | ( | inttype | rows, |
int | nzperrow, | ||
bool | colmajor = true |
||
) |
Initialize to the given number of rows and non-zeros per row.
void CE_SparseMatrixELLT< T, useexint >::initFromMatrix | ( | const UT_SparseMatrixELLT< T, colmajor, useexint > & | src, |
bool | block = true |
||
) |
Initialize from the provided UT_SparseMatrixELL.
Definition at line 89 of file CE_SparseMatrix.h.
|
protected |
void CE_SparseMatrixELLT< T, useexint >::matchAndCopyToMatrix | ( | UT_SparseMatrixELLT< T, true, useexint > & | dst, |
bool | block = true |
||
) | const |
Copy back to the provided UT_SparseMatrixELL. Only callable with column-major destinations.
void CE_SparseMatrixELLT< T, useexint >::multVec | ( | const CE_VectorT< T > & | v, |
CE_VectorT< T > & | result | ||
) | const |
Sparse-matrix vector multiply.
|
protected |
float CE_SparseMatrixELLT< T, useexint >::solveConjugateGradient | ( | CE_VectorT< T > & | x, |
const CE_VectorT< T > & | b, | ||
T | tol2 = 1e-5 , |
||
int | max_iters = -1 , |
||
int * | iterout = NULL |
||
) | const |
Solve Ax = b using conjugate gradient with Jacobi pre-conditioning,.
|
protected |
Definition at line 82 of file CE_SparseMatrix.h.
|
mutableprotected |
Definition at line 79 of file CE_SparseMatrix.h.
|
protected |
Definition at line 83 of file CE_SparseMatrix.h.
|
protected |
Definition at line 83 of file CE_SparseMatrix.h.
|
protected |
Definition at line 81 of file CE_SparseMatrix.h.
|
protected |
Definition at line 80 of file CE_SparseMatrix.h.
|
mutableprotected |
Definition at line 79 of file CE_SparseMatrix.h.