tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
tatami
utils
consecutive_extractor.hpp
Go to the documentation of this file.
1
#ifndef TATAMI_CONSEUCTIVE_EXTRACTOR_HPP
2
#define TATAMI_CONSEUCTIVE_EXTRACTOR_HPP
3
4
#include <memory>
5
#include "../base/Matrix.hpp"
6
#include "
new_extractor.hpp
"
7
#include "
ConsecutiveOracle.hpp
"
8
14
namespace
tatami
{
15
34
template
<
bool
sparse_
,
typename
Value_
,
typename
Index_
,
typename
...
Args_
>
35
auto
consecutive_extractor
(
const
Matrix<Value_, Index_>
*
mat
,
bool
row
,
Index_
iter_start
,
Index_
iter_length
,
Args_
&&...
args
) {
36
return
new_extractor<sparse_, true>
(
37
mat
,
38
row
,
39
std::make_shared<
ConsecutiveOracle<Index_>
>(
iter_start
,
iter_length
),
40
std::forward<Args_>(
args
)...
41
);
42
}
43
47
// Provided for back-compatibility only.
48
template
<
bool
row_
,
bool
sparse_
,
typename
Value_
,
typename
Index_
,
typename
...
Args_
>
49
auto
consecutive_extractor
(
const
Matrix<Value_, Index_>*
ptr
,
Args_
&&...
args
) {
50
return
consecutive_extractor<sparse_, Value_, Index_>
(
ptr
,
row_
, std::forward<Args_>(
args
)...);
51
}
56
}
57
58
#endif
ConsecutiveOracle.hpp
Iterate across consecutive elements of the target dimension.
tatami::ConsecutiveOracle
Predict future accesses along a consecutive sequence.
Definition
ConsecutiveOracle.hpp:21
tatami::Matrix
Virtual class for a matrix.
Definition
Matrix.hpp:59
tatami
Flexible representations for matrix data.
Definition
Extractor.hpp:15
tatami::consecutive_extractor
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition
consecutive_extractor.hpp:35
new_extractor.hpp
Templated construction of a new extractor.
Generated by
1.9.8