Skip to content

Commit 1425539

Browse files
committed
Test with no masking
1 parent 99fbea1 commit 1425539

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

include/graphblas/algorithms/simulated_annealing_re.hpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ namespace grb {
285285
const size_t n_replicas = states.size();
286286
const size_t n = grb::size(states[0]);
287287
(void) n;
288+
(void) n_procs;
288289
(void) s;
289290

290291
grb::RC rc = grb::SUCCESS;
@@ -436,7 +437,7 @@ namespace grb {
436437
}
437438

438439
// add new mask
439-
masks.emplace_back( grb::Vector< bool, backend >( n ) );
440+
masks.emplace_back( n );
440441
auto &new_mask = masks.at(i);
441442
rc = rc ? rc : grb::resize( new_mask, n );
442443
rc = rc ? rc : grb::set< descr >( new_mask, frontier, static_cast< MaskType >(true) );
@@ -594,9 +595,22 @@ namespace grb {
594595
rc = rc ? rc : grb::resize( dn, n );
595596
rc = rc ? rc : grb::resize( accept, n );
596597

597-
std::vector< grb::Vector< bool, backend > > masks ;
598+
std::vector< grb::Vector< bool, backend > > masks;
598599
rc = rc ? rc : matrix_partition< descr >( masks, couplings, h, rand, seed );
599-
rc = rc ? rc : grb::clear(h);
600+
601+
std::vector< grb::Vector< bool, backend > > trivial_masks;
602+
603+
for(const auto &mask : masks ){
604+
for( const auto &x : mask ){
605+
trivial_masks.emplace_back( n );
606+
grb::setElement( trivial_masks.back(), x.second, x.first );
607+
}
608+
}
609+
assert( trivial_masks.size() == n );
610+
611+
masks = trivial_masks;
612+
613+
rc = rc ? rc : grb::clear( h );
600614
constexpr auto dense_descr = descr | grb::descriptors::dense;
601615

602616
auto sweep_data = std::tie(

0 commit comments

Comments
 (0)