1#ifndef TATAMI_SPARSIFIED_WRAPPER_HPP
2#define TATAMI_SPARSIFIED_WRAPPER_HPP
4#include "../base/SparseRange.hpp"
5#include "../base/Options.hpp"
6#include "../base/Extractor.hpp"
29template<
bool oracle_,
typename Value_,
typename Index_>
42 my_needs_value(
opt.sparse_extract_value),
43 my_needs_index(
opt.sparse_extract_index)
65 std::unique_ptr<DenseExtractor<oracle_, Value_, Index_> > my_dense;
82template<
bool oracle_,
typename Value_,
typename Index_>
99 my_needs_value(
opt.sparse_extract_value),
100 my_needs_index(
opt.sparse_extract_index)
111 if (my_needs_value) {
114 if (my_needs_index) {
122 std::unique_ptr<DenseExtractor<oracle_, Value_, Index_> > my_dense;
123 Index_ my_block_start, my_block_length;
139template<
bool oracle_,
typename Value_,
typename Index_>
153 my_needs_value(
opt.sparse_extract_value),
154 my_needs_index(
opt.sparse_extract_index)
164 const auto&
ix = *my_indices_ptr;
166 if (my_needs_value) {
169 if (my_needs_index) {
177 std::unique_ptr<DenseExtractor<oracle_, Value_, Index_> > my_dense;
Wrap a block dense extractor in the sparse interface.
Definition SparsifiedWrapper.hpp:83
SparseRange< Value_, Index_ > fetch(Index_ i, Value_ *value_buffer, Index_ *index_buffer)
Definition SparsifiedWrapper.hpp:109
BlockSparsifiedWrapper(std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, Index_ block_start, Index_ block_length, const Options &opt)
Definition SparsifiedWrapper.hpp:95
Wrap a full dense extractor in the sparse interface.
Definition SparsifiedWrapper.hpp:30
FullSparsifiedWrapper(std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, Index_ extent, const Options &opt)
Definition SparsifiedWrapper.hpp:39
SparseRange< Value_, Index_ > fetch(Index_ i, Value_ *value_buffer, Index_ *index_buffer)
Definition SparsifiedWrapper.hpp:52
Wrap an indexed dense extractor in the sparse interface.
Definition SparsifiedWrapper.hpp:140
IndexSparsifiedWrapper(std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, VectorPtr< Index_ > indices_ptr, const Options &opt)
Definition SparsifiedWrapper.hpp:150
SparseRange< Value_, Index_ > fetch(Index_ i, Value_ *value_buffer, Index_ *index_buffer)
Definition SparsifiedWrapper.hpp:163
Flexible representations for matrix data.
Definition Extractor.hpp:15
typename std::conditional< oracle_, OracularDenseExtractor< Value_, Index_ >, MyopicDenseExtractor< Value_, Index_ > >::type DenseExtractor
Definition Extractor.hpp:273
typename std::conditional< oracle_, OracularSparseExtractor< Value_, Index_ >, MyopicSparseExtractor< Value_, Index_ > >::type SparseExtractor
Definition Extractor.hpp:284
std::shared_ptr< const std::vector< Index_ > > VectorPtr
Definition Matrix.hpp:26
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35
Options for accessing data from a Matrix instance.
Definition Options.hpp:30
A range of a sparse vector.
Definition SparseRange.hpp:32