1#ifndef TATAMI_DELAYED_TRANSPOSE
2#define TATAMI_DELAYED_TRANSPOSE
26template<
typename Value_,
typename Index_>
35 std::shared_ptr<const Matrix<Value_, Index_> > my_matrix;
39 return my_matrix->ncol();
43 return my_matrix->nrow();
47 return my_matrix->is_sparse();
51 return my_matrix->is_sparse_proportion();
55 return !my_matrix->prefer_rows();
59 return 1 - my_matrix->prefer_rows_proportion();
63 return my_matrix->uses_oracle(!row);
74 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
78 return my_matrix->dense(!row, opt);
81 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
83 const Index_ block_start,
84 const Index_ block_length,
87 return my_matrix->dense(!row, block_start, block_length, opt);
90 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
95 return my_matrix->dense(!row, std::move(indices_ptr), opt);
102 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
106 return my_matrix->sparse(!row, opt);
109 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
111 const Index_ block_start,
112 const Index_ block_length,
115 return my_matrix->sparse(!row, block_start, block_length, opt);
118 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
123 return my_matrix->sparse(!row, std::move(indices_ptr), opt);
130 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
135 return my_matrix->dense(!row, std::move(oracle), opt);
138 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
141 const Index_ block_start,
142 const Index_ block_length,
145 return my_matrix->dense(!row, std::move(oracle), block_start, block_length, opt);
148 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
154 return my_matrix->dense(!row, std::move(oracle), std::move(indices_ptr), opt);
161 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
166 return my_matrix->sparse(!row, std::move(oracle), opt);
169 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
172 const Index_ block_start,
173 const Index_ block_length,
176 return my_matrix->sparse(!row, std::move(oracle), block_start, block_length, opt);
179 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
185 return my_matrix->sparse(!row, std::move(oracle), std::move(indices), opt);
193template<
typename Value_,
typename Index_>
194std::shared_ptr<Matrix<Value_, Index_> > make_DelayedTranspose(std::shared_ptr<
const Matrix<Value_, Index_> > matrix) {
195 return std::shared_ptr<Matrix<Value_, Index_> >(
new DelayedTranspose<Value_, Index_>(std::move(matrix)));
198template<
typename Value_,
typename Index_>
199std::shared_ptr<Matrix<Value_, Index_> > make_DelayedTranspose(std::shared_ptr<Matrix<Value_, Index_> > matrix) {
200 return std::shared_ptr<Matrix<Value_, Index_> >(
new DelayedTranspose<Value_, Index_>(std::move(matrix)));
Virtual class for a matrix of some numeric type.
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< MyopicDenseExtractor< Value_, Index_ > > dense(const bool row, const Options &opt) const
Definition DelayedTranspose.hpp:74
Index_ ncol() const
Definition DelayedTranspose.hpp:42
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:130
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Index_ block_start, const Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:169
bool is_sparse() const
Definition DelayedTranspose.hpp:46
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices, const Options &opt) const
Definition DelayedTranspose.hpp:179
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:148
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(const bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:90
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:161
bool prefer_rows() const
Definition DelayedTranspose.hpp:54
bool uses_oracle(const bool row) const
Definition DelayedTranspose.hpp:62
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(const bool row, const Index_ block_start, const Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:81
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(const bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:118
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(const bool row, const Options &opt) const
Definition DelayedTranspose.hpp:102
Index_ nrow() const
Definition DelayedTranspose.hpp:38
double is_sparse_proportion() const
Definition DelayedTranspose.hpp:50
double prefer_rows_proportion() const
Definition DelayedTranspose.hpp:58
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Index_ block_start, const Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:138
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(const bool row, const Index_ block_start, const Index_ block_length, const Options &opt) const
Definition DelayedTranspose.hpp:109
Virtual class for a matrix.
Definition Matrix.hpp:59
Predict future access requests on the target dimension.
Definition Oracle.hpp:29
Flexible representations for matrix data.
Definition Extractor.hpp:15
std::shared_ptr< const std::vector< Index_ > > VectorPtr
Definition Matrix.hpp:26
Options for accessing data from a Matrix instance.
Definition Options.hpp:30