tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
Matrix.hpp
Go to the documentation of this file.
1#ifndef TATAMI_MATRIX_H
2#define TATAMI_MATRIX_H
3
4#include "Extractor.hpp"
5#include "Options.hpp"
6#include "Oracle.hpp"
7#include <algorithm>
8#include <numeric>
9#include <memory>
10
17namespace tatami {
18
25template<typename Index_>
26using VectorPtr = std::shared_ptr<const std::vector<Index_> >;
27
58template <typename Value_, typename Index_>
59class Matrix {
60public:
64 Matrix() = default;
65 Matrix(const Matrix&) = default;
66 Matrix& operator=(const Matrix&) = default;
67 Matrix(Matrix&&) = default;
68 Matrix& operator=(Matrix&&) = default;
69 virtual ~Matrix() = default;
77 typedef Value_ value_type;
78
82 typedef Index_ index_type;
83
84 /*******************************
85 **** Basic virtual methods ****
86 *******************************/
87public:
95 virtual Index_ nrow() const = 0;
96
104 virtual Index_ ncol() const = 0;
105
111 virtual bool is_sparse() const = 0;
112
116 [[deprecated("use 'is_sparse()' instead")]]
117 bool sparse() const {
118 return is_sparse();
119 }
120
121 [[deprecated("use 'is_sparse_proportion()' instead")]]
122 bool sparse_proportion() const {
123 return is_sparse_proportion();
124 }
137 virtual double is_sparse_proportion() const = 0;
138
143 virtual bool prefer_rows() const = 0;
144
153 virtual double prefer_rows_proportion() const = 0;
154
162 virtual bool uses_oracle(bool row) const = 0;
163
164 /******************************
165 **** Myopic dense methods ****
166 ******************************/
167public:
175 virtual std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense(
176 bool row,
177 const Options& opt
178 ) const = 0;
179
192 virtual std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense(
193 bool row,
194 Index_ block_start,
195 Index_ block_length,
196 const Options& opt
197 ) const = 0;
198
209 virtual std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense(
210 bool row,
211 VectorPtr<Index_> indices_ptr,
212 const Options& opt
213 ) const = 0;
214
218public:
219 [[deprecated("use 'dense()' instead")]]
220 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(const Options& opt) const {
221 return dense(true, opt);
222 }
223
224 [[deprecated("use 'dense()' instead")]]
225 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(Index_ block_start, Index_ block_length, const Options& opt) const {
226 return dense(true, block_start, block_length, opt);
227 }
228
229 [[deprecated("use 'dense()' instead")]]
230 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(VectorPtr<Index_> indices_ptr, const Options& opt) const {
231 return dense(true, std::move(indices_ptr), opt);
232 }
233
234 [[deprecated("use 'dense()' instead")]]
235 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(std::vector<Index_> indices, const Options& opt) const {
236 return dense_row(std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
237 }
238
239 [[deprecated("use 'dense()' instead")]]
240 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(const Options& opt) const {
241 return dense(false, opt);
242 }
243
244 [[deprecated("use 'dense()' instead")]]
245 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(Index_ block_start, Index_ block_length, const Options& opt) const {
246 return dense(false, block_start, block_length, opt);
247 }
248
249 [[deprecated("use 'dense()' instead")]]
250 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(VectorPtr<Index_> indices_ptr, const Options& opt) const {
251 return dense(false, std::move(indices_ptr), opt);
252 }
253
254 [[deprecated("use 'dense()' instead")]]
255 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(std::vector<Index_> indices, const Options& opt) const {
256 return dense_column(std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
257 }
258
259 // ==== Default option overloads ====
260 [[deprecated("use 'dense()' instead")]]
261 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row() const {
262 return dense_row(Options());
263 }
264
265 [[deprecated("use 'dense()' instead")]]
266 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(Index_ block_start, Index_ block_length) const {
267 return dense_row(block_start, block_length, Options());
268 }
269
270 [[deprecated("use 'dense()' instead")]]
271 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(VectorPtr<Index_> indices_ptr) const {
272 return dense_row(std::move(indices_ptr), Options());
273 }
274
275 [[deprecated("use 'dense()' instead")]]
276 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_row(std::vector<Index_> indices) const {
277 return dense_row(std::move(indices), Options());
278 }
279
280 [[deprecated("use 'dense()' instead")]]
281 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column() const {
282 return dense_column(Options());
283 }
284
285 [[deprecated("use 'dense()' instead")]]
286 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(Index_ block_start, Index_ block_length) const {
287 return dense_column(block_start, block_length, Options());
288 }
289
290 [[deprecated("use 'dense()' instead")]]
291 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(VectorPtr<Index_> indices_ptr) const {
292 return dense_column(std::move(indices_ptr), Options());
293 }
294
295 [[deprecated("use 'dense()' instead")]]
296 std::unique_ptr<MyopicDenseExtractor<Value_, Index_> > dense_column(std::vector<Index_> indices) const {
297 return dense_column(std::move(indices), Options());
298 }
303 /******************************
304 **** Myopic sparse access ****
305 ******************************/
306public:
314 virtual std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse(
315 bool row,
316 const Options& opt
317 ) const = 0;
318
331 virtual std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse(
332 bool row,
333 Index_ block_start,
334 Index_ block_length,
335 const Options& opt
336 ) const = 0;
337
348 virtual std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse(
349 bool row,
350 VectorPtr<Index_> indices_ptr,
351 const Options& opt
352 ) const = 0;
353
357public:
358 [[deprecated("use 'sparse()' instead")]]
359 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(const Options& opt) const {
360 return sparse(true, opt);
361 }
362
363 [[deprecated("use 'sparse()' instead")]]
364 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(Index_ block_start, Index_ block_length, const Options& opt) const {
365 return sparse(true, block_start, block_length, opt);
366 }
367
368 [[deprecated("use 'sparse()' instead")]]
369 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(VectorPtr<Index_> indices_ptr, const Options& opt) const {
370 return sparse(true, std::move(indices_ptr), opt);
371 }
372
373 [[deprecated("use 'sparse()' instead")]]
374 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(std::vector<Index_> indices, const Options& opt) const {
375 return sparse_row(std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
376 }
377
378 [[deprecated("use 'sparse()' instead")]]
379 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(const Options& opt) const {
380 return sparse(false, opt);
381 }
382
383 [[deprecated("use 'sparse()' instead")]]
384 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(Index_ block_start, Index_ block_length, const Options& opt) const {
385 return sparse(false, block_start, block_length, opt);
386 }
387
388 [[deprecated("use 'sparse()' instead")]]
389 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(VectorPtr<Index_> indices_ptr, const Options& opt) const {
390 return sparse(false, std::move(indices_ptr), opt);
391 }
392
393 [[deprecated("use 'sparse()' instead")]]
394 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(std::vector<Index_> indices, const Options& opt) const {
395 return sparse_column(std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
396 }
397
398 // ==== Default option overloads ====
399 [[deprecated("use 'sparse()' instead")]]
400 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row() const {
401 return sparse_row(Options());
402 }
403
404 [[deprecated("use 'sparse()' instead")]]
405 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(Index_ block_start, Index_ block_length) const {
406 return sparse_row(block_start, block_length, Options());
407 }
408
409 [[deprecated("use 'sparse()' instead")]]
410 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(VectorPtr<Index_> indices_ptr) const {
411 return sparse_row(std::move(indices_ptr), Options());
412 }
413
414 [[deprecated("use 'sparse()' instead")]]
415 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_row(std::vector<Index_> indices) const {
416 return sparse_row(std::move(indices), Options());
417 }
418
419 [[deprecated("use 'sparse()' instead")]]
420 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column() const {
421 return sparse_column(Options());
422 }
423
424 [[deprecated("use 'sparse()' instead")]]
425 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(Index_ block_start, Index_ block_length) const {
426 return sparse_column(block_start, block_length, Options());
427 }
428
429 [[deprecated("use 'sparse()' instead")]]
430 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(VectorPtr<Index_> indices_ptr) const {
431 return sparse_column(std::move(indices_ptr), Options());
432 }
433
434 [[deprecated("use 'sparse()' instead")]]
435 std::unique_ptr<MyopicSparseExtractor<Value_, Index_> > sparse_column(std::vector<Index_> indices) const {
436 return sparse_column(std::move(indices), Options());
437 }
442 /*******************************
443 **** Oracular dense access ****
444 *******************************/
445public:
454 virtual std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense(
455 bool row,
456 std::shared_ptr<const Oracle<Index_> > oracle,
457 const Options& opt
458 ) const = 0;
459
473 virtual std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense(
474 bool row,
475 std::shared_ptr<const Oracle<Index_> > oracle,
476 Index_ block_start,
477 Index_ block_length,
478 const Options& opt
479 ) const = 0;
480
492 virtual std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense(
493 bool row,
494 std::shared_ptr<const Oracle<Index_> > oracle,
495 VectorPtr<Index_> indices_ptr,
496 const Options& opt
497 ) const = 0;
498
502public:
503 [[deprecated("use 'dense()' instead")]]
504 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, const Options& opt) const {
505 return dense(true, std::move(oracle), opt);
506 }
507
508 [[deprecated("use 'dense()' instead")]]
509 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length, const Options& opt) const {
510 return dense(true, std::move(oracle), block_start, block_length, opt);
511 }
512
513 [[deprecated("use 'dense()' instead")]]
514 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr, const Options& opt) const {
515 return dense(true, std::move(oracle), std::move(indices_ptr), opt);
516 }
517
518 [[deprecated("use 'dense()' instead")]]
519 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices, const Options& opt) const {
520 return dense_row(std::move(oracle), std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
521 }
522
523 [[deprecated("use 'dense()' instead")]]
524 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, const Options& opt) const {
525 return dense(false, std::move(oracle), opt);
526 }
527
528 [[deprecated("use 'dense()' instead")]]
529 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length, const Options& opt) const {
530 return dense(false, std::move(oracle), block_start, block_length, opt);
531 }
532
533 [[deprecated("use 'dense()' instead")]]
534 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr, const Options& opt) const {
535 return dense(false, std::move(oracle), std::move(indices_ptr), opt);
536 }
537
538 [[deprecated("use 'dense()' instead")]]
539 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices, const Options& opt) const {
540 return dense_column(std::move(oracle), std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
541 }
542
543 // ==== Default option overloads ====
544 [[deprecated("use 'dense()' instead")]]
545 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle) const {
546 return dense_row(std::move(oracle), Options());
547 }
548
549 [[deprecated("use 'dense()' instead")]]
550 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length) const {
551 return dense_row(std::move(oracle), block_start, block_length, Options());
552 }
553
554 [[deprecated("use 'dense()' instead")]]
555 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr) const {
556 return dense_row(std::move(oracle), std::move(indices_ptr), Options());
557 }
558
559 [[deprecated("use 'dense()' instead")]]
560 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_row(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices) const {
561 return dense_row(std::move(oracle), std::move(indices), Options());
562 }
563
564 [[deprecated("use 'dense()' instead")]]
565 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle) const {
566 return dense_column(std::move(oracle), Options());
567 }
568
569 [[deprecated("use 'dense()' instead")]]
570 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length) const {
571 return dense_column(std::move(oracle), block_start, block_length, Options());
572 }
573
574 [[deprecated("use 'dense()' instead")]]
575 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr) const {
576 return dense_column(std::move(oracle), std::move(indices_ptr), Options());
577 }
578
579 [[deprecated("use 'dense()' instead")]]
580 std::unique_ptr<OracularDenseExtractor<Value_, Index_> > dense_column(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices) const {
581 return dense_column(std::move(oracle), std::move(indices), Options());
582 }
587 /*********************************
588 **** Oracular sparse methods ****
589 *********************************/
590public:
599 virtual std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse(
600 bool row,
601 std::shared_ptr<const Oracle<Index_> > oracle,
602 const Options& opt
603 ) const = 0;
604
618 virtual std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse(
619 bool row,
620 std::shared_ptr<const Oracle<Index_> > oracle,
621 Index_ block_start,
622 Index_ block_length,
623 const Options& opt
624 ) const = 0;
625
637 virtual std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse(
638 bool row,
639 std::shared_ptr<const Oracle<Index_> > oracle,
640 VectorPtr<Index_> indices_ptr,
641 const Options& opt
642 ) const = 0;
643
647public:
648 [[deprecated("use 'sparse()' instead")]]
649 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, const Options& opt) const {
650 return sparse(true, std::move(oracle), opt);
651 }
652
653 [[deprecated("use 'sparse()' instead")]]
654 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length, const Options& opt) const {
655 return sparse(true, std::move(oracle), block_start, block_length, opt);
656 }
657
658 [[deprecated("use 'sparse()' instead")]]
659 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr, const Options& opt) const {
660 return sparse(true, std::move(oracle), std::move(indices_ptr), opt);
661 }
662
663 [[deprecated("use 'sparse()' instead")]]
664 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices, const Options& opt) const {
665 return sparse_row(std::move(oracle), std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
666 }
667
668 [[deprecated("use 'sparse()' instead")]]
669 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, const Options& opt) const {
670 return sparse(false, std::move(oracle), opt);
671 }
672
673 [[deprecated("use 'sparse()' instead")]]
674 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length, const Options& opt) const {
675 return sparse(false, std::move(oracle), block_start, block_length, opt);
676 }
677
678 [[deprecated("use 'sparse()' instead")]]
679 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr, const Options& opt) const {
680 return sparse(false, std::move(oracle), std::move(indices_ptr), opt);
681 }
682
683 [[deprecated("use 'sparse()' instead")]]
684 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices, const Options& opt) const {
685 return sparse_column(std::move(oracle), std::make_shared<std::vector<Index_> >(std::move(indices)), opt);
686 }
687
688 // ==== Default option overloads ====
689 [[deprecated("use 'sparse()' instead")]]
690 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle) const {
691 return sparse_row(std::move(oracle), Options());
692 }
693
694 [[deprecated("use 'sparse()' instead")]]
695 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length) const {
696 return sparse_row(std::move(oracle), block_start, block_length, Options());
697 }
698
699 [[deprecated("use 'sparse()' instead")]]
700 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr) const {
701 return sparse_row(std::move(oracle), std::move(indices_ptr), Options());
702 }
703
704 [[deprecated("use 'sparse()' instead")]]
705 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_row(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices) const {
706 return sparse_row(std::move(oracle), std::move(indices), Options());
707 }
708
709 [[deprecated("use 'sparse()' instead")]]
710 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle) const {
711 return sparse_column(std::move(oracle), Options());
712 }
713
714 [[deprecated("use 'sparse()' instead")]]
715 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, Index_ block_start, Index_ block_length) const {
716 return sparse_column(std::move(oracle), block_start, block_length, Options());
717 }
718
719 [[deprecated("use 'sparse()' instead")]]
720 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, VectorPtr<Index_> indices_ptr) const {
721 return sparse_column(std::move(oracle), std::move(indices_ptr), Options());
722 }
723
724 [[deprecated("use 'sparse()' instead")]]
725 std::unique_ptr<OracularSparseExtractor<Value_, Index_> > sparse_column(std::shared_ptr<const Oracle<Index_> > oracle, std::vector<Index_> indices) const {
726 return sparse_column(std::move(oracle), std::move(indices), Options());
727 }
731};
732
737
738}
739
740#endif
Virtual classes for extracting matrix data.
Options for data access.
Oracle for data access.
Virtual class for a matrix.
Definition Matrix.hpp:59
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const =0
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, const Options &opt) const =0
virtual Index_ ncol() const =0
virtual double prefer_rows_proportion() const =0
Value_ value_type
Definition Matrix.hpp:77
virtual 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 =0
virtual std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const =0
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense(bool row, Index_ block_start, Index_ block_length, const Options &opt) const =0
virtual Index_ nrow() const =0
virtual std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const =0
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const =0
virtual std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const =0
virtual bool uses_oracle(bool row) const =0
virtual bool prefer_rows() const =0
Index_ index_type
Definition Matrix.hpp:82
virtual double is_sparse_proportion() const =0
virtual 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 =0
virtual std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse(bool row, std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const =0
virtual bool is_sparse() const =0
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, Index_ block_start, Index_ block_length, const Options &opt) const =0
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, const Options &opt) const =0
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