File tree Expand file tree Collapse file tree
library/math/matrix_related
tests/library_checker_aizu_tests/handmade_tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- bitset<B> walk (bitset<B>& k) {
1+ bitset<B> walk (const bitset<B>& k) {
22 bitset<B> res;
33 for (int i = B, j = npivot; i--;)
44 if (basis[i][i] && res[i] ^ k[--j]) res ^= basis[i];
Original file line number Diff line number Diff line change @@ -28,14 +28,16 @@ int main() {
2828 for (int i = 0 ; i < n; i++) {
2929 bitset<B> val = rnd (0 , (1 << n) - 1 );
3030 if (b.insert (val)) naive_basis.push_back (val);
31+ assert (b.npivot + b.nfree == i + 1 );
3132 }
3233 vector<bitset<B>> fast_basis;
3334 for (int i = 0 ; i < B; i++)
34- if (b.basis [i].any ())
35- fast_basis.push_back (b.basis [i]);
35+ if (b.basis [i][i]) fast_basis.push_back (b.basis [i]);
3636 vector<bitset<B>> naive_span = get_all (naive_basis);
3737 vector<bitset<B>> fast_span = get_all (fast_basis);
3838 assert (naive_span == fast_span);
39+ for (int i = 0 ; i < ssize (naive_span); i++)
40+ assert (naive_span[i] == b.walk (i));
3941 }
4042 cout << " Hello World\n " ;
4143}
You can’t perform that action at this time.
0 commit comments