tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
tatami::Matrix< Value_, Index_ > Class Template Referenceabstract

Virtual class for a matrix. More...

#include <Matrix.hpp>

Inheritance diagram for tatami::Matrix< Value_, Index_ >:

Public Types

typedef Value_ value_type
 
typedef Index_ index_type
 

Public Member Functions

virtual Index_ nrow () const =0
 
virtual Index_ ncol () const =0
 
virtual bool is_sparse () const =0
 
virtual double is_sparse_proportion () const =0
 
virtual bool prefer_rows () const =0
 
virtual double prefer_rows_proportion () const =0
 
virtual bool uses_oracle (bool row) const =0
 
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense (bool row, 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 std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense (bool row, VectorPtr< Index_ > indices_ptr, const Options &opt) const =0
 
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse (bool row, const Options &opt) 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, 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 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< OracularSparseExtractor< Value_, Index_ > > sparse (bool row, std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) 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
 

Detailed Description

template<typename Value_, typename Index_>
class tatami::Matrix< Value_, Index_ >

Virtual class for a matrix.

Template Parameters
ValueData value type, should be numeric.
IndexRow/column index type, should be integer.

Interface for a matrix in the tatami library. This declares methods to iterate through the matrix by row or column, extracting data in either dense or sparse form. Check out DenseMatrix and CompressedSparseMatrix for examples of concrete subclasses.

To access the matrix data, the Matrix methods first return an instance of an extractor class like MyopicDenseExtractor, which can then be used to retrieve the matrix contents. Creation of the extractor depends on a few parameters:

  • Choice of the "target" dimension. The "target" dimension is defined as the one that is iterated over/indexed into, while the "non-target" dimension is the other dimension. For example, if we were iterating row-wise through a matrix, the rows would constitute the target dimension, while the columns would be the non-target dimension. An element of the target dimension is obtained by indexing into that dimension, e.g., if the rows are the target dimension, then any particular row is an element of the target dimension.
  • Whether to restrict the non-target dimension (see tatami::DimensionSelectionType). We can choose to extract the full extent of the non-target dimension, a contiguous block, or an indexed subset. For example, if we were iterating row-wise through a matrix, we might only be interested in a subset of columns.
  • Whether the order of accesses on the target dimension are known. If so, we can potentially improve efficiency by supplying an Oracle during extractor construction. For example, if we know we will iterate through the matrix by consecutive rows, we could supply a ConsecutiveOracle to allow Matrix implementations to optimize for this access pattern.
  • Whether to obtain the contents for a target dimension element in dense or sparse form. The dense form is simply a contiguous 1-dimensional array of matrix Value_s. The sparse form is a SparseRange describing the structural non-zeros for that dimension element.

Matrix subclasses should describe whether they are dense/sparse and if they prefer row or column access. This allows users to choose the best method of extracting data from the matrix.

Member Typedef Documentation

◆ value_type

template<typename Value_ , typename Index_ >
Value_ tatami::Matrix< Value_, Index_ >::value_type

Type of data to be returned by getters.

◆ index_type

template<typename Value_ , typename Index_ >
Index_ tatami::Matrix< Value_, Index_ >::index_type

Type of index to be returned by the sparse getters.

Member Function Documentation

◆ nrow()

template<typename Value_ , typename Index_ >
virtual Index_ tatami::Matrix< Value_, Index_ >::nrow ( ) const
pure virtual
Returns
Number of rows.

It is expected that the number of rows can be represented by a std::size_t without overflow, even if Index_ is of a larger size. This is implied by the fact that MyopicDenseExtractor::fetch() and friends accept a pointer for their buffer arguments; the length of the array referenced by these pointers (possibly equal to the number of rows) must fit in a std::size_t.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ ncol()

template<typename Value_ , typename Index_ >
virtual Index_ tatami::Matrix< Value_, Index_ >::ncol ( ) const
pure virtual
Returns
Number of columns.

It is expected that the number of columns can be represented by a std::size_t without overflow, even if Index_ is of a larger size. This is implied by the fact that MyopicDenseExtractor::fetch() and friends accept a pointer for their buffer arguments; the length of the array referenced by these pointers (possibly equal to the number of rows) must fit in a std::size_t.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ is_sparse()

template<typename Value_ , typename Index_ >
virtual bool tatami::Matrix< Value_, Index_ >::is_sparse ( ) const
pure virtual

◆ is_sparse_proportion()

template<typename Value_ , typename Index_ >
virtual double tatami::Matrix< Value_, Index_ >::is_sparse_proportion ( ) const
pure virtual
Returns
Approximate proportion of the matrix that is sparse.

This is defined as the proportion of matrix elements that lie within sparse submatrices. It is intended for use in Matrix representations that consist of combinations of multiple submatrices (e.g., DelayedBind), allowing them to derive a suitable value for is_sparse() based on whether most of its submatrices are sparse. (A more granular approach would be to report the density of structural non-zero elements, but this may not be known by all representations at construction time.)

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ prefer_rows()

template<typename Value_ , typename Index_ >
virtual bool tatami::Matrix< Value_, Index_ >::prefer_rows ( ) const
pure virtual

◆ prefer_rows_proportion()

template<typename Value_ , typename Index_ >
virtual double tatami::Matrix< Value_, Index_ >::prefer_rows_proportion ( ) const
pure virtual

The return value of this method is the (approximate) proportion of matrix elements that lie within submatrices that prefer row-level access. It is useful for determining the return value of prefer_rows() in combined matrices consisting of both row- and column-preferred submatrices. In such cases, the net preference can be determined based on the combined size of the submatrices for each preference. (A more granular approach would be to report the iteration cost on each dimension, but this is difficult to estimate.)

Returns
Approximate proportion of the matrix that prefers row-level access.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ uses_oracle()

template<typename Value_ , typename Index_ >
virtual bool tatami::Matrix< Value_, Index_ >::uses_oracle ( bool row) const
pure virtual

The return value of this method indicates whether callers should construct an oracle for use in ExtractorBase::set_oracle(). If false, callers should not bother to pass an oracle as it will be ignored.

Parameters
rowRow access if true, column access otherwise.
Returns
Whether this matrix's tatami::Extractor classes make use of oracle predictions for row (if row = true) or column access (otherwise).

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ dense() [1/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
const Options & opt ) const
pure virtual

◆ dense() [2/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
Index_ block_start,
Index_ block_length,
const Options & opt ) const
pure virtual

Create an extractor that retrieves a contiguous block of the non-target dimension in dense form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
block_startIndex of the column (if row = true) or row (otherwise) at the start of the block. This should be non-negative and less than the respective number of columns/rows. (For a matrix with zero columns/rows, block_start may also be zero.)
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block. This should be non-negative and block_start + block_length should be no greater than the number of columns/rows.
optOptions for extraction.
Returns
Object for extracting a contiguous block from each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, and tatami::ForcedDense< Value_, Index_ >.

◆ dense() [3/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
VectorPtr< Index_ > indices_ptr,
const Options & opt ) const
pure virtual

Create an extractor that retrieves an indexed subset of the non-target dimension in dense form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
indices_ptrPointer to a vector of sorted and unique column indices (if row = true) or row indices (otherwise). Each entry should be non-negative and less than the respective number of columns/rows. This should be non-NULL.
optOptions for extraction.
Returns
Object for extracting an indexed subset from each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, and tatami::ForcedDense< Value_, Index_ >.

◆ sparse() [1/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
const Options & opt ) const
pure virtual

◆ sparse() [2/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
Index_ block_start,
Index_ block_length,
const Options & opt ) const
pure virtual

Create an extractor that retrieves a contiguous block of the non-target dimension in sparse form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
block_startIndex of the column (if row = true) or row (otherwise) at the start of the block. This should be non-negative and less than the respective number of columns/rows. (For a matrix with zero columns/rows, block_start may also be zero.)
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block. This should be non-negative and block_start + block_length should be no greater than the number of columns/rows.
optOptions for extraction.
Returns
Object for extracting a contiguous block from each row (if row = true) or column (otherwise) in sparse form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, and tatami::ForcedDense< Value_, Index_ >.

◆ sparse() [3/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
VectorPtr< Index_ > indices_ptr,
const Options & opt ) const
pure virtual

Create an extractor that retrieves an indexed subset of the non-target dimension in sparse form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
indices_ptrPointer to a vector of sorted and unique column indices (if row = true) or row indices (otherwise). Each entry should be non-negative and less than the respective number of columns/rows. This should be non-NULL.
optOptions for extraction.
Returns
Object for extracting an indexed subset from each row (if row = true) or column (otherwise) in sparse form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, and tatami::ForcedDense< Value_, Index_ >.

◆ dense() [4/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves the full extent of the non-target dimension in dense form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
optOptions for extraction.
Returns
Object for extracting each row (if row = true) or columns (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ dense() [5/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
Index_ block_start,
Index_ block_length,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves a contiguous block of the non-target dimension in dense form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
block_startIndex of the column (if row = true) or row (otherwise) at the start of the block. This should be non-negative and less than the respective number of columns/rows. (For a matrix with zero columns/rows, block_start may also be zero.)
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block. This should be non-negative and block_start + block_length should be no greater than the number of columns/rows.
optOptions for extraction.
Returns
Object for extracting a contiguous block from each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ dense() [6/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::dense ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
VectorPtr< Index_ > indices_ptr,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves an indexed subset of the non-target dimension in dense form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
indices_ptrPointer to a vector of sorted and unique column indices (if row = true) or row indices (otherwise). Each entry should be non-negative and less than the respective number of columns/rows. This should not be NULL.
optOptions for extraction.
Returns
Object for extracting an indexed subset from each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ sparse() [4/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves the full extent of the non-target dimension in sparse form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
optOptions for extraction.
Returns
Object for extracting each row (if row = true) or columns (otherwise) in sparse form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ sparse() [5/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
Index_ block_start,
Index_ block_length,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves a contiguous block of the non-target dimension in sparse form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
block_startIndex of the column (if row = true) or row (otherwise) at the start of the block. This should be non-negative and less than the respective number of columns/rows. (For a matrix with zero columns/rows, block_start may also be zero.)
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block. This should be non-negative and block_start + block_length should be no greater than the number of columns/rows.
optOptions for extraction.
Returns
Object for extracting a contiguous block from each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.

◆ sparse() [6/6]

template<typename Value_ , typename Index_ >
virtual std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > tatami::Matrix< Value_, Index_ >::sparse ( bool row,
std::shared_ptr< const Oracle< Index_ > > oracle,
VectorPtr< Index_ > indices_ptr,
const Options & opt ) const
pure virtual

Create an oracle-aware extractor that retrieves an indexed subset of the non-target dimension in sparse form.

Parameters
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oracleAn oracle supplying predictions of the next requested row (if row = true) or column (otherwise).
indices_ptrPointer to a vector of sorted and unique column indices (if row = true) or row indices (otherwise). Each entry should be non-negative and less than the respective number of columns/rows. This should not be NULL.
optOptions for extraction.
Returns
Object for extracting an indexed subset from each row (if row = true) or column (otherwise) in sparse form. This should not outlive the parent Matrix from which it was created.

Implemented in tatami::CompressedSparseMatrix< Value_, Index_, ValueStorage_, IndexStorage_, PointerStorage_ >, tatami::CompressedSparseMatrix< Value_, Index_, std::vector< Value_ >, std::vector< Index_ >, std::vector< std::size_t > >, tatami::ConstantMatrix< Value_, Index_ >, tatami::DelayedBinaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DelayedBind< Value_, Index_ >, tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >, tatami::DelayedSubset< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetBlock< Value_, Index_ >, tatami::DelayedSubsetSorted< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetSortedUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedSubsetUnique< Value_, Index_, SubsetStorage_ >, tatami::DelayedTranspose< Value_, Index_ >, tatami::DelayedUnaryIsometricOperation< OutputValue_, InputValue_, Index_, Helper_ >, tatami::DenseMatrix< Value_, Index_, Storage_ >, tatami::DenseMatrix< Value_, Index_, std::vector< Value_ > >, tatami::ForcedDense< Value_, Index_ >, tatami::FragmentedSparseMatrix< Value_, Index_, ValueVectorStorage_, IndexVectorStorage_ >, and tatami::FragmentedSparseMatrix< Value_, Index_, std::vector< std::vector< Value_ > >, std::vector< std::vector< Index_ > > >.


The documentation for this class was generated from the following file: