1#ifndef TATAMI_NEW_EXTRACTOR_HPP
2#define TATAMI_NEW_EXTRACTOR_HPP
22template<
bool oracle_,
typename Index_>
23using MaybeOracle =
typename std::conditional<oracle_, std::shared_ptr<const Oracle<Index_> >,
bool>::type;
28template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_,
typename ... Args_>
29std::unique_ptr<Extractor<sparse_, oracle_, Value_, Index_> > make_Extractor_base(
34 if constexpr(sparse_) {
35 if constexpr(oracle_) {
36 return matrix.
sparse(row, std::move(oracle), std::forward<Args_>(args)...);
38 return matrix.
sparse(row, std::forward<Args_>(args)...);
41 if constexpr(oracle_) {
42 return matrix.
dense(row, std::move(oracle), std::forward<Args_>(args)...);
44 return matrix.
dense(row, std::forward<Args_>(args)...);
68template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_>
75 return make_Extractor_base<sparse_, oracle_>(matrix, row, std::move(oracle), opt);
94template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_>
103 return make_Extractor_base<sparse_, oracle_>(matrix, row, std::move(oracle), block_start, block_length, opt);
122template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_>
130 return make_Extractor_base<sparse_, oracle_>(matrix, row, std::move(oracle), std::move(indices_ptr), opt);
136template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_,
typename ... Args_>
137[[deprecated(
"use 'make_Extractor()' instead")]]
139 return make_Extractor(matrix, row, std::move(oracle), std::forward<Args_>(args)...);
142template<
bool sparse_,
bool oracle_,
typename Value_,
typename Index_,
typename ... Args_>
143[[deprecated(
"use 'make_Extractor()' instead")]]
145 return new_extractor<sparse_, oracle_, Value_, Index_>(*ptr, row, std::move(oracle), std::forward<Args_>(args)...);
Virtual class for a matrix of some numeric type.
Virtual class for a matrix.
Definition Matrix.hpp:59
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, const Options &opt) const =0
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, const Options &opt) const =0
Flexible representations for matrix data.
Definition Extractor.hpp:15
std::shared_ptr< const std::vector< Index_ > > VectorPtr
Definition Matrix.hpp:26
typename std::conditional< oracle_, std::shared_ptr< const Oracle< Index_ > >, bool >::type MaybeOracle
Definition make_Extractor.hpp:23
std::unique_ptr< Extractor< sparse_, oracle_, Value_, Index_ > > make_Extractor(const Matrix< Value_, Index_ > &matrix, const bool row, MaybeOracle< oracle_, Index_ > oracle, const tatami::Options &opt)
Definition make_Extractor.hpp:69
Options for accessing data from a Matrix instance.
Definition Options.hpp:30