tatami
C++ API for different matrix representations
|
Wrap an indexed dense extractor in the sparse interface. More...
#include <SparsifiedWrapper.hpp>
Inherits SparseExtractor< oracle_, Value_, Index_ >.
Public Member Functions | |
IndexSparsifiedWrapper (std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, VectorPtr< Index_ > indices_ptr, const Options &opt) | |
SparseRange< Value_, Index_ > | fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer) |
Wrap an indexed dense extractor in the sparse interface.
This can be used to quickly implement the indexed 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 an indexed subset of the non-target dimension. If oracle_ = true , this should be an instance of a MyopicDenseExtractor subclass; otherwise it should be an OracularDenseExtractor instance. |
indices_ptr | Pointer to a vector of sorted and unique indices for the non-target dimension. 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()
.