1#ifndef TATAMI_DELAYED_TRANSPOSE
2#define TATAMI_DELAYED_TRANSPOSE
4#include "../base/Matrix.hpp"
26template<
typename Value_,
typename Index_>
40 std::shared_ptr<const Matrix<Value_, Index_> > my_matrix;
44 return my_matrix->ncol();
48 return my_matrix->nrow();
52 return my_matrix->is_sparse();
56 return my_matrix->is_sparse_proportion();
60 return !my_matrix->prefer_rows();
64 return 1 - my_matrix->prefer_rows_proportion();
68 return my_matrix->uses_oracle(!
row);
79 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
bool row,
const Options&
opt)
const {
80 return my_matrix->dense(!
row,
opt);
96 return my_matrix->sparse(!
row,
opt);
144template<
typename Value_,
typename Index_>
149template<
typename Value_,
typename Index_>
Delayed transposition of a matrix.
Definition DelayedTranspose.hpp:27
DelayedTranspose(std::shared_ptr< const Matrix< Value_, Index_ > > matrix)
Definition DelayedTranspose.hpp:32
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:99
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:87
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:83
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, const Options &opt) const
Definition DelayedTranspose.hpp:79
Index_ ncol() const
Definition DelayedTranspose.hpp:47
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:131
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:103
bool is_sparse() const
Definition DelayedTranspose.hpp:51
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:115
bool uses_oracle(bool row) const
Definition DelayedTranspose.hpp:67
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, const Options &opt) const
Definition DelayedTranspose.hpp:95
bool prefer_rows() const
Definition DelayedTranspose.hpp:59
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:127
DelayedTranspose(std::shared_ptr< Matrix< Value_, Index_ > > matrix)
Definition DelayedTranspose.hpp:37
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices, const Options &opt) const
Definition DelayedTranspose.hpp:135
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:111
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:119
Index_ nrow() const
Definition DelayedTranspose.hpp:43
double is_sparse_proportion() const
Definition DelayedTranspose.hpp:55
double prefer_rows_proportion() const
Definition DelayedTranspose.hpp:63
Virtual class for a matrix.
Definition Matrix.hpp:59
Predict future access requests on the target dimension.
Definition Oracle.hpp:21
Flexible representations for matrix data.
Definition Extractor.hpp:15
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