tatami_chunked
Helpers to create custom chunked tatami matrices
|
Create a sparse chunk for a CustomSparseChunkedMatrix
.
More...
#include <mock_sparse_chunk.hpp>
Create a sparse chunk for a CustomSparseChunkedMatrix
.
Wraps a sparse blob in a simple chunk interface for use inside a CustomSparseChunkedMatrix
. Each blob should hold a (possibly compressed) 2-dimensional sparse array of numeric values. The wrapper satisfies the MockSimpleSparseChunk
interface, but is even simpler; extraction of any data involves realization of the entire blob, with no optimization for subsets of interest along either dimension.
The Blob_
class should provide the following:
typedef value_type
, specifying the type of the value in the array.typedef index_type
, specifying the type of the index in the submatrix.nrow() const
method, returning the number of rows in the array as an integer.ncol() const
method, returning the numbr of columns in the array as an integer.bool is_csr() const
method, indicating whether the realized data is in compressed sparse row (CSR) format.void inflate(std::vector<value_type>& values, std::vector<Index_>& indices, std::vector<size_t>& pointers) const
method that fills values
, indices
and pointers
, each with the corresponding field for compressed sparse matrix format. (The type of Index_
is the same as that used in the CustomSparseChunkedMatrix
.) This should constitute a CSR matrix if is_csr()
returns true, and a CSC matrix otherwise.Blob_ | Class to represent a simple chunk. |