@@ -16481,6 +16481,10 @@ void FreezeTest()
16481
16481
16482
16482
eq = bv.equal(bv_ro);
16483
16483
assert(eq);
16484
+
16485
+ bv_ro.clear(true);
16486
+ assert(!bv_ro.is_ro());
16487
+ assert(bv_ro.count() == 0);
16484
16488
}
16485
16489
16486
16490
// merge
@@ -37302,6 +37306,76 @@ int main(int argc, char *argv[])
37302
37306
}
37303
37307
*/
37304
37308
37309
+ /*
37310
+ {
37311
+ const string file_name = "/Users/anatoliykuznetsov/dev/git/BitMagic/tests/stress/HG_Ref_column.txt";
37312
+ ifstream instr(file_name.c_str(), ios_base::in);
37313
+ if (!instr.good() || !instr.is_open()) {
37314
+ cout << "Failed to read file" << endl;
37315
+ assert(0);
37316
+ }
37317
+
37318
+ cout << "Reading " << file_name << endl;
37319
+ using bvector_type = bm::bvector<>;
37320
+ using TSparseStrVector = bm::str_sparse_vector<char, bvector_type, 390>;
37321
+ TSparseStrVector ref(bm::use_null);
37322
+
37323
+ unsigned num_lines = 0;
37324
+ {
37325
+ auto start = chrono::steady_clock::now();
37326
+ auto vec_it = ref.get_back_inserter();
37327
+ string line;
37328
+
37329
+ while (getline(instr, line)) {
37330
+ if (line.empty() || (!line.empty() && line[0] == '#')) {
37331
+ continue;
37332
+ }
37333
+ ++num_lines;
37334
+ vec_it = line;
37335
+ }
37336
+ vec_it.flush();
37337
+ auto diff = chrono::steady_clock::now() - start;
37338
+ cout << "Reading took "
37339
+ << chrono::duration_cast<chrono::milliseconds>(diff).count() << " ms " << endl;
37340
+ }
37341
+
37342
+ cout << "Lines: " << num_lines << ", " << ref.size() << endl;
37343
+ {
37344
+ cout << "Remapping..." << endl;
37345
+ auto start = chrono::steady_clock::now();
37346
+ ref.remap();
37347
+ auto diff = chrono::steady_clock::now() - start;
37348
+ cout << "Remap took "
37349
+ << chrono::duration_cast<chrono::milliseconds>(diff).count() << " ms " << endl;
37350
+ }
37351
+ {
37352
+ cout << "Optimizing..." << endl;
37353
+ auto start = chrono::steady_clock::now();
37354
+ BM_DECLARE_TEMP_BLOCK(tb);
37355
+ ref.optimize(tb);
37356
+ auto diff = chrono::steady_clock::now() - start;
37357
+ cout << "Optimization took "
37358
+ << chrono::duration_cast<chrono::milliseconds>(diff).count() << " ms " << endl;
37359
+ }
37360
+
37361
+ using TLayout = bm::sparse_vector_serial_layout<TSparseStrVector>;
37362
+ auto layout = make_unique<TLayout>();
37363
+
37364
+ bm::sparse_vector_serializer<TSparseStrVector> str_serializer;
37365
+
37366
+ str_serializer.set_bookmarks(true, 16);
37367
+ str_serializer.enable_xor_compression();
37368
+ assert(str_serializer.is_xor_ref());
37369
+ {
37370
+ cout << "Serializing..." << endl;
37371
+ auto start = chrono::steady_clock::now();
37372
+ str_serializer.serialize(ref, *layout.get());
37373
+ auto diff = chrono::steady_clock::now() - start;
37374
+ cout << "Serialization took "
37375
+ << chrono::duration_cast<chrono::milliseconds>(diff).count() << " ms " << endl;
37376
+ }
37377
+ }
37378
+ */
37305
37379
//avx2_i32_shift();
37306
37380
//return 0;
37307
37381
@@ -37424,6 +37498,7 @@ int main(int argc, char *argv[])
37424
37498
37425
37499
if (is_all || is_bvbasic || is_bvb0)
37426
37500
{
37501
+
37427
37502
ExportTest();
37428
37503
CheckAllocLeaks(false);
37429
37504
0 commit comments