29 static constexpr bool known_sparse = (op_ != BooleanOperation::EQUAL);
31 static constexpr bool is_basic =
false;
40 template<
typename Index_,
typename InputValue_,
typename OutputValue_>
41 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* left_buffer,
const InputValue_* right_buffer, OutputValue_* output_buffer)
const {
42 for (Index_ i = 0; i < length; ++i) {
43 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
44 auto& val = output_buffer[i];
45 val = delayed_boolean<op_>(val, right_buffer[i]);
47 output_buffer[i] = delayed_boolean<op_>(left_buffer[i], right_buffer[i]);
52 template<
typename Index_,
typename InputValue_,
typename OutputValue_>
53 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* left_buffer,
const InputValue_* right_buffer, OutputValue_* output_buffer)
const {
54 Index_ length = indices.size();
55 for (Index_ i = 0; i < length; ++i) {
56 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
57 auto& val = output_buffer[i];
58 val = delayed_boolean<op_>(val, right_buffer[i]);
60 output_buffer[i] = delayed_boolean<op_>(left_buffer[i], right_buffer[i]);
65 template<
typename Index_,
typename InputValue_,
typename OutputValue_>
70 constexpr bool must_have_both = (op_ == BooleanOperation::AND);
71 return delayed_binary_isometric_sparse_operation<must_have_both>(
78 [](InputValue_ l, InputValue_ r) ->
auto {
79 return delayed_boolean<op_>(l, r);
84 template<
typename OutputValue_,
typename InputValue_,
typename Index_>
85 OutputValue_ fill(
bool, Index_)
const {
86 if constexpr(known_sparse) {
93 bool is_sparse()
const {