Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/graphblas/bsp1d/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ namespace grb {
for( fwd_iterator it = start; it != end; ++it ) {
#ifdef _BSP1D_IO_DEBUG
std::cout << "\t\t\t process " << data.s << " caches nonzero at "
<< *it << "\n";
<< start.i() << ", " << start.j() << "\n";
#endif
// sanity check on input
if( utils::check_input_coordinates( it, rows, cols ) != SUCCESS ) {
Expand Down
18 changes: 16 additions & 2 deletions include/graphblas/bsp1d/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ namespace grb {

/** Implements move constructor and assign-from-temporary. */
void moveFromOther( self_type &&other ) {
// make sure we had no pointer and (thus) no ID
assert( _ptr == nullptr );

// copy fields
_id = other._id;
_ptr = other._ptr;
Expand Down Expand Up @@ -507,8 +510,8 @@ namespace grb {
<< "\t ID is " << _id << "\n";
#endif
if( _m > 0 && _n > 0 ) {
#ifdef _DEBUG
std::cerr << "\t removing ID...\n";
#ifdef _DEBUG_BSP1D_MATRIX
std::cerr << "\t matrix destructor: removing ID...\n";
#endif
assert( _ptr != nullptr );
auto &data = internal::grb_BSP1D.load();
Expand All @@ -521,6 +524,17 @@ namespace grb {

/** Assign-from-temporary. */
self_type& operator=( self_type &&other ) noexcept {
if( _m > 0 && _n > 0 ) {
#ifdef _DEBUG_BSP1D_MATRIX
std::cerr << "\t move-assignment: removing ID...\n";
#endif
assert( _ptr != nullptr );
auto &data = internal::grb_BSP1D.load();
assert( _id != std::numeric_limits< uintptr_t >::max() );
data.mapper.remove( _id );
delete [] _ptr;
_ptr = nullptr;
}
moveFromOther( std::forward< self_type >(other) );
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions include/graphblas/bsp1d/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ namespace grb {
RC dense_synchronize(
internal::Coordinates< _GRB_BSP1D_BACKEND > &global_coordinates
) const {
#ifndef NDEBUG
#if !defined NDEBUG || defined _DEBUG
const auto &data = internal::grb_BSP1D.cload();
#endif
assert( data.P > 1 );
Expand Down Expand Up @@ -923,7 +923,7 @@ namespace grb {
RC array_synchronize(
internal::Coordinates< _GRB_BSP1D_BACKEND > &global_coordinates
) const {
#ifndef NDEBUG
#if !defined NDEBUG || defined _DEBUG
const auto &data = internal::grb_BSP1D.cload();
#endif
assert( data.P > 1 );
Expand Down
Loading