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

Extract an element of the target dimension in sparse form without an oracle. More...

#include <Extractor.hpp>

Public Member Functions

virtual SparseRange< Value_, Index_fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer)=0
 

Detailed Description

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

Extract an element of the target dimension in sparse form without an oracle.

Template Parameters
Value_Data value type, should be numeric.
Index_Row/column index type, should be integer.

Member Function Documentation

◆ fetch()

virtual SparseRange< Value_, Index_ > tatami::MyopicSparseExtractor< Value_, Index_ >::fetch ( Index_  i,
Value_ value_buffer,
Index_ index_buffer 
)
pure virtual

value_buffer may not necessarily be filled upon extraction if a pointer can be returned to the underlying data store. This be checked by comparing the returned SparseRange::value pointer to value_buffer; if they are the same, value_buffer has been filled with SparseRange::number values. The same applies for index_buffer and the returned SparseRange::index pointer.

If Options::sparse_extract_value was set to false during construction of this instance, value_buffer is ignored and SparseRange::value is set to NULL in the output. Similarly, if Options::sparse_extract_index was set to false during construction of this instance, index_buffer is ignored and SparseRange::index is set to NULL in the output.

Parameters
iIndex of the target dimension element, i.e., the row or column index.
[out]value_bufferPointer to an array with enough space for at least N values, where N is defined as described for MyopicDenseExtractor::fetch().
[out]index_bufferPointer to an array with enough space for at least N indices, where N is defined as described for MyopicDenseExtractor::fetch().
Returns
A SparseRange object describing the contents of the i-th dimension element.

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