1#ifndef TATAMI_DELAYED_BINARY_ISOMETRIC_OPERATION_H
2#define TATAMI_DELAYED_BINARY_ISOMETRIC_OPERATION_H
4#include "../../base/Matrix.hpp"
5#include "../../utils/new_extractor.hpp"
6#include "../../utils/copy.hpp"
7#include "../../dense/SparsifiedWrapper.hpp"
8#include "../depends_utils.hpp"
31template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
35 const Matrix<InputValue_, Index_>* left,
36 const Matrix<InputValue_, Index_>* right,
37 const Operation_& operation,
39 MaybeOracle<oracle_, Index_> oracle,
41 my_operation(operation),
43 my_oracle(oracle, my_operation, row)
45 my_left_ext = new_extractor<false, oracle_>(left, my_row, oracle, opt);
46 my_right_ext = new_extractor<false, oracle_>(right, my_row, std::move(oracle), opt);
47 my_extent = my_row ? left->ncol() : left->nrow();
49 my_right_holding_buffer.resize(my_extent);
50 if constexpr(!same_value) {
51 my_left_holding_buffer.resize(my_extent);
55 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
56 auto rptr = my_right_ext->fetch(i, my_right_holding_buffer.data());
58 if constexpr(same_value) {
59 auto lptr = my_left_ext->fetch(i, buffer);
60 copy_n(lptr, my_extent, buffer);
61 my_operation.dense(my_row, my_oracle.get(i),
static_cast<Index_
>(0), my_extent, buffer, rptr, buffer);
63 auto lptr = my_left_ext->fetch(i, my_left_holding_buffer.data());
64 my_operation.dense(my_row, my_oracle.get(i),
static_cast<Index_
>(0), my_extent, lptr, rptr, buffer);
71 const Operation_& my_operation;
73 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
75 std::unique_ptr<DenseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
77 std::vector<InputValue_> my_right_holding_buffer;
79 static constexpr bool same_value = std::is_same<OutputValue_, InputValue_>::value;
80 typename std::conditional<!same_value, std::vector<InputValue_>,
bool>::type my_left_holding_buffer;
83template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
87 const Matrix<InputValue_, Index_>* left,
88 const Matrix<InputValue_, Index_>* right,
89 const Operation_& operation,
91 MaybeOracle<oracle_, Index_> oracle,
95 my_operation(operation),
97 my_oracle(oracle, my_operation, row),
98 my_block_start(block_start),
99 my_block_length(block_length)
101 my_left_ext = new_extractor<false, oracle_>(left, my_row, oracle, my_block_start, my_block_length, opt);
102 my_right_ext = new_extractor<false, oracle_>(right, my_row, std::move(oracle), my_block_start, my_block_length, opt);
104 my_right_holding_buffer.resize(my_block_length);
105 if constexpr(!same_value) {
106 my_left_holding_buffer.resize(my_block_length);
110 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
111 auto rptr = my_right_ext->fetch(i, my_right_holding_buffer.data());
113 if constexpr(same_value) {
114 auto lptr = my_left_ext->fetch(i, buffer);
115 copy_n(lptr, my_block_length, buffer);
116 my_operation.dense(my_row, my_oracle.get(i), my_block_start, my_block_length, buffer, rptr, buffer);
118 auto lptr = my_left_ext->fetch(i, my_left_holding_buffer.data());
119 my_operation.dense(my_row, my_oracle.get(i), my_block_start, my_block_length, lptr, rptr, buffer);
126 const Operation_& my_operation;
128 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
130 Index_ my_block_start, my_block_length;
131 std::unique_ptr<DenseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
132 std::vector<InputValue_> my_right_holding_buffer;
134 static constexpr bool same_value = std::is_same<OutputValue_, InputValue_>::value;
135 typename std::conditional<!same_value, std::vector<InputValue_>,
bool>::type my_left_holding_buffer;
138template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
142 const Matrix<InputValue_, Index_>* left,
143 const Matrix<InputValue_, Index_>* right,
144 const Operation_& operation,
146 MaybeOracle<oracle_, Index_> oracle,
147 VectorPtr<Index_> indices_ptr,
148 const Options& opt) :
149 my_operation(operation),
151 my_oracle(oracle, my_operation, row),
152 my_indices_ptr(std::move(indices_ptr))
154 my_left_ext = new_extractor<false, oracle_>(left, my_row, oracle, my_indices_ptr, opt);
155 my_right_ext = new_extractor<false, oracle_>(right, my_row, std::move(oracle), my_indices_ptr, opt);
157 my_right_holding_buffer.resize(my_indices_ptr->size());
158 if constexpr(!same_value) {
159 my_left_holding_buffer.resize(my_indices_ptr->size());
163 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
164 auto rptr = my_right_ext->fetch(i, my_right_holding_buffer.data());
165 const auto& indices = *my_indices_ptr;
167 if constexpr(same_value) {
168 auto lptr = my_left_ext->fetch(i, buffer);
169 copy_n(lptr, indices.size(), buffer);
170 my_operation.dense(my_row, my_oracle.get(i), indices, buffer, rptr, buffer);
172 auto lptr = my_left_ext->fetch(i, my_left_holding_buffer.data());
173 my_operation.dense(my_row, my_oracle.get(i), indices, lptr, rptr, buffer);
180 const Operation_& my_operation;
182 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
184 VectorPtr<Index_> my_indices_ptr;
185 std::unique_ptr<DenseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
186 std::vector<InputValue_> my_right_holding_buffer;
188 static constexpr bool same_value = std::is_same<OutputValue_, InputValue_>::value;
189 typename std::conditional<!same_value, std::vector<InputValue_>,
bool>::type my_left_holding_buffer;
196template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
200 const Matrix<InputValue_, Index_>* left,
201 const Matrix<InputValue_, Index_>* right,
202 const Operation_& op,
204 MaybeOracle<oracle_, Index_> oracle,
208 my_oracle(oracle, my_operation, row)
210 opt.sparse_extract_value =
true;
211 opt.sparse_extract_index =
true;
212 opt.sparse_ordered_index =
true;
213 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, opt);
214 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), opt);
216 my_extent = my_row ? left->ncol() : left->nrow();
217 my_left_vbuffer.resize(my_extent);
218 my_right_vbuffer.resize(my_extent);
219 my_output_vbuffer.resize(my_extent);
220 my_left_ibuffer.resize(my_extent);
221 my_right_ibuffer.resize(my_extent);
222 my_output_ibuffer.resize(my_extent);
225 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
226 auto lres = my_left_ext->fetch(i, my_left_vbuffer.data(), my_left_ibuffer.data());
227 auto rres = my_right_ext->fetch(i, my_right_vbuffer.data(), my_right_ibuffer.data());
229 i = my_oracle.get(i);
230 auto num = my_operation.sparse(my_row, i, lres, rres, my_output_vbuffer.data(), my_output_ibuffer.data(),
true,
true);
234 if (num < my_extent) {
235 std::fill_n(buffer, my_extent, my_operation.template fill<OutputValue_, InputValue_>(my_row, i));
238 for (Index_ j = 0; j < num; ++j) {
239 buffer[my_output_ibuffer[j]] = my_output_vbuffer[j];
245 const Operation_& my_operation;
247 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
249 std::unique_ptr<SparseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
252 std::vector<InputValue_> my_left_vbuffer, my_right_vbuffer;
253 std::vector<OutputValue_> my_output_vbuffer;
254 std::vector<Index_> my_left_ibuffer, my_right_ibuffer, my_output_ibuffer;
257template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
261 const Matrix<InputValue_, Index_>* left,
262 const Matrix<InputValue_, Index_>* right,
263 const Operation_& operation,
265 MaybeOracle<oracle_, Index_> oracle,
269 my_operation(operation),
271 my_oracle(oracle, my_operation, row),
272 my_block_start(block_start),
273 my_block_length(block_length)
275 opt.sparse_extract_value =
true;
276 opt.sparse_extract_index =
true;
277 opt.sparse_ordered_index =
true;
278 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, my_block_start, my_block_length, opt);
279 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), my_block_start, my_block_length, opt);
281 my_left_vbuffer.resize(my_block_length);
282 my_right_vbuffer.resize(my_block_length);
283 my_output_vbuffer.resize(my_block_length);
284 my_left_ibuffer.resize(my_block_length);
285 my_right_ibuffer.resize(my_block_length);
286 my_output_ibuffer.resize(my_block_length);
289 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
290 auto lres = my_left_ext->fetch(i, my_left_vbuffer.data(), my_left_ibuffer.data());
291 auto rres = my_right_ext->fetch(i, my_right_vbuffer.data(), my_right_ibuffer.data());
293 i = my_oracle.get(i);
294 auto num = my_operation.sparse(my_row, i, lres, rres, my_output_vbuffer.data(), my_output_ibuffer.data(),
true,
true);
298 if (num < my_block_length) {
299 std::fill_n(buffer, my_block_length, my_operation.template fill<OutputValue_, InputValue_>(my_row, i));
302 for (Index_ j = 0; j < num; ++j) {
303 buffer[my_output_ibuffer[j] - my_block_start] = my_output_vbuffer[j];
309 const Operation_& my_operation;
311 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
312 Index_ my_block_start, my_block_length;
314 std::unique_ptr<SparseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
316 std::vector<InputValue_> my_left_vbuffer, my_right_vbuffer;
317 std::vector<OutputValue_> my_output_vbuffer;
318 std::vector<Index_> my_left_ibuffer, my_right_ibuffer, my_output_ibuffer;
321template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
325 const Matrix<InputValue_, Index_>* left,
326 const Matrix<InputValue_, Index_>* right,
327 const Operation_& operation,
329 MaybeOracle<oracle_, Index_> oracle,
330 VectorPtr<Index_> indices_ptr,
332 my_operation(operation),
334 my_oracle(oracle, my_operation, row),
335 my_extent(indices_ptr->size())
340 const auto& indices = *indices_ptr;
342 my_remapping_offset = indices.front();
343 my_remapping.resize(indices.back() - my_remapping_offset + 1);
345 for (Index_ i = 0; i < my_extent; ++i) {
346 my_remapping[indices[i] - my_remapping_offset] = i;
350 opt.sparse_extract_value =
true;
351 opt.sparse_extract_index =
true;
352 opt.sparse_ordered_index =
true;
353 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, indices_ptr, opt);
354 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), std::move(indices_ptr), opt);
356 my_left_vbuffer.resize(my_extent);
357 my_right_vbuffer.resize(my_extent);
358 my_output_vbuffer.resize(my_extent);
359 my_left_ibuffer.resize(my_extent);
360 my_right_ibuffer.resize(my_extent);
361 my_output_ibuffer.resize(my_extent);
364 const OutputValue_* fetch(Index_ i, OutputValue_* buffer) {
365 auto lres = my_left_ext->fetch(i, my_left_vbuffer.data(), my_left_ibuffer.data());
366 auto rres = my_right_ext->fetch(i, my_right_vbuffer.data(), my_right_ibuffer.data());
368 i = my_oracle.get(i);
369 auto num = my_operation.sparse(my_row, i, lres, rres, my_output_vbuffer.data(), my_output_ibuffer.data(),
true,
true);
373 if (num < my_extent) {
374 std::fill_n(buffer, my_extent, my_operation.template fill<OutputValue_, InputValue_>(my_row, i));
377 for (Index_ j = 0; j < num; ++j) {
378 buffer[my_remapping[my_output_ibuffer[j] - my_remapping_offset]] = my_output_vbuffer[j];
384 const Operation_& my_operation;
386 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
389 std::vector<Index_> my_remapping;
390 Index_ my_remapping_offset = 0;
392 std::unique_ptr<SparseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
394 std::vector<InputValue_> my_left_vbuffer, my_right_vbuffer;
395 std::vector<OutputValue_> my_output_vbuffer;
396 std::vector<Index_> my_left_ibuffer, my_right_ibuffer, my_output_ibuffer;
403template<
bool oracle_,
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
407 const Matrix<InputValue_, Index_>* left,
408 const Matrix<InputValue_, Index_>* right,
409 const Operation_& operation,
411 MaybeOracle<oracle_, Index_> oracle,
413 my_operation(operation),
415 my_oracle(oracle, my_operation, row)
417 initialize(my_row ? left->ncol() : left->nrow(), opt);
418 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, opt);
419 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), opt);
423 const Matrix<InputValue_, Index_>* left,
424 const Matrix<InputValue_, Index_>* right,
425 const Operation_& operation,
427 MaybeOracle<oracle_, Index_> oracle,
431 my_operation(operation),
433 my_oracle(oracle, my_operation, row)
435 initialize(block_length, opt);
436 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, block_start, block_length, opt);
437 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), block_start, block_length, opt);
441 const Matrix<InputValue_, Index_>* left,
442 const Matrix<InputValue_, Index_>* right,
443 const Operation_& operation,
445 MaybeOracle<oracle_, Index_> oracle,
446 VectorPtr<Index_> indices_ptr,
448 my_operation(operation),
450 my_oracle(oracle, my_operation, row)
452 initialize(indices_ptr->size(), opt);
453 my_left_ext = new_extractor<true, oracle_>(left, my_row, oracle, indices_ptr, opt);
454 my_right_ext = new_extractor<true, oracle_>(right, my_row, std::move(oracle), std::move(indices_ptr), opt);
458 void initialize(
size_t extent, Options& opt) {
459 my_report_value = opt.sparse_extract_value;
460 my_report_index = opt.sparse_extract_index;
462 my_left_ibuffer.resize(extent);
463 my_right_ibuffer.resize(extent);
464 if (my_report_value) {
465 my_left_vbuffer.resize(extent);
466 my_right_vbuffer.resize(extent);
469 opt.sparse_ordered_index =
true;
470 opt.sparse_extract_index =
true;
474 SparseRange<OutputValue_, Index_> fetch(Index_ i, OutputValue_* value_buffer, Index_* index_buffer) {
475 auto left_ranges = my_left_ext->fetch(i, my_left_vbuffer.data(), my_left_ibuffer.data());
476 auto right_ranges = my_right_ext->fetch(i, my_right_vbuffer.data(), my_right_ibuffer.data());
477 auto num = my_operation.sparse(
490 (my_report_value ? value_buffer: NULL),
491 (my_report_index ? index_buffer: NULL)
496 const Operation_& my_operation;
498 DelayedIsometricOperation_internal::MaybeOracleDepends<oracle_, Operation_, Index_> my_oracle;
500 std::unique_ptr<SparseExtractor<oracle_, InputValue_, Index_> > my_left_ext, my_right_ext;
501 std::vector<InputValue_> my_left_vbuffer, my_right_vbuffer;
502 std::vector<Index_> my_left_ibuffer, my_right_ibuffer;
504 bool my_report_value =
false;
505 bool my_report_index =
false;
531template<
typename OutputValue_,
typename InputValue_,
typename Index_,
class Operation_>
542 if (my_left->nrow() != my_right->nrow() || my_left->ncol() != my_right->ncol()) {
543 throw std::runtime_error(
"shape of the left and right matrices should be the same");
546 my_prefer_rows_proportion = (my_left->prefer_rows_proportion() + my_right->prefer_rows_proportion()) / 2;
548 if constexpr(!Operation_::is_basic) {
549 if (my_operation.is_sparse()) {
550 my_is_sparse = my_left->is_sparse() && my_right->is_sparse();
553 my_is_sparse_proportion = (my_left->is_sparse_proportion() + my_right->is_sparse_proportion())/2;
559 std::shared_ptr<const Matrix<InputValue_, Index_> > my_left, my_right;
562 double my_prefer_rows_proportion;
563 double my_is_sparse_proportion = 0;
564 bool my_is_sparse =
false;
568 return my_left->nrow();
572 return my_left->ncol();
580 return my_is_sparse_proportion;
584 return my_prefer_rows_proportion > 0.5;
588 return my_prefer_rows_proportion;
592 return my_left->uses_oracle(
row) || my_right->uses_oracle(
row);
603 template<
bool oracle_>
605 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseSimpleFull<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
615 template<
bool oracle_>
617 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseSimpleBlock<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
629 template<
bool oracle_>
631 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseSimpleIndex<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
642 template<
bool oracle_>
644 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseExpandedFull<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
654 template<
bool oracle_>
656 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseExpandedBlock<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
668 template<
bool oracle_>
670 return std::make_unique<DelayedBinaryIsometricOperation_internal::DenseExpandedIndex<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
682 std::unique_ptr<DenseExtractor<oracle_, OutputValue_, Index_> > dense_internal(
bool row,
Args_&& ...
args)
const {
683 if constexpr(!Operation_::is_basic) {
684 if (my_left->is_sparse() && my_right->is_sparse()) {
685 if (DelayedIsometricOperation_internal::can_dense_expand(my_operation,
row)) {
695 std::unique_ptr<MyopicDenseExtractor<OutputValue_, Index_> >
dense(
bool row,
const Options&
opt)
const {
711 template<
bool oracle_>
713 if constexpr(!Operation_::is_basic) {
715 return std::make_unique<DelayedBinaryIsometricOperation_internal::Sparse<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
726 return std::make_unique<FullSparsifiedWrapper<oracle_, OutputValue_, Index_> >(
728 row ? my_left->ncol() : my_left->nrow(),
733 template<
bool oracle_>
735 if constexpr(!Operation_::is_basic) {
737 return std::make_unique<DelayedBinaryIsometricOperation_internal::Sparse<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
750 return std::make_unique<BlockSparsifiedWrapper<oracle_, OutputValue_, Index_> >(
758 template<
bool oracle_>
760 if constexpr(!Operation_::is_basic) {
762 return std::make_unique<DelayedBinaryIsometricOperation_internal::Sparse<oracle_, OutputValue_, InputValue_, Index_, Operation_> >(
774 return std::make_unique<IndexSparsifiedWrapper<oracle_, OutputValue_, Index_> >(
782 std::unique_ptr<MyopicSparseExtractor<OutputValue_, Index_> >
sparse(
bool row,
const Options&
opt)
const {
841template<
typename OutputValue_ =
double,
typename InputValue_,
typename Index_,
class Operation_>
843 typedef typename std::remove_reference<Operation_>::type
Operation2_;
851template<
typename OutputValue_ =
double,
typename InputValue_,
typename Index_,
class Operation_>
853 typedef typename std::remove_reference<Operation_>::type
Operation2_;
Delayed isometric operations on two matrices.
Definition DelayedBinaryIsometricOperation.hpp:532
bool prefer_rows() const
Definition DelayedBinaryIsometricOperation.hpp:583
std::unique_ptr< MyopicDenseExtractor< OutputValue_, Index_ > > dense(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:703
std::unique_ptr< OracularSparseExtractor< OutputValue_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:814
std::unique_ptr< MyopicDenseExtractor< OutputValue_, Index_ > > dense(bool row, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:695
std::unique_ptr< OracularDenseExtractor< OutputValue_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:798
std::unique_ptr< MyopicSparseExtractor< OutputValue_, Index_ > > sparse(bool row, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:782
bool uses_oracle(bool row) const
Definition DelayedBinaryIsometricOperation.hpp:591
std::unique_ptr< OracularDenseExtractor< OutputValue_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:806
bool is_sparse() const
Definition DelayedBinaryIsometricOperation.hpp:575
double is_sparse_proportion() const
Definition DelayedBinaryIsometricOperation.hpp:579
std::unique_ptr< MyopicSparseExtractor< OutputValue_, Index_ > > sparse(bool row, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:786
Index_ ncol() const
Definition DelayedBinaryIsometricOperation.hpp:571
std::unique_ptr< OracularDenseExtractor< OutputValue_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:802
std::unique_ptr< OracularSparseExtractor< OutputValue_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:818
std::unique_ptr< MyopicSparseExtractor< OutputValue_, Index_ > > sparse(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:790
std::unique_ptr< MyopicDenseExtractor< OutputValue_, Index_ > > dense(bool row, Index_ block_start, Index_ block_length, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:699
DelayedBinaryIsometricOperation(std::shared_ptr< const Matrix< InputValue_, Index_ > > left, std::shared_ptr< const Matrix< InputValue_, Index_ > > right, Operation_ operation)
Definition DelayedBinaryIsometricOperation.hpp:539
Index_ nrow() const
Definition DelayedBinaryIsometricOperation.hpp:567
double prefer_rows_proportion() const
Definition DelayedBinaryIsometricOperation.hpp:587
std::unique_ptr< OracularSparseExtractor< OutputValue_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
Definition DelayedBinaryIsometricOperation.hpp:822
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
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
typename std::conditional< oracle_, std::shared_ptr< const Oracle< Index_ > >, bool >::type MaybeOracle
Definition new_extractor.hpp:20
Value_ * copy_n(const Value_ *input, Size_ n, Value_ *output)
Definition copy.hpp:25
std::shared_ptr< const std::vector< Index_ > > VectorPtr
Definition Matrix.hpp:26
std::shared_ptr< Matrix< OutputValue_, Index_ > > make_DelayedBinaryIsometricOperation(std::shared_ptr< const Matrix< InputValue_, Index_ > > left, std::shared_ptr< const Matrix< InputValue_, Index_ > > right, Operation_ op)
Definition DelayedBinaryIsometricOperation.hpp:842
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