tatami
C++ API for different matrix representations
|
Wrap a full dense extractor in the sparse interface. More...
#include <SparsifiedWrapper.hpp>
Inherits SparseExtractor< oracle_, Value_, Index_ >.
Public Member Functions | |
FullSparsifiedWrapper (std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, Index_ extent, const Options &opt) | |
SparseRange< Value_, Index_ > | fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer) |
Wrap a full dense extractor in the sparse interface.
This can be used to quickly implement the full 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 that retrieves the full extent of the non-target dimension. If oracle_ = true , this should be an instance of a MyopicDenseExtractor subclass; otherwise it should be an OracularDenseExtractor instance. |
extent | Extent of the row/column extracted by d . |
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()
.