diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2025-06-08 23:30:29 +0200 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2025-06-08 23:30:29 +0200 |
| commit | 59bea75c7c785e9012b0f3d677b9afbf93818fb4 (patch) | |
| tree | 4b4510d0c8807fdd7edf0813111272ff7cd60639 /test/graph/2sat.cpp | |
| parent | 88d04413ebaab961f849ac6ef3d6ff2179253d41 (diff) | |
make SCC a struct, and minor 2SAT changes
Diffstat (limited to 'test/graph/2sat.cpp')
| -rw-r--r-- | test/graph/2sat.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/graph/2sat.cpp b/test/graph/2sat.cpp index cf37131..e969364 100644 --- a/test/graph/2sat.cpp +++ b/test/graph/2sat.cpp @@ -25,7 +25,7 @@ struct RandomClause { return false; } - void add(sat2& sat) const { + void add(SAT2& sat) const { int va = a; int vb = b; if (type == 0) sat.addImpl(va, vb); @@ -80,9 +80,8 @@ void stress_test() { vector<RandomClause> clauses; for (int i = 0; i < m; i++) clauses.emplace_back(n); - sat2 sat(n); + SAT2 sat(n); for (auto& c : clauses) c.add(sat); - adj = sat.adj; bool got = sat.solve(); bool expected = naive(n, clauses); @@ -113,11 +112,8 @@ void performance_test() { vector<RandomClause> clauses; for (int i = 0; i < M; i++) clauses.emplace_back(N); t.start(); - sat2 sat(N); + SAT2 sat(N); for (auto& c : clauses) c.add(sat); - t.stop(); - adj = sat.adj; - t.start(); hash_t hash = sat.solve(); t.stop(); if (t.time > 500) cerr << "too slow: " << t.time << FAIL; |
