File tree Expand file tree Collapse file tree 2 files changed +398
-0
lines changed
Expand file tree Collapse file tree 2 files changed +398
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments