@@ -1234,55 +1234,6 @@ TEST_CASE("BinaryNode") {
12341234 }
12351235 }
12361236 }
1237-
1238- THEN (" We unset() some values" ) {
1239- bnode_ptr->unset (state, 0 ); // Does nothing.
1240- bnode_ptr->unset (state, 6 );
1241- bnode_ptr->unset (state, 11 );
1242- init_values[0 ] = 0 ;
1243- init_values[6 ] = 0 ;
1244- init_values[11 ] = 0 ;
1245- // state is now: [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0]
1246-
1247- THEN (" Sum constraint sums and state updated correctly" ) {
1248- // Cont. w/ Python code at **Python Code 1**
1249- // a[np.unravel_index(0, a.shape)] = 0
1250- // a[np.unravel_index(6, a.shape)] = 0
1251- // a[np.unravel_index(11, a.shape)] = 0
1252- // a.sum(axis=(1, 2))
1253- // >>> array([1, 1, 3])
1254- CHECK_THAT (bnode_ptr->sum_constraints_lhs (state)[0 ], RangeEquals ({1 , 1 , 3 }));
1255- CHECK (bnode_ptr->diff (state).size () == 2 );
1256- CHECK_THAT (bnode_ptr->view (state), RangeEquals (init_values));
1257- }
1258-
1259- AND_WHEN (" We commit and set() some values" ) {
1260- graph.commit (state);
1261-
1262- bnode_ptr->set (state, 10 ); // Does nothing.
1263- bnode_ptr->set (state, 11 );
1264- init_values[10 ] = 1 ;
1265- init_values[11 ] = 1 ;
1266- // state is now: [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
1267-
1268- THEN (" sum constraint sums updated correctly" ) {
1269- CHECK_THAT (bnode_ptr->sum_constraints_lhs (state)[0 ],
1270- RangeEquals ({1 , 1 , 4 }));
1271- CHECK (bnode_ptr->diff (state).size () == 1 );
1272- CHECK_THAT (bnode_ptr->view (state), RangeEquals (init_values));
1273- }
1274-
1275- AND_WHEN (" We revert" ) {
1276- graph.revert (state);
1277-
1278- THEN (" Sum constraint sums reverted correctly" ) {
1279- CHECK_THAT (bnode_ptr->sum_constraints_lhs (state)[0 ],
1280- RangeEquals ({1 , 1 , 3 }));
1281- CHECK (bnode_ptr->diff (state).size () == 0 );
1282- }
1283- }
1284- }
1285- }
12861237 }
12871238 }
12881239 // *********************** Sum Constraint tests *************************
0 commit comments