A sparse square matrix, where entries are stored as triplets (i,j, val), where i and j are the row and column indices and val denotes the entry.
More...
Public Types |
typedef
viennacl::backend::mem_handle | handle_type |
typedef scalar< typename
viennacl::tools::CHECK_SCALAR_TEMPLATE_ARGUMENT
< SCALARTYPE >::ResultType > | value_type |
typedef vcl_size_t | size_type |
Public Member Functions |
| coordinate_matrix () |
| Default construction of a coordinate matrix. No memory is allocated.
|
| coordinate_matrix (viennacl::context ctx) |
| coordinate_matrix (vcl_size_t rows, vcl_size_t cols, vcl_size_t nonzeros=0, viennacl::context ctx=viennacl::context()) |
| Construction of a coordinate matrix with the supplied number of rows and columns. If the number of nonzeros is positive, memory is allocated.
|
| coordinate_matrix (vcl_size_t rows, vcl_size_t cols, viennacl::context ctx) |
| Construction of a coordinate matrix with the supplied number of rows and columns in the supplied context. Does not yet allocate memory.
|
void | reserve (vcl_size_t new_nonzeros) |
| Allocate memory for the supplied number of nonzeros in the matrix. Old values are preserved.
|
void | resize (vcl_size_t new_size1, vcl_size_t new_size2, bool preserve=true) |
| Resize the matrix.
|
vcl_size_t | size1 () const |
| Returns the number of rows.
|
vcl_size_t | size2 () const |
| Returns the number of columns.
|
vcl_size_t | nnz () const |
| Returns the number of nonzero entries.
|
vcl_size_t | internal_nnz () const |
| Returns the number of internal nonzero entries.
|
const handle_type & | handle12 () const |
| Returns the OpenCL handle to the (row, column) index array.
|
const handle_type & | handle () const |
| Returns the OpenCL handle to the matrix entry array.
|
const handle_type & | handle3 () const |
| Returns the OpenCL handle to the group start index array.
|
vcl_size_t | groups () const |
Friends |
template<typename CPU_MATRIX , typename SCALARTYPE2 , unsigned int ALIGNMENT2> |
void | copy (const CPU_MATRIX &cpu_matrix, coordinate_matrix< SCALARTYPE2, ALIGNMENT2 > &gpu_matrix) |
template<class SCALARTYPE, unsigned int ALIGNMENT>
class viennacl::coordinate_matrix< SCALARTYPE, ALIGNMENT >
A sparse square matrix, where entries are stored as triplets (i,j, val), where i and j are the row and column indices and val denotes the entry.
The present implementation of coordinate_matrix suffers from poor runtime efficiency. Users are adviced to use compressed_matrix in the meanwhile.
- Template Parameters:
-
SCALARTYPE | The floating point type (either float or double, checked at compile time) |
ALIGNMENT | The internal memory size for the arrays, given by (size()/ALIGNMENT + 1) * ALIGNMENT. ALIGNMENT must be a power of two. |