tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ > Class Template Reference

Recast a Matrix to a different interface type. More...

#include <DelayedCast.hpp>

Inheritance diagram for tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >:
Inheritance graph
[legend]
Collaboration diagram for tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >:
Collaboration graph
[legend]

Public Member Functions

 DelayedCast (std::shared_ptr< const Matrix< ValueIn_, IndexIn_ > > matrix)
 
IndexOut_ nrow () const
 
IndexOut_ ncol () const
 
bool is_sparse () const
 
double is_sparse_proportion () const
 
bool prefer_rows () const
 
double prefer_rows_proportion () const
 
bool uses_oracle (bool row) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, VectorPtr< IndexOut_ > indices_my_matrix, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, VectorPtr< IndexOut_ > indices_my_matrix, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_my_matrix, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse (bool row, std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_my_matrix, const Options &opt) const
 
- Public Member Functions inherited from tatami::Matrix< ValueOut_, IndexOut_ >
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row () const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::vector< IndexOut_ > indices) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column () const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::vector< IndexOut_ > indices) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > dense_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row () const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::vector< IndexOut_ > indices) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_row (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column () const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::vector< IndexOut_ > indices) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, IndexOut_ block_start, IndexOut_ block_length) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, VectorPtr< IndexOut_ > indices_ptr) const
 
std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > sparse_column (std::shared_ptr< const Oracle< IndexOut_ > > oracle, std::vector< IndexOut_ > indices) const
 

Additional Inherited Members

- Public Types inherited from tatami::Matrix< ValueOut_, IndexOut_ >
typedef ValueOut_ value_type
 
typedef IndexOut_ index_type
 

Detailed Description

template<typename ValueOut_, typename IndexOut_, typename ValueIn_, typename IndexIn_>
class tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >

Recast a Matrix to a different interface type.

This performs a delayed cast from one interface type to another. It is useful as a compatibility layer between functions that require Matrix objects of different types. Casting is achieved by extracting the requested row/column from the input Matrix and transforming it to the output types. Note that this is only done per row/column - the entirety of the original matrix is not copied to the new type.

Template Parameters
ValueOut_Data type to cast to.
IndexOut_Index type to cast to.
ValueIn_Data type to cast from.
IndexIn_Index type to cast from.

Constructor & Destructor Documentation

◆ DelayedCast()

Parameters
matrixPointer to the Matrix instance to cast from.

Member Function Documentation

◆ nrow()

Returns
Number of rows.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ ncol()

Returns
Number of columns.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ is_sparse()

Returns
Boolean indicating whether this matrix is sparse.

This can be used to choose between dense and sparse outputs.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ is_sparse_proportion()

double tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::is_sparse_proportion ( ) const
inlinevirtual
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.)

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ prefer_rows()

Returns
The preferred dimension for extracting values. If true, row-wise extraction is preferred; if false, column-wise extraction is preferred.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ prefer_rows_proportion()

double tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::prefer_rows_proportion ( ) const
inlinevirtual
Returns
Approximate proportion of the matrix that prefers row-level access.

This is defined as the 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.)

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ uses_oracle()

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).

The output 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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [1/6]

Create an 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.
optOptions for extraction.
Returns
Object for extracting each row (if row = true) or column (otherwise) in dense form. This should not outlive the parent Matrix from which it was created.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [2/6]

std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::dense ( bool  row,
IndexOut_  block_start,
IndexOut_  block_length,
const Options opt 
) const
inlinevirtual

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.
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block.
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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [3/6]

std::unique_ptr< MyopicDenseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::dense ( bool  row,
VectorPtr< IndexOut_ indices_ptr,
const Options opt 
) const
inlinevirtual

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). 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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [1/6]

Create an 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.
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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [2/6]

std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::sparse ( bool  row,
IndexOut_  block_start,
IndexOut_  block_length,
const Options opt 
) const
inlinevirtual

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.
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block.
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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [3/6]

std::unique_ptr< MyopicSparseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::sparse ( bool  row,
VectorPtr< IndexOut_ indices_ptr,
const Options opt 
) const
inlinevirtual

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). 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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [4/6]

std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::dense ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
const Options opt 
) const
inlinevirtual

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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [5/6]

std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::dense ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
IndexOut_  block_start,
IndexOut_  block_length,
const Options opt 
) const
inlinevirtual

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.
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block.
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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ dense() [6/6]

std::unique_ptr< OracularDenseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::dense ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
VectorPtr< IndexOut_ indices_ptr,
const Options opt 
) const
inlinevirtual

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). 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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [4/6]

std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::sparse ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
const Options opt 
) const
inlinevirtual

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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [5/6]

std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::sparse ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
IndexOut_  block_start,
IndexOut_  block_length,
const Options opt 
) const
inlinevirtual

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.
block_lengthNumber of columns (if row = true) or rows (otherwise) in the block.
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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.

◆ sparse() [6/6]

std::unique_ptr< OracularSparseExtractor< ValueOut_, IndexOut_ > > tatami::DelayedCast< ValueOut_, IndexOut_, ValueIn_, IndexIn_ >::sparse ( bool  row,
std::shared_ptr< const Oracle< IndexOut_ > >  oracle,
VectorPtr< IndexOut_ indices_ptr,
const Options opt 
) const
inlinevirtual

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). 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.

Implements tatami::Matrix< ValueOut_, IndexOut_ >.


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