Skip to content
3 changes: 2 additions & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ set( root_files
"graphblas/phase.hpp" "graphblas/pinnedvector.hpp" "graphblas/properties.hpp"
"graphblas/rc.hpp" "graphblas/semiring.hpp" "graphblas/spmd.hpp"
"graphblas/tags.hpp" "graphblas/type_traits.hpp" "graphblas/utils.hpp"
"graphblas/vector.hpp"
"graphblas/vector.hpp" "graphblas/SynchronizedNonzeroIterator.hpp"
"graphblas/NonzeroStorage.hpp"
)
set( GRB_INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_DIR}/graphblas")
install( FILES ${root_files} DESTINATION "${GRB_INCLUDE_INSTALL_DIR}" )
Expand Down
6 changes: 3 additions & 3 deletions include/graphblas/NonzeroStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace grb {
typename V
>
void nonzeroStorage_printer(
std::ostream& s,
std::ostream &s,
const NonzeroStorage< R, T, V > &nz,
typename std::enable_if< std::is_same< V, void >::value >::type * = nullptr
) {
Expand All @@ -287,8 +287,8 @@ namespace grb {
typename T,
typename V
>
std::ostream& operator<<(
std::ostream& s,
std::ostream & operator<<(
std::ostream &s,
const NonzeroStorage< R, T, V > &nz
) {
s << "( " << nz.i() << ", " << nz.j() << " )";
Expand Down
10 changes: 7 additions & 3 deletions include/graphblas/ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "internalops.hpp"
#include "type_traits.hpp"


namespace grb {

/**
Expand Down Expand Up @@ -540,9 +541,9 @@ namespace grb {
static const constexpr bool value = true;
};

} // namespace grb::internal
} // end namespace grb::internal

} // namespace grb
} // end namespace grb

#ifdef __DOXYGEN__
/**
Expand All @@ -552,13 +553,16 @@ namespace grb {
*/
#define _DEBUG_NO_IOSTREAM_PAIR_CONVERTER
#endif

#ifdef _DEBUG
#ifndef _DEBUG_NO_IOSTREAM_PAIR_CONVERTER
namespace std {
template< typename U, typename V >
std::ostream & operator<<( std::ostream & out, const std::pair< U, V > & pair ) {
std::ostream & operator<<( std::ostream &out, const std::pair< U, V > &pair ) {
out << "( " << pair.first << ", " << pair.second << " )";
return out;
}
} // end namespace std
#endif
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,31 @@ namespace grb {
return result;
}

#ifdef _DEBUG
/** Overload print function. */
template< typename T = ValType >
static void print( std::ostream &s, const SelfType &nz,
typename std::enable_if<
!(std::is_same< T, void >::value)
>::type * = nullptr
) {
s << nz.off() << ": [ " << nz.col() << ", "
<< nz.row() << "]: "
<< nz.val();
}

/** Overload print function for pattern nonzeroes. */
template< typename T = ValType >
static void print( std::ostream &s, const SelfType &nz,
typename std::enable_if<
std::is_same< T, void >::value
>::type * = nullptr
) {
s << nz.off() << ": [ " << nz.col() << ", "
<< nz.row() << "]";
}
#endif


private:

Expand Down Expand Up @@ -338,15 +363,6 @@ namespace grb {
return this->_CXX->values[ this->_off ];
}

#ifdef _DEBUG
/** Overload print function. */
static void print( std::ostream &s, const SelfType &nz ) {
s << nz.off() << ": [ " << nz.col() << ", "
<< nz.row() << "]: "
<< nz.val();
}
#endif

};

template<
Expand Down
6 changes: 3 additions & 3 deletions include/graphblas/reference/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <graphblas/algorithms/hpcg/ndim_matrix_builders.hpp>
#include <graphblas/utils/iterators/utils.hpp>

#include "nonzero_wrapper.hpp"
#include "NonzeroWrapper.hpp"
#include "forward.hpp"


Expand Down Expand Up @@ -455,7 +455,7 @@ namespace grb {
{
std::cout << "after third step:" << std::endl;
for( size_t s = 0; s < prefix_sum_buffer_size; s++ ) {
std::cout << s << ": " << prefix_sum_buffer[s] << std::endl;
std::cout << s << ": " << prefix_sum_buffer[ s ] << std::endl;
}
}
#endif
Expand Down Expand Up @@ -1749,7 +1749,7 @@ namespace grb {
#ifdef _DEBUG
std::cout << "Nonzero " << k << ", ( " << it.i() << ", " << it.j() << " ) "
<< "is stored at CRS position "
<< static_cast< size_t >( crs_pos ) << ".\n"
<< static_cast< size_t >( crs_pos ) << ".\n";
#endif
const size_t ccs_pos = --( CCS.col_start[ it.j() ] );
CCS.recordValue( ccs_pos, true, it );
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
* limitations under the License.
*/

#include <iostream>
#include <graphblas.hpp>


struct input {
bool check;
std::array< size_t, 3 > values;
Expand Down