tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
tatami
utils
integer_comparisons.hpp
Go to the documentation of this file.
1
#ifndef TATAMI_SAFE_NON_NEGATIVE_EQUAL_HPP
2
#define TATAMI_SAFE_NON_NEGATIVE_EQUAL_HPP
3
4
#include <type_traits>
5
11
namespace
tatami
{
12
22
template
<
typename
Left_,
typename
Right_>
23
bool
safe_non_negative_equal
(Left_ l, Right_ r) {
24
return
l >= 0 && r >= 0 &&
static_cast<
typename std::make_unsigned<Left_>::type
>
(l) ==
static_cast<
typename std::make_unsigned<Right_>::type
>
(r);
25
}
26
27
}
28
29
#endif
tatami
Flexible representations for matrix data.
Definition
Extractor.hpp:15
tatami::safe_non_negative_equal
bool safe_non_negative_equal(Left_ l, Right_ r)
Definition
integer_comparisons.hpp:23
Generated by
1.12.0