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

Extract an element of the target dimension in dense form with an oracle. More...

#include <Extractor.hpp>

Inheritance diagram for tatami::OracularDenseExtractor< Value_, Index_ >:
Inheritance graph
[legend]

Public Member Functions

const Value_fetch (Value_ *buffer)
 
virtual const Value_fetch (Index_ i, Value_ *buffer)=0
 

Detailed Description

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

Extract an element of the target dimension in dense form with an oracle.

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

Member Function Documentation

◆ fetch() [1/2]

const Value_ * tatami::OracularDenseExtractor< Value_, Index_ >::fetch ( Value_ buffer)
inline

buffer may not necessarily be filled upon extraction if a pointer can be returned to the underlying data store. This can be checked by comparing the returned pointer to buffer; if they are the same, buffer has been filled.

Parameters
[out]bufferPointer to an array of length no less than N, where N is defined as described for MyopicDenseExtractor::fetch().
Returns
Pointer to an array containing the contents of the next element of the target dimension, as predicted by the Oracle used to construct this instance. This is guaranteed to have N values.

◆ fetch() [2/2]

virtual const Value_ * tatami::OracularDenseExtractor< Value_, Index_ >::fetch ( Index_  i,
Value_ buffer 
)
pure virtual

This overload is intended for developers only. It introduces the i argument so that the signature is the same as that of MyopicDenseExtractor::fetch(). This makes it easier to define MyopicDenseExtractor and OracularDenseExtractor subclasses from a single template, avoiding code duplication that would otherwise occur when defining methods with and without i. Of course, implementations are expected to ignore i in oracle-aware extraction.

Other than the extra i argument, all other behaviors of the two overloads are the same. To avoid confusion, most users should just use the fetch() overload that does not accept i, given that the value of i is never actually used.

Parameters
iIgnored, only provided for consistency with MyopicDenseExtractor::fetch(),
[out]bufferPointer to an array of length no less than N, where N is defined as described for MyopicDenseExtractor::fetch().
Returns
Pointer to an array containing the contents of the next dimension element, as predicted by the Oracle used to construct this instance. This is guaranteed to have N values.

Implemented in tatami::PseudoOracularDenseExtractor< Value_, Index_ >.


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