Skip to content

Commit c7fc283

Browse files
committed
Implementation in reference+omp
1 parent 7250fa3 commit c7fc283

File tree

2 files changed

+398
-0
lines changed

2 files changed

+398
-0
lines changed

include/graphblas/blas0.hpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <type_traits> //enable_if
3333

3434
#include "graphblas/descriptors.hpp"
35+
#include "graphblas/identities.hpp"
3536
#include "graphblas/rc.hpp"
3637
#include "graphblas/type_traits.hpp"
3738

@@ -604,6 +605,38 @@ namespace grb {
604605

605606
};
606607

608+
template< typename MaskType >
609+
struct MaskHasValue {
610+
611+
public:
612+
template < Descriptor descr = descriptors::no_operation, typename MaskStruct >
613+
MaskHasValue( const MaskStruct& mask_raw, const size_t k ) {
614+
bool hasValue = mask_raw.getValue( k, identities::logical_false<MaskType>() );
615+
if (descr & grb::descriptors::invert_mask) {
616+
hasValue = !hasValue;
617+
}
618+
value = hasValue;
619+
}
620+
621+
const bool value;
622+
};
623+
624+
template<>
625+
struct MaskHasValue< void > {
626+
627+
public:
628+
template < Descriptor descr = descriptors::no_operation, typename MaskStruct >
629+
MaskHasValue( const MaskStruct& mask_raw, const size_t k ) :
630+
value(not (descr & grb::descriptors::invert_mask)){
631+
(void) mask_raw;
632+
(void) k;
633+
}
634+
635+
const bool value;
636+
637+
};
638+
639+
607640
} // namespace internal
608641

609642
} // namespace grb

0 commit comments

Comments
 (0)