From ae405a41c6462982f1deeb72a36f6af4913ec34f Mon Sep 17 00:00:00 2001 From: Benjamin Lozes Date: Fri, 16 Feb 2024 11:42:48 +0100 Subject: [PATCH] Review partial fixes --- .../graphblas/reference/compressed_storage.hpp | 10 +++++----- include/graphblas/reference/io.hpp | 16 +++++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/graphblas/reference/compressed_storage.hpp b/include/graphblas/reference/compressed_storage.hpp index 3976ae610..753605647 100644 --- a/include/graphblas/reference/compressed_storage.hpp +++ b/include/graphblas/reference/compressed_storage.hpp @@ -47,11 +47,11 @@ namespace grb { * Performs no safety checking. Performs no (re-)allocations. * * @param[out] output The container to copy the coordinates to. - * @param[in] input The container to copy the coordinates from. - * @param[in] nz The number of nonzeroes in the \a other container. - * @param[in] m The index dimension of the \a other container. - * @param[in] k The start position to copy from (inclusive). - * @param[in] end The end position to copy to (exclusive). + * @param[in] input The container to copy the coordinates from. + * @param[in] nz The number of nonzeroes in the \a other container. + * @param[in] m The index dimension of the \a other container. + * @param[in] k The start position to copy from (inclusive). + * @param[in] end The end position to copy to (exclusive). * * The copy range is 2nz + m + 1, i.e., * -# 0 <= start < 2nz + m + 1 diff --git a/include/graphblas/reference/io.hpp b/include/graphblas/reference/io.hpp index 3ee301fd1..e427483f4 100644 --- a/include/graphblas/reference/io.hpp +++ b/include/graphblas/reference/io.hpp @@ -642,8 +642,10 @@ namespace grb { * * \todo Check and, if needed, revise performance semantics. */ - template< Descriptor descr = descriptors::no_operation, - typename OutputType, typename InputType, typename Coords > + template< + Descriptor descr = descriptors::no_operation, + typename OutputType, typename InputType, typename Coords + > RC set( Vector< OutputType, reference, Coords > &x, const Vector< InputType, reference, Coords > &y, @@ -989,11 +991,15 @@ namespace grb { "if A is a mask, then C must not be a void matrix" ); static_assert( - A_is_mask || - ( !A_is_mask && - std::is_convertible< ValueType, OutputType >::value ), + A_is_mask || std::is_convertible< ValueType, OutputType >::value, "internal::grb::set called with non-matching value types" ); + static_assert( + ! A_is_mask || + ! ( descr & descriptors::structural && descr & descriptors::invert_mask ), + "internal::grb::set can not be called with both descriptors::structural " + "and descriptors::invert_mask in the masked variant" + ); NO_CAST_ASSERT( ( !( descr & descriptors::no_casting ) || ( !A_is_mask && std::is_same< InputType, OutputType >::value ) ),