tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
boolean_utils.hpp
Go to the documentation of this file.
1#ifndef TATAMI_BOOLEAN_UTILS_HPP
2#define TATAMI_BOOLEAN_UTILS_HPP
3
10namespace tatami {
11
15enum class BooleanOperation : char {
16 AND,
17 OR,
18 XOR,
19 EQUAL
20};
21
25template<BooleanOperation op_>
26bool delayed_boolean(bool val, bool scalar) {
27 if constexpr(op_ == BooleanOperation::AND) {
28 return val && scalar;
29 } else if constexpr(op_ == BooleanOperation::OR) {
30 return val || scalar;
31 } else if constexpr(op_ == BooleanOperation::XOR) {
32 return val != scalar;
33 } else { // EQUAL.
34 return val == scalar;
35 }
36}
41}
42
43#endif
Flexible representations for matrix data.
Definition Extractor.hpp:15
BooleanOperation
Definition boolean_utils.hpp:15
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35