1#ifndef TATAMI_DELAYED_TRANSPOSE
2#define TATAMI_DELAYED_TRANSPOSE
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(
83 return my_matrix->dense(!row, opt);
86 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
88 const Index_ block_start,
89 const Index_ block_length,
92 return my_matrix->dense(!row, block_start, block_length, opt);
95 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> >
dense(
100 return my_matrix->dense(!row, std::move(indices_ptr), opt);
107 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
111 return my_matrix->sparse(!row, opt);
114 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
116 const Index_ block_start,
117 const Index_ block_length,
120 return my_matrix->sparse(!row, block_start, block_length, opt);
123 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> >
sparse(
128 return my_matrix->sparse(!row, std::move(indices_ptr), opt);
135 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
140 return my_matrix->dense(!row, std::move(oracle), opt);
143 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
146 const Index_ block_start,
147 const Index_ block_length,
150 return my_matrix->dense(!row, std::move(oracle), block_start, block_length, opt);
153 std::unique_ptr<OracularDenseExtractor<Value_, Index_> >
dense(
159 return my_matrix->dense(!row, std::move(oracle), std::move(indices_ptr), opt);
166 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
171 return my_matrix->sparse(!row, std::move(oracle), opt);
174 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
177 const Index_ block_start,
178 const Index_ block_length,
181 return my_matrix->sparse(!row, std::move(oracle), block_start, block_length, opt);
184 std::unique_ptr<OracularSparseExtractor<Value_, Index_> >
sparse(
190 return my_matrix->sparse(!row, std::move(oracle), std::move(indices), opt);
198template<
typename Value_,
typename Index_>
199std::shared_ptr<Matrix<Value_, Index_> > make_DelayedTranspose(std::shared_ptr<
const Matrix<Value_, Index_> > matrix) {
200 return std::shared_ptr<Matrix<Value_, Index_> >(
new DelayedTranspose<Value_, Index_>(std::move(matrix)));
203template<
typename Value_,
typename Index_>
204std::shared_ptr<Matrix<Value_, Index_> > make_DelayedTranspose(std::shared_ptr<Matrix<Value_, Index_> > matrix) {
205 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:79
Index_ ncol() const
Definition DelayedTranspose.hpp:47
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:135
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:174
bool is_sparse() const
Definition DelayedTranspose.hpp:51
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:184
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:153
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(const bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:95
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(const bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedTranspose.hpp:166
bool prefer_rows() const
Definition DelayedTranspose.hpp:59
bool uses_oracle(const bool row) const
Definition DelayedTranspose.hpp:67
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:86
DelayedTranspose(std::shared_ptr< Matrix< Value_, Index_ > > matrix)
Definition DelayedTranspose.hpp:37
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(const bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedTranspose.hpp:123
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(const bool row, const Options &opt) const
Definition DelayedTranspose.hpp:107
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
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:143
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:114
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