|
| CompressedSparseMatrix (Index_ nrow, Index_ ncol, std::string file_name, std::string value_name, std::string index_name, std::string pointer_name, bool csr, const CompressedSparseMatrixOptions &options) |
|
| CompressedSparseMatrix (Index_ ncsr, Index_ ncol, std::string file_name, std::string value_name, std::string index_name, std::string pointer_name, bool csr) |
|
Index_ | nrow () const |
|
Index_ | ncol () const |
|
bool | is_sparse () const |
|
double | is_sparse_proportion () const |
|
bool | prefer_rows () const |
|
double | prefer_rows_proportion () const |
|
bool | uses_oracle (bool) const |
|
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > | dense (bool row, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > | dense (bool row, Index_ block_start, Index_ block_length, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > | dense (bool row, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > | sparse (bool row, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > | sparse (bool row, Index_ block_start, Index_ block_length, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > | sparse (bool row, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > | dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > | dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > | dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > | sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > | sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const tatami::Options &opt) const |
|
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > | sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row () const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_row (std::vector< Index_ > indices) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column () const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > | dense_column (std::vector< Index_ > indices) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > | dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row () const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_row (std::vector< Index_ > indices) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column () const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > | sparse_column (std::vector< Index_ > indices) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const |
|
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > | sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const |
|
template<typename Value_, typename Index_, typename CachedValue_ = Value_, typename CachedIndex_ = Index_>
class tatami_hdf5::CompressedSparseMatrix< Value_, Index_, CachedValue_, CachedIndex_ >
Compressed sparse matrix in a HDF5 file.
This class retrieves sparse data from the HDF5 file on demand rather than loading it all in at the start. This allows us to handle very large datasets in limited memory at the cost of speed.
We manually handle the chunk caching to speed up access for consecutive rows or columns (for compressed sparse row and column matrices, respectively). The policy is to minimize the number of calls to the HDF5 library - and thus expensive file reads - by requesting large contiguous slices where possible, i.e., multiple columns or rows for CSC and CSR matrices, respectively. These are held in memory in the Extractor
while the relevant column/row is returned to the user by row()
or column()
. The size of the slice is determined by the options
in the constructor.
Callers should follow the suggestion of prefer_rows()
when extracting data, as this tries to minimize the number of chunks that need to be read per access request. This recommendation is even stronger than for the DenseMatrix
, as the access pattern on disk for the non-preferred dimension is very suboptimal.
As the HDF5 library is not generally thread-safe, the HDF5-related operations should only be run in a single thread. This is normally handled automatically but developers can check out serialize()
to customize the locking scheme.
- Template Parameters
-
Value_ | Type of the matrix values. |
Index_ | Type of the row/column indices. |
CachedValue_ | Type of the matrix value to store in the cache. This can be set to a narrower type than Value_ to save memory and improve cache performance, if a smaller type is known to be able to store all values (based on their HDF5 type or other knowledge). |
CachedIndex_ | Type of the index value to store in the cache. This can be set to a narrower type than Index_ to save memory and improve cache performance, if a smaller type is known to be able to store all indices (based on their HDF5 type or other knowledge). |