|
tatami
C++ API for different matrix representations
|
Extract an element of the target dimension in sparse form with an oracle. More...
#include <Extractor.hpp>

Public Member Functions | |
| SparseRange< Value_, Index_ > | next (Value_ *value_buffer, Index_ *index_buffer) |
| virtual SparseRange< Value_, Index_ > | fetch (Index_ i, Value_ *value_buffer, Index_ *index_buffer)=0 |
Extract an element of the target dimension in sparse form with an oracle.
| Value_ | Data value type, should be numeric. |
| Index_ | Row/column index type, should be integer. |
|
inline |
| [out] | value_buffer | Pointer to an array with enough space for at least N values, where N is defined as described for MyopicDenseExtractor::fetch(). |
| [out] | index_buffer | Pointer to an array with enough space for at least N indices, where N is defined as described for MyopicDenseExtractor::fetch(). |
SparseRange object describing the contents of the i-th dimension element.Options::sparse_extract_value = false during construction of this instance, value_buffer is ignored and SparseRange::value is set to NULL in the output.Options::sparse_extract_value = true and SparseRange::value is the same as value_buffer, this means that value_buffer has been filled with the values of the structural non-zero elements of the i-th dimension element.Options::sparse_extract_value = true and SparseRange::value is not the same as value_buffer, it should refer to another array of length SparseRange::number. This array should be valid for the lifetime of the Matrix object used to construct this MyopicSparseExtractor. Similarly, the contents should not change for the lifetime of the Matrix. In this situation, no guarantees are provided for the contents of value_buffer.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.Options::sparse_extract_index = true and SparseRange::index is the same as index_buffer, this means that index_buffer has been filled with the indices of the structural non-zero elements of the i-th dimension element.Options::sparse_extract_index = true and SparseRange::index is not the same as index_buffer, it should refer to another array of length SparseRange::number. This array should be valid for the lifetime of the Matrix object used to construct this MyopicSparseExtractor. Similarly, the contents should not change for the lifetime of the Matrix. In this situation, no guarantees are provided for the contents of index_buffer.
|
pure virtual |
This method is intended for subclass developers only. It has the same signature as MyopicSparseExtractor::fetch(), which makes it easier to define MyopicSparseExtractor and OracularSparseExtractor subclasses from a single template class. Implementations of this method are expected to ignore i. Most users should just use next() instead.
| i | Ignored, only provided for consistency with MyopicSparseExtractor::fetch(). | |
| [out] | value_buffer | Pointer to an array with enough space for at least N values, where N is defined as described for MyopicDenseExtractor::fetch(). |
| [out] | index_buffer | Pointer to an array with enough space for at least N indices, where N is defined as described for MyopicDenseExtractor::fetch(). |
SparseRange object describing the contents of the next dimension element, see next() for details. Implemented in tatami::PseudoOracularSparseExtractor< Value_, Index_ >.