tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
ConsecutiveOracle.hpp
Go to the documentation of this file.
1#ifndef TATAMI_CONSECUTIVE_ORACLE_HPP
2#define TATAMI_CONSECUTIVE_ORACLE_HPP
3
4#include "../base/Oracle.hpp"
5
6#include "sanisizer/sanisizer.hpp"
7
14namespace tatami {
15
21template<typename Index_>
22class ConsecutiveOracle final : public Oracle<Index_> {
23public:
28 ConsecutiveOracle(Index_ start, Index_ length) : my_offset(start), my_length(sanisizer::cast<PredictionIndex>(length)) {}
29
31 return my_length;
32 }
33
34 Index_ get(PredictionIndex i) const {
35 return my_offset + i;
36 }
37
38private:
39 Index_ my_offset;
40 PredictionIndex my_length;
41};
42
43}
44
45#endif
Oracle for data access.
Predict future accesses along a consecutive sequence.
Definition ConsecutiveOracle.hpp:22
PredictionIndex total() const
Definition ConsecutiveOracle.hpp:30
Index_ get(PredictionIndex i) const
Definition ConsecutiveOracle.hpp:34
ConsecutiveOracle(Index_ start, Index_ length)
Definition ConsecutiveOracle.hpp:28
Predict future access requests on the target dimension.
Definition Oracle.hpp:29
Flexible representations for matrix data.
Definition Extractor.hpp:15
std::size_t PredictionIndex
Definition Oracle.hpp:18