|
tatami
C++ API for different matrix representations
|
A range of a sparse vector. More...
#include <SparseRange.hpp>
Public Member Functions | |
| SparseRange (Index_ number, const Value_ *value=NULL, const Index_ *index=NULL) | |
| SparseRange ()=default | |
Public Attributes | |
| Index_ | number = 0 |
| const Value_ * | value = NULL |
| const Index_ * | index = NULL |
A range of a sparse vector.
This class defines a range along a sparse vector. It records the number of structural "non-zero" elements within this range, and contains pointers to their values and indices.
When a SparseRange is created by methods like MyopicSparseExtractor::fetch(), each of its indices refers to a position on the non-target dimension of the original Matrix. For example, when iterating over the rows, the indices would correspond to the columns.
Note that the elements in value are not guaranteed to be non-zero. If zeroes are explicitly initialized in the underlying structure, they will be reported here. However, one can safely assume that all indices not reported in index have values of zero.
| Value_ | Data value type, should be numeric. |
| Index_ | Row/column index type, should be integer. |
|
inline |
| number | Number of structural non-zero values. |
| value | Pointer to the values. This should have at least number addressible elements. |
| index | Pointer to the indices. This should have at least number addressible elements. |
|
default |
Default constructor.
| Index_ tatami::SparseRange< Value_, Index_ >::number = 0 |
Number of structural non-zero elements.
| const Value_* tatami::SparseRange< Value_, Index_ >::value = NULL |
Pointer to an array containing the values of the structural non-zeros. If non-NULL, this has at least number addressible entries.
| const Index_* tatami::SparseRange< Value_, Index_ >::index = NULL |
Pointer to an array containing the indices of the structural non-zeros. If non-NULL, this has at least number addressible entries.