tatami
C++ API for different matrix representations
|
Wrap a block dense extractor in the sparse interface. More...
#include <SparsifiedWrapper.hpp>
Inherits SparseExtractor< oracle_, Value_, Index_ >.
Public Member Functions | |
BlockSparsifiedWrapper (std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, Index_ block_start, Index_ block_length, const Options &opt) | |
SparseRange< Value_, Index_ > | fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer) |
Wrap a block dense extractor in the sparse interface.
This can be used to quickly implement the block sparse extraction methods for a dense Matrix
subclass. The dense extraction is performed as usual and every value is treated as a structural non-zero; this wrapper just adds the associated indices to satisfy the sparse extraction interface.
oracle_ | Whether an oracle is involved. |
Value_ | Type of the matrix values. |
Index_ | Type of the row/column indices. |
|
inline |
dense | Instance of a dense extractor for a contiguous block of the non-target dimension. If oracle_ = true , this should be an instance of a MyopicDenseExtractor subclass; otherwise it should be an OracularDenseExtractor instance. |
block_start | Start of the block extracted by dense . Should be the same as that used to construct dense . |
block_length | Length of the block extracted by dense . Should be the same as that used to construct dense . |
opt | Options for extraction. |
|
inline |
i | Index of the element to extract on the target dimension, ignored if oracle_ = true . | |
[in,out] | value_buffer | See MyopicSparseExtractor::fetch() or OracularSparseExtractor::fetch() . |
[in,out] | index_buffer | See MyopicSparseExtractor::fetch() or OracularSparseExtractor::fetch() . |
MyopicSparseExtractor::fetch()
or OracularSparseExtractor::fetch()
.