tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tatami::BlockSparsifiedWrapper< oracle_, Value_, Index_ > Class Template Reference

Wrap a block dense extractor in the sparse interface. More...

#include <SparsifiedWrapper.hpp>

Inherits SparseExtractor< oracle_, Value_, Index_ >.

Public Member Functions

 BlockSparsifiedWrapper (std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > > dense, Index_ block_start, Index_ block_length, const Options &opt)
 
SparseRange< Value_, Index_fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer)
 

Detailed Description

template<bool oracle_, typename Value_, typename Index_>
class tatami::BlockSparsifiedWrapper< oracle_, Value_, Index_ >

Wrap a block dense extractor in the sparse interface.

This can be used to quickly implement the block sparse extraction methods for a dense Matrix subclass. The dense extraction is performed as usual and every value is treated as a structural non-zero; this wrapper just adds the associated indices to satisfy the sparse extraction interface.

Template Parameters
oracle_Whether an oracle is involved.
Value_Type of the matrix values.
Index_Type of the row/column indices.

Constructor & Destructor Documentation

◆ BlockSparsifiedWrapper()

template<bool oracle_, typename Value_ , typename Index_ >
tatami::BlockSparsifiedWrapper< oracle_, Value_, Index_ >::BlockSparsifiedWrapper ( std::unique_ptr< DenseExtractor< oracle_, Value_, Index_ > >  dense,
Index_  block_start,
Index_  block_length,
const Options opt 
)
inline
Parameters
denseInstance of a dense extractor for a contiguous block of the non-target dimension. If oracle_ = true, this should be an instance of a MyopicDenseExtractor subclass; otherwise it should be an OracularDenseExtractor instance.
block_startStart of the block extracted by dense. Should be the same as that used to construct dense.
block_lengthLength of the block extracted by dense. Should be the same as that used to construct dense.
optOptions for extraction.

Member Function Documentation

◆ fetch()

template<bool oracle_, typename Value_ , typename Index_ >
SparseRange< Value_, Index_ > tatami::BlockSparsifiedWrapper< oracle_, Value_, Index_ >::fetch ( Index_  i,
Value_ value_buffer,
Index_ index_buffer 
)
inline
Parameters
iIndex of the element to extract on the target dimension, ignored if oracle_ = true.
[in,out]value_bufferSee MyopicSparseExtractor::fetch() or OracularSparseExtractor::fetch().
[in,out]index_bufferSee MyopicSparseExtractor::fetch() or OracularSparseExtractor::fetch().
Returns
Sparse output, see MyopicSparseExtractor::fetch() or OracularSparseExtractor::fetch().

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