A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/bmserial_8h_source.html below:

NCBI C++ ToolKit: include/util/bitset/bmserial.h Source File

1 #ifndef BMSERIAL__H__INCLUDED__ 2 #define BMSERIAL__H__INCLUDED__ 33 #ifndef BM__H__INCLUDED__ 36 # error missing include (bm.h or bm64.h) 41 #pragma warning( push ) 42 #pragma warning( disable : 4311 4312 4127) 83  typedef typename

bvector_type::size_type

size_type

;

177  unsigned char

*

buf

,

size_t

buf_size);

567 template

<

typename

DEC,

typename

BLOCK_IDX>

646

template<class BV, class DEC>

671  const unsigned char

*

buf

,

691

is_range_set_ = 1; idx_from_ = from; idx_to_ = to;

770  unsigned

xor_chain_size_;

775  unsigned

is_range_set_;

787

template<class BV, class SerialIterator>

806  bool

exit_on_one =

false

);

832

{

return "BM::de-serialization format error"

; }

834  bool

is_range_set_ =

false

;

846 template

<

class

DEC,

typename

BLOCK_IDX>

862  bool is_eof

()

const

{

return

end_of_stream_; }

871  unsigned

get_bit_block(

bm

::

word_t

* dst_block,

880  unsigned

dec_size()

const

{

return

decoder_.size(); }

947  return

get_bit_block_COUNT(dst_block, tmp_block);

968  block_idx_type

new_nb = parent_type::try_skip(decoder_, nb, expect_nb);

971

block_idx_ = new_nb; state_ = e_blocks;

1005 template

<

typename

BV>

1029  const unsigned char

*

buf

,

1031  bool

exit_on_one =

false

);

1041  const unsigned char

*

buf

,

1063  const unsigned char

*

buf

,

1066  bool

exit_on_one =

false

)

1077  const unsigned char

*

buf

,

1094  const unsigned char

*

buf

,

1103  const unsigned char

*

buf

,

1272 template

<

class

BV>

1276

compression_stat_(0),

1277

gap_serial_(

false

),

1278

byte_order_serial_(

true

),

1279

sb_bookmarks_(

false

),

1282

enc_header_pos_(0), header_flag_(0),

1290  if

(temp_block == 0)

1307 template

<

class

BV>

1310

compression_stat_(0),

1311

gap_serial_(

false

),

1312

byte_order_serial_(

true

),

1313

sb_bookmarks_(

false

),

1316

enc_header_pos_(0), header_flag_(0),

1324  if

(temp_block == 0)

1341 template

<

class

BV>

1349

tb_wflags_ = alloc_.alloc_bit_block(1);

1350

idx_arr_ = alloc_.alloc_bit_block(1);

1354 template

<

class

BV>

1357  if

(own_temp_block_)

1358

alloc_.free_bit_block(temp_block_);

1359  if

(compression_stat_)

1360

alloc_.free_bit_block((

bm::word_t

*)compression_stat_);

1362

alloc_.free_bit_block(xor_tmp_block_, 3);

1363  if

(gap_recalc_tmp_block0_)

1365  if

(gap_recalc_tmp_block1_)

1368  if

(gap_ex0_tmp_block_)

1370  if

(gap_ex1_tmp_block_)

1373

alloc_.free_bit_block(tb_wflags_, 1);

1375

alloc_.free_bit_block(idx_arr_, 1);

1382 template

<

class

BV>

1385  for

(

unsigned i

= 0;

i

< 256; ++

i

)

1386

compression_stat_[

i

] = 0;

1389 template

<

class

BV>

1393

compression_level_ = clevel;

1394  if

(compression_level_ == 5)

1396  else if

(compression_level_ == 6)

1400 template

<

class

BV>

1405

sparse_cutoff_ = cutoff;

1410 template

<

class

BV>

1413

gap_serial_ =

value

;

1416 template

<

class

BV>

1419

byte_order_serial_ =

value

;

1422 template

<

class

BV>

1425

sb_bookmarks_ = enable;

1428  if

(bm_interval > 512)

1431  if

(bm_interval < 4)

1434

sb_range_ = bm_interval;

1437 template

<

class

BV>

1442

xor_scan_.set_ref_vector(

ref_vect

);

1445

xor_tmp_block_ = alloc_.alloc_bit_block(3);

1451 template

<

class

BV>

1456  return

xor_scan_.compute_sim_model(sim_model,

ref_vect

, params);

1459 template

<

class

BV>

1462

sim_model_ = sim_model;

1465 template

<

class

BV>

1471 template

<

class

BV>

1482  if

(!byte_order_serial_)

1498

enc_header_pos_ = enc.get_pos();

1499

enc.put_8(header_flag_);

1501  if

(byte_order_serial_)

1504

enc.put_8((

unsigned char

)bo);

1516

enc.put_64(bv.size());

1518

enc.put_32(bv.size());

1556 template

<

class

BOUT>

1564

: bout.delta16(min0);

1571

: bout.delta16(min1);

1582 template

<

class

BOUT>

1587

bout.put_bits(min_v, 8)

1588

: bout.put_16_no(min_v);

1589

(tail_delta < 256) ?

1590

bout.put_bits(tail_delta, 8)

1591

:bout.put_16_no(tail_delta);

1603  if

( tail_delta <= ((0xFF << 3) + 0b111) )

1607

head_v3 |= (tail_delta & 0b111);

1618 template

<

class

BV>

1622  const unsigned

drange_gain_cutoff = 200;

1627  const unsigned

h_limit = 3;

1628  const unsigned

ex_limit = (

len

/ 4);

1629  unsigned

hist0[h_limit] = {0,};

1630  unsigned

hist1[h_limit] = {0,};

1645  unsigned

ex0_cnt, ex1_cnt;

1648

gap_recalc_block, ex0_arr, ex1_arr, ex0_cnt, ex1_cnt);

1650  if

(ex0_cnt + ex1_cnt < 5)

1654  if

(gl1 < (gl2 + ex0_cnt + ex1_cnt))

1677  unsigned char

head_v3 = 0;

1685

min_v = gap_recalc_block[1];

1686

max_v = gap_recalc_block[

len

-1]-1;

1712

bout.

delta16s

(gap_recalc_block[1]);

1713  for

(

unsigned

k = 2; k <

len

; ++k)

1715  BM_ASSERT

(gap_recalc_block[k] < 65535);

1717

gap_recalc_block[k] - gap_recalc_block[k-1];

1733

&gap_recalc_block[2],

len

-3, min_v+1, max_v);

1739  bool

end_fl = (ex1_cnt == 0);

1742

ex0_cnt,

false

, end_fl);

1746

ex1_cnt,

true

,

true

);

1751  bool

end_fl = (ex0_cnt == 0);

1754

ex1_cnt,

true

, end_fl);

1758

ex0_cnt,

false

,

true

);

1761 #ifdef BM_DBG_SERIAL 1763

enc.

put_8

((

unsigned char

)0xFF);

1778  if

( (min0 > 1 || min1 > 1))

1785  if

(delta_acc > drange_gain_cutoff)

1815  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

1820

gamma_gap_block(gap_block, enc);

1824 #ifdef BM_DBG_SERIAL 1826

enc.

put_8

((

unsigned char

)0xFF);

1838 template

<

class

BV>

1856  if

(tail_delta < 256)

1869  if

(tail_delta < 256)

1870

bout.

gamma8

(tail_delta);

1881  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

1883  if

(enc_size > plain_size)

1898

gamma_gap_block(gap_block, enc);

1902 template

<

class

BV>

1914  bm::encoder

enc_try((

unsigned char

*)try_buf_, 65536);

1919

interpolated_encode_gap_block_v3s(gap_block, enc_try,

len

);

1922

s_size = size_t(enc_try_pos1 - enc_try_pos0);

1928  bool

v3_ok = interpolated_encode_gap_block_v3(gap_block, enc,

len

);

1932  size_t

dr_size = size_t(enc_pos1 - enc_pos0);

1933  if

(s_size && (s_size < dr_size))

1952

gamma_gap_block(gap_block, enc);

1959 template

<

class

BV>

1963  unsigned len

= (*gap_block >> 3);

1967  bool

use_gamma =

false

;

1968  if

(compression_level_ > 3)

1971

use_gamma = (gamma_size_bits < size_16_bits);

1984

bout.

put_bits

(*gap_block & 1, 1);

1991  if

(*pcurr == 65535)

1993  unsigned delta

= unsigned(*pcurr -

prev

);

2001  unsigned gamma_size

= (unsigned)(enc_pos1 - enc_pos0);

2004

enc.set_pos(enc_pos0);

2020

bout.

put_bits

(*gap_block & 1, 1);

2022  for

(

unsigned i

= 1;

i

<

len

; ++

i

)

2030  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0); (void) enc_size;

2033  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0); (void) enc_size;

2037 template

<

class

BV>

2045  if

(compression_level_ > 3 && arr_len > 1)

2051

bout.

gamma

(arr_len);

2055  for

(

unsigned i

= 1;

i

< arr_len; ++

i

)

2063  unsigned gamma_size

= (unsigned)(enc_pos1 - enc_pos0);

2066

enc.set_pos(enc_pos0);

2069

compression_stat_[scode]++;

2075

enc.put_prefixed_array_16(scode, gap_array, arr_len,

true

);

2076

compression_stat_[scode]++;

2080 template

<

class

BV>

2104

bout.

gamma

(arr_len-4);

2109  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

2111  if

(enc_size >= raw_size)

2112

enc.set_pos(enc_pos0);

2115

compression_stat_[scode]++;

2121

enc.put_prefixed_array_16(scode, gap_block, arr_len,

true

);

2122

compression_stat_[scode]++;

2128 template

<

class

BV>

2143  if

(min_v >= 256 && tail >= 256)

2145

interpolated_gap_array_v0(gap_block, arr_len, enc, inverted);

2166

arr_len |= (1 << 1);

2170

enc.put_8((

unsigned char

)min_v);

2175

enc.put_8((

unsigned char

)tail);

2185  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

2187  if

(enc_size >= raw_size)

2189

enc.set_pos(enc_pos0);

2193

compression_stat_[scode]++;

2198  unsigned char

scode =

2200

enc.put_prefixed_array_16(scode, gap_block, arr_len,

true

);

2201

compression_stat_[scode]++;

2206 template

<

class

BV>

2210

scores_[mod_size_] = score; models_[mod_size_] =

mod

;

2218 template

<

class

BV>

2225  const float

bie_bits_per_int =

2226

compression_level_ < 6 ? 3.75f : this->bie_bits_per_int_;

2227  const unsigned

bie_limit = unsigned(

float

(

bm::gap_max_bits

) / bie_bits_per_int);

2228  unsigned

bc, ibc, gc;

2232  BM_ASSERT

(sub_stat.top_level_idx == i0);

2236

bit_stat_.bit_model_0run_size_ =

2245

bit_stat_.bit_model_d0_size_ = unsigned(8 + (32 * d0_bc *

sizeof

(

bm::word_t

)));

2251  if

(sub_stat.top_level_idx == i0 && (block == sub_stat.blocks[j0]))

2253

gc = sub_stat.gc_arr[j0]; bc = sub_stat.bc_arr[j0];

2257

bit_stat_.gc = gc; bit_stat_.bc = bc;

2270  unsigned

arr_size_inv =

2277  float

gcf=float(gc);

2280

32 +

unsigned

((gcf-1) * bie_bits_per_int));

2281  if

(

float

bcf=

float

(bc), ibcf=

float

(ibc); bc < bie_limit)

2283

16 * 3 +

unsigned

(bcf * bie_bits_per_int));

2285  if

(ibc < bie_limit)

2287

16 * 3 +

unsigned

(ibcf * bie_bits_per_int));

2289

gc -= gc > 2 ? 2 : 0;

2293

16 * 4 +

unsigned

(gcf * bie_bits_per_int));

2297

16 * 4 +

unsigned

(gcf * bie_bits_per_int));

2303  for

(

unsigned i

= 0;

i

< mod_size_; ++

i

)

2305  if

(scores_[

i

] < min_score)

2307

min_score = scores_[

i

]; model = models_[

i

];

2313

std::cout <<

" 0runs="

<< (bit_model_0run_size_ * 8) << std::endl;

2314

std::cout <<

" GAP BIC="

<< (16 * 4 + unsigned(gcf * bie_bits_per_int)) << std::endl;

2315

std::cout <<

" ARR BIC="

<< (16 * 3 + unsigned(bcf * bie_bits_per_int)) << std::endl;

2316

std::cout <<

"BC,GC=["

<< bc <<

", "

<< gc <<

"]"

<< std::endl;

2317

std::cout <<

"bie_limit="

<< bie_limit << std::endl;

2322  case set_block_bit

: std::cout <<

"BIT="

<<

"["

<< bc <<

", "

<< gc <<

"]"

;

break

;

2334  case set_block_bit_0runs

: std::cout <<

"0runs=["

<< bc <<

", "

<< gc <<

" lmt="

<< bie_limit <<

"]"

;

break

;

2337  default

: std::cout <<

"UNK="

<<

int

(model);

break

;

2347  if

((compression_level_ >= 6) && bic_drange_)

2353

(bit_stat_.gc <= bit_stat_.bc || bit_stat_.gc <= bit_stat_.ibc))

2359

model = (bit_stat_.bc <= bit_stat_.ibc) ?

2369 template

<

class

BV>

2379  if

(compression_level_ >= 5)

2380  return

find_bit_best_encoding_l5(block, sub_stat, nb);

2387  if

(compression_level_ <= 1)

2392  if

(compression_level_ <= 5)

2395  if

(compression_level_ >= 2)

2404

bit_stat_.bit_model_d0_size_ = unsigned(8 + (32 * d0_bc *

sizeof

(

bm::word_t

)));

2408  if

(compression_level_ >= 4)

2415

bit_stat_.gc = 65535;

2419  if

(bit_stat_.bc == 1)

2431  if

(compression_level_ >= 3)

2435  unsigned

arr_size_inv =

2441  if

(compression_level_ >= 4)

2443  const unsigned

gamma_bits_per_int = 6;

2444  if

(compression_level_ == 4)

2448

16 + (bit_stat_.gc-1) * gamma_bits_per_int);

2449  if

(bit_stat_.bc < bit_stat_.gc &&

2452

16 + bit_stat_.bc * gamma_bits_per_int);

2453  if

(bit_stat_.ibc > 3 &&

2454

bit_stat_.ibc < bit_stat_.gc &&

2457

16 + bit_stat_.ibc * gamma_bits_per_int);

2467  for

(

unsigned i

= 0;

i

< mod_size_; ++

i

)

2469  if

(scores_[

i

] < min_score)

2471

min_score = scores_[

i

]; model = models_[

i

];

2477 template

<

class

BV>

2483  if

(compression_level_ <= 2)

2491  if

(compression_level_ == 4)

2498 template

<

class

BV>

2507  unsigned char

enc_choice = find_gap_best_encoding(gap_block);

2511

gamma_gap_block(gap_block, enc);

2520

enc.

put_16

(gap_temp_block[0]);

2537

gamma_gap_array(gap_temp_block, arr_len, enc,

invert

);

2540

interpolated_encode_gap_block(gap_block, enc, 0);

2543

gamma_gap_block(gap_block, enc);

2547 template

<

class

BV>

2554

enc.put_8((blk[0]==0) ? 0 : 1);

2590

enc.put_32(blk +

i

, j -

i

);

2599 template

<

class

BV>

2608  if

(bit_stat_.bit_model_0run_size_ < bit_stat_.bit_model_d0_size_)

2610

encode_bit_interval(block, enc, 0);

2627

enc.put_32(block[off+j+0]);

2628

enc.put_32(block[off+j+1]);

2629

enc.put_32(block[off+j+2]);

2630

enc.put_32(block[off+j+3]);

2643

encode_bit_interval(block, enc, 0);

2652 template

<

class

BV>

2662

enc.put_8(vbr_flag);

2666

ridx = ref_vect_->get_row_idx(ridx);

2670  case

1: enc.put_8((

unsigned char

)ridx);

break

;

2671  case

2: enc.put_16((

unsigned short

)ridx);

break

;

2672  case

0: enc.put_32((

unsigned

)ridx);

break

;

2676

enc.put_8((

unsigned char

) (chain_size-1));

2678  for

(

unsigned

ci = 1; ci < chain_size; ++ci)

2680

ridx = mchain.ref_idx[ci];

2681

d64 = mchain.xor_d64[ci];

2682

ridx = ref_vect_->get_row_idx(ridx);

2685  case

1: enc.put_8((

unsigned char

)ridx);

break

;

2686  case

2: enc.put_16((

unsigned short

)ridx);

break

;

2687  case

0: enc.put_32((

unsigned

)ridx);

break

;

2697 template

<

class

BV>

2706

s_block = xor_tmp1_;

2709  const bm::word_t

* ref_block = xor_scan_.get_ref_block(ridx,

i

, j);

2713

ref_block = xor_tmp2_;

2717  for

(

unsigned

k = 1; k < mchain.chain_size; ++k)

2719

ridx = mchain.ref_idx[k];

2720

ref_block = xor_scan_.get_ref_block(ridx,

i

, j);

2724

ref_block = xor_tmp2_;

2726

d64 = mchain.xor_d64[k];

2732 template

<

class

BV>

2740

bv.calc_stat(&stat);

2744  buf

.resize(bv_stat->max_serialize_mem,

false

);

2745

optimize_ = free_ =

false

;

2747  unsigned char

* data_buf =

buf

.data();

2748  size_t

buf_size =

buf

.size();

2756 template

<

class

BV>

2765  typename

bvector_type::mem_pool_guard mp_g_z;

2766

mp_g_z.assign_if_not_set(pool_, bv);

2768

bv.optimize(temp_block_, BV::opt_compress, &

st

);

2771

optimize_ = free_ =

false

;

2774 template

<

class

BV>

2784  unsigned char

scode =

2786

enc.put_prefixed_array_16(scode, bit_idx_arr_.data(), arr_len,

true

);

2787

compression_stat_[scode]++;

2790

encode_bit_digest(block, enc, bit_stat_.d0);

2793 template

<

class

BV>

2799

gamma_gap_block(bit_idx_arr_.data(), enc);

2802 template

<

class

BV>

2811

gamma_gap_array(bit_idx_arr_.data(), arr_len, enc, inverted);

2818 template

<

class

BV>

2827

interpolated_gap_array(bit_idx_arr_.data(), arr_len, enc, inverted);

2830

encode_bit_digest(block, enc, bit_stat_.d0);

2833 template

<

class

BV>

2841  bool r

= bienc_gap_bit_block_enc(

len

, enc);

2844

encode_bit_digest(block, enc, bit_stat_.d0);

2856

interpolated_encode_gap_block(bit_idx_arr_.data(), enc,

len

);

2859  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

2862

enc.set_pos(enc_pos0);

2869 template

<

class

BV>

2876  bool r

= bienc_gap_bit_block_enc(

len

, enc);

2879

encode_bit_digest(block, enc, bit_stat_.digest0_);

2882 template

<

class

BV>

2901

enc.put_8((

unsigned char

)

head

);

2908  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

2910  if

(enc_size >= raw_size)

2912

enc.set_pos(enc_pos0);

2916

compression_stat_[scode]++;

2943 template

<

class

BV>

2947  unsigned

sb_flag = 0;

2953  unsigned len

= (unsigned)sb_bit_idx_arr_.size();

2956  unsigned

min0 = 0;

unsigned

delta_acc = 0; (void) delta_acc;

2958  unsigned

* sb_arr = sb_bit_idx_arr_.data();

2960

min0 = (min0 > 1) ? (min0-1) : 0;

2964  unsigned

projected_delta_acc = (

len

- 1) * min0;

2965  if

(min0 && projected_delta_acc > 250)

2970  BM_ASSERT

((max_v1 + delta_acc) == max_v0);

2987  else if

(sb > 65535)

2996  if

(min_v <= 0xFFFFFF)

3003  else if

(min_v > 255)

3006  if

(max_v_delta > 65535)

3007  if

(max_v_delta <= 0xFFFFFF)

3013  else if

(max_v_delta > 255)

3031  if

(min_v <= 0xFFFFFF)

3044  else if

(min_v > 255)

3046

bout.

put_16_no

((

unsigned short

)min_v);

3049

bout.

put_bits

((

unsigned char

)min_v, 8);

3051  if

(max_v_delta > 65535)

3053  if

(max_v_delta <= 0xFFFFFF)

3058  else if

(max_v_delta > 255)

3059

bout.

put_16_no

((

unsigned short

)max_v_delta);

3078

bout.

gamma

(min0_code);

3107

(

unsigned

)sb_bit_idx_arr_.size()-2,

3111  unsigned

enc_size = (unsigned)(pos1 - pos0); (void) enc_size;

3113

compression_stat_[scode]++;

3117 template

<

class

BV>

3128  unsigned

sub_gap_len = 0;

3131  if

(sub_stat.blocks[

i

])

3141

bit_out_type bout(enc);

3144

bout.gamma8(sub_gap_len);

3145

bout.bic_encode_u16_cm(sub_idx, sub_gap_len, 0, 255);

3147  for

(

unsigned i

= 0;

i

< sub_gap_len; ++

i

)

3149  auto

block_idx = sub_idx[

i

];

3156

bout.put_bits(

head

, 1);

3159  for

(

unsigned

j = 1; j <

len

; ++j)

3161

bout.gamma8(gap_block[j]);

3171

bout.gamma8(tail_delta);

3172

bout.bic_encode_u16(&gap_block[2],

len

-3, min_v, max_v);

3180  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0); (void) enc_size;

3182

compression_stat_[scode]++;

3187 template

<

class

BV>

3200  unsigned

s_cnt, r_cnt;

3204  auto

split_cnt = s_cnt + (r_cnt * 2);

3205  if

(split_cnt > bit_stat_.bc)

3213  unsigned char

scode =

3221  bool

no_gap_EOC = (r_cnt == 0);

3226  unsigned

s_g_size = unsigned(enc_pos1_s - enc_pos0);

3237  unsigned

enc_size2 = (unsigned)(p2 - p1);

3238  unsigned

g_size = (r_cnt == 1) ? 0

3240  bool

use_gamma = (g_size <= enc_size2);

3245  auto

p3_rl0 = enc.

get_pos

();

3248

!inverted,

true

, use_gamma,

false

);

3249  auto

p3_rl1 = enc.

get_pos

();

3250  unsigned

rl_g_size = unsigned(p3_rl1 - p3_rl0);

3256  for

(

unsigned i

= 0;

i

< r_cnt; ++

i

)

3259  BM_ASSERT

(

unsigned

(arr_rl[

i

]) + arr_r[

i

] <= 65535);

3261

arr_rl[

i

] += arr_r[

i

];

3267

!inverted,

true

, use_gamma,

false

);

3269  unsigned

enc_size3 = (unsigned)(p3 - p2);

3270  if

(enc_size3 > g_size)

3279  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

3281  if

((enc_size >= raw_size) || (enc_size >= bit_stat_.bit_model_d0_size_))

3286 #ifdef BM_DBG_SERIAL 3287

enc.

put_8

((

unsigned char

)0xFF);

3289

compression_stat_[scode]++;

3293 template

<

class

BV>

3300

bit_idx_arr_.data(), block, inverted);

3303  unsigned char

scode =

3315  bool

need_min_max = min_v && (dr_reduct > (3 * 256) || arr_len < 4);

3329

arr_len -= 2; min_v++; max_v--;

3330  arr

= &bit_idx_arr_[1];

3334  arr

= &bit_idx_arr_[0];

3335

min_v = 0; max_v = 65535;

3343  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

3345  if

(enc_size >= raw_size)

3352  if

(bit_stat_.d0 != ~0ull && enc_size > bit_stat_.bit_model_d0_size_)

3359

compression_stat_[scode]++;

3367 template

<

class

BV>

3373  bm::encoder

enc_try((

unsigned char

*)try_buf_, 65536);

3378  bool r

= interpolated_arr_bit_block_v3s(enc_try, block, inverted);

3382

s_size = size_t(enc_try_pos1 - enc_try_pos0);

3389  bool r

= interpolated_arr_bit_block_v3(enc, block, inverted);

3393  size_t

dr_size = size_t(enc_pos1 - enc_pos0);

3394  if

(s_size && (s_size < dr_size))

3413

encode_bit_digest(block, enc, bit_stat_.d0);

3420

bit_idx_arr_.data(), block, inverted);

3423  unsigned char

scode =

3435  if

(!inverted && min_v <= 0xFF && max_delta <= 0xFF)

3438

enc.

put_8

((

unsigned char

)min_v);

3439

enc.

put_8

((

unsigned char

)max_delta);

3449

bout.

bic_encode_u16

(&bit_idx_arr_[1], arr_len-2, min_v, max_v);

3453  unsigned

enc_size = (unsigned)(enc_pos1 - enc_pos0);

3455  if

(enc_size >= raw_size)

3459  if

(bit_stat_.d0 != ~0ull && enc_size > bit_stat_.bit_model_d0_size_)

3463

compression_stat_[scode]++;

3470

encode_bit_digest(block, enc, bit_stat_.d0);

3476 #define BM_SER_NEXT_GRP(enc, nb, B_1ZERO, B_8ZERO, B_16ZERO, B_32ZERO, B_64ZERO) \ 3478  enc.put_8(B_1ZERO); \ 3479  else if (nb < 256u) \ 3481  enc.put_8(B_8ZERO); \ 3482  enc.put_8((unsigned char)nb); \ 3484  else if (nb < 65536u) \ 3486  enc.put_8(B_16ZERO); \ 3487  enc.put_16((unsigned short)nb); \ 3489  else if (nb < bm::id_max32) \ 3491  enc.put_8(B_32ZERO); \ 3492  enc.put_32(unsigned(nb)); \ 3496  enc.put_8(B_64ZERO); \ 3501 template

<

class

BV>

3509  if

(bookm.ptr_ && nb_delta >= bookm.nb_range_)

3511  unsigned char

* curr = enc.get_pos();

3512  size_t

bytes_delta = size_t(curr - bookm.ptr_);

3513  if

(bytes_delta > bookm.min_bytes_range_)

3515

enc.set_pos(bookm.ptr_);

3516  switch

(bookm.bm_type_)

3519

bytes_delta -=

sizeof

(unsigned);

3520  if

(bytes_delta < 0xFFFFFFFF)

3521

enc.put_32(

unsigned

(bytes_delta));

3525

bytes_delta -= (

sizeof

(unsigned)-1);

3526  if

(bytes_delta < 0xFFFFFF)

3527

enc.put_24(

unsigned

(bytes_delta));

3530

bytes_delta -=

sizeof

(

unsigned

short);

3531  if

(bytes_delta < 0xFFFF)

3532

enc.put_16((

unsigned short

)bytes_delta);

3541  if

(nb_delta < 0xFF)

3544

enc.put_8((

unsigned char

) nb_delta);

3547  if

(nb_delta < 0xFFFF)

3550

enc.put_16((

unsigned short

) nb_delta);

3553  if

(nb_delta < 0xFFFFFF)

3556

enc.put_24(

unsigned

(nb_delta));

3559  if

(nb_delta < ~0

U

)

3562

enc.put_32(

unsigned

(nb_delta));

3567  if

(nb_delta < 0xFFFFFFFFFFFFUL)

3570

enc.put_48(nb_delta);

3575

enc.put_64(nb_delta);

3587

bookm.ptr_ = enc.get_pos() + 1;

3588  switch

(bookm.bm_type_)

3610 template

<

class

BV>

3613  unsigned char

*

buf

,

size_t

buf_size)

3617  if

(allow_stat_reset_)

3618

reset_compression_stats();

3622

enc_header_pos_ = 0;

3623

encode_header(bv, enc);

3627  unsigned

i_last = ~0u;

3637  if

(i0 < bman.top_block_size())

3644

process_bookmark(

i

, sb_bookmark, enc);

3654

sub_stat.

init

((

void

*)&bv, i0);

3656  bool

is_sparse_sub =

3657

bman.is_sparse_sblock(i0, sparse_cutoff_, sub_stat);

3660  if

((compression_level_ >= 5) && (ref_vect_ == 0))

3662  if

(is_sparse_sub && sub_stat.

bv_count

< 65536)

3665

bienc_arr_sblock(bv, i0, enc);

3672  unsigned

ibc = unsigned(sub_max_bc - sub_stat.

bv_count

);

3681

bienc_gaps_sblock(bv, i0, sub_stat, enc);

3703  const bm::word_t

* blk = bman.get_block(i0, j0);

3723

enc.

set_pos

(enc_header_pos_);

3724

enc.

put_8

(header_flag_);

3729  if

(nb > 1 && nb < 128)

3732  unsigned char

c = (

unsigned

char)((1u << 7) | nb);

3759  bm::word_t

*** blk_root = bman.top_blocks_root();

3766  const bm::word_t

* blk_next = bman.get_block(i0, j0);

3798  bool

nb_indexed = sim_model_->bv_blocks.test(

i

);

3803  size_type

rank = sim_model_->bv_blocks.count_range(0,

i

);

3807

sim_model_->matr.get(ref_idx_, rank);

3809  switch

(mchain.

match

)

3817  size_type

plain_idx = ref_vect_->get_row_idx(ridx);

3819

enc.

put_32

(

unsigned

(plain_idx));

3829

xor_tmp_product(blk, mchain, i0, j0);

3835  size_type

plain_idx = ref_vect_->get_row_idx(ridx);

3855

encode_xor_match_chain(enc, mchain);

3857

blk = xor_tmp_block_;

3871

encode_gap_block(

BMGAP_PTR

(blk), enc);

3881  unsigned char

model = find_bit_best_encoding(blk, sub_stat,

i

);

3891  unsigned

bit_idx = 0;

3904

encode_bit_array(blk, enc,

false

);

3907

encode_bit_array(blk, enc,

true

);

3910

gamma_gap_bit_block(blk, enc);

3913

encode_bit_interval(blk, enc, 0);

3916

gamma_arr_bit_block(blk, enc,

false

);

3919

gamma_arr_bit_block(blk, enc,

true

);

3922

bienc_arr_bit_block(blk, enc,

false

);

3925

bienc_arr_bit_block(blk, enc,

true

);

3928

interpolated_arr_bit_block(blk, enc,

false

);

3931

interpolated_arr_bit_block(blk, enc,

true

);

3934

interpolated_gap_bit_block(blk, enc);

3937

interpolated_gap_bit_block(blk, enc);

3940

encode_bit_digest(blk, enc, bit_stat_.d0);

3962

enc.

set_pos

(enc_header_pos_);

3963

enc.

put_8

(header_flag_);

4019 template

<

class

BV>

4021  unsigned char

*

buf

,

4053 template

<

class

BV>

4055  unsigned char

*

buf

,

4085 template

<

class

BV>

4087  const unsigned char

*

buf

,

4094  unsigned char

header_flag = dec.

get_8

();

4101  if

(bo_current == bo)

4148 template

<

class

BV>

4150  const unsigned char

*

buf

,

4151  typename

BV::size_type from,

4152  typename

BV::size_type to,

4158  unsigned char

header_flag = dec.

get_8

();

4165  if

(bo_current == bo)

4196

bv.keep_range(from, to);

4200 template

<

typename

DEC,

typename

BLOCK_IDX>

4203  unsigned

block_type,

4229  if

(k == 0) --bit_idx;

4232

dst_arr[k] = bit_idx;

4245

dst_arr[

len

-1] = max_v;

4253

min_v = (

len

& 1) ?

4256

max_v = (

len

& (1<<1)) ?

4265

dst_arr[

len

-1] = max_v;

4272  throw

std::logic_error(err_msg());

4274

BM_THROW(BM_ERR_SERIALFORMAT);

4280 template

<

typename

DEC,

typename

BLOCK_IDX>

4284  unsigned

block_type)

4293

min_v = dec.get_16();

4294

max_v = dec.get_16();

4297

min_v = dec.get_8();

4298

max_delta = dec.get_8();

4305  unsigned

s_cnt, r_cnt;

4326

bin.

decode_array

(arr_rl, this->tb_wflags_, &s_cnt, r_cnt);

4337  for

(

unsigned i

= 0;

i

< r_cnt; ++

i

)

4340

arr_rl[

i

] -= arr_r[

i

];

4347  #ifdef BM_DBG_SERIAL 4348  unsigned char

control = dec.get_8();

4349  if

(control != 0xFF)

4351

std::cerr <<

"SERIALIZATION INTEGRITY 2!"

<< std::endl;

4353  throw

std::logic_error(err_msg());

4355

BM_THROW(BM_ERR_SERIALFORMAT);

4371  bool

need_min_max = bin.

get_bits

(1);

4387

min_v = 0; max_v = 65535;

4406

arr_len = dec.get_16();

4420 template

<

typename

DEC,

typename

BLOCK_IDX>

4423  unsigned

block_type,

4427  unsigned len

(0), sb_flag(0);

4435

sb_flag = dec.get_8();

4438

*sb_idx = dec.get_32();

4440

*sb_idx = dec.get_16();

4442

*sb_idx = dec.get_8();

4452  throw

std::logic_error(err_msg());

4454

BM_THROW(BM_ERR_SERIALFORMAT);

4460

min_v = dec.get_32();

4462

min_v = dec.get_24();

4464

min_v = dec.get_16();

4466

min_v = dec.get_8();

4471

max_v = dec.get_32();

4473

max_v = dec.get_24();

4475

max_v = dec.get_16();

4477

max_v = dec.get_8();

4483  bool

use_gamma = bin.

get_bit

();

4485

min0 = bin.

gamma

();

4490

dst_arr[

len

-1] = max_v;

4517  unsigned

j = bin.

gamma

();

4519

min_v = (j * 65536) + nbit;

4546  auto

min0_code = bin.

gamma

();

4550

min0 = bin.

gamma

();

4564

*sb_idx = bin.

gamma

()-1;

4573

dst_arr[

len

-1] = max_v;

4587  throw

std::logic_error(err_msg());

4589

BM_THROW(BM_ERR_SERIALFORMAT);

4596 template

<

typename

DEC,

typename

BLOCK_IDX>

4604

this->read_bic_arr(

decoder

, blk, block_type);

4608 template

<

typename

DEC,

typename

BLOCK_IDX>

4615  unsigned

arr_len = dec.get_16();

4619

id_array_[0] =

head

;

4620

id_array_[1] = min_v;

4621

id_array_[arr_len] = 65535;

4631 template

<

typename

DEC,

typename

BLOCK_IDX>

4659

block[off+j+0] |= dec.get_32();

4660

block[off+j+1] |= dec.get_32();

4661

block[off+j+2] |= dec.get_32();

4662

block[off+j+3] |= dec.get_32();

4671 template

<

typename

DEC,

typename

BLOCK_IDX>

4679  unsigned char

run_type = dec.get_8();

4682  unsigned

run_length = dec.get_16();

4685  unsigned

run_end = j + run_length;

4687  for

(;j < run_end; ++j)

4689  unsigned

w = dec.get_32();

4702 template

<

typename

BIN>

4722 template

<

typename

BIN>

4734

max_v <<= 3; max_v |= (head_v3 & 0b111);

4744 template

<

typename

DEC,

typename

BLOCK_IDX>

4747  unsigned

block_type,

4757

*dst_block = gap_head;

4788  unsigned

arr_len = read_id_list(

decoder

, block_type, id_array_);

4798  unsigned len

= (gap_head >> 3);

4801

*dst_block = gap_head;

4807  for

(

unsigned i

= 1;

i

<

len

; ++

i

)

4811

*(++gap_data_ptr) = gap_sum;

4818  unsigned len

= (gap_head >> 3);

4819

*dst_block = gap_head;

4821

dst_block[1] = min_v;

4830  unsigned len

= (gap_head >> 3);

4844

dst_block[0] = gap_head;

4845

dst_block[1] = min_v;

4848

dst_block[

len

-1] = max_v;

4861  unsigned len

= (gap_head >> 3);

4870

dst_block[0] = gap_head;

4871

dst_block[1] = min_v;

4873

dst_block[

len

-1] = max_v;

4886  unsigned char

head_v3 = (

unsigned

char) bin.

get_bits

(8);

4888  unsigned len

= (gap_head >> 3);

4891  unsigned

ex0_cnt{0};

4899  for

(

unsigned

k = 2; k <

len

; ++k)

4903  BM_ASSERT

(dst_block[k] > dst_block[k-1]);

4912

dst_block[1] = min_v;

4915

dst_block[

len

-1] = max_v+1;

4921

bin.

decode_array

(&ex0_arr[0], this->tb_wflags_, &ex0_cnt);

4924  for

(

unsigned

k = 0; k < ex0_cnt; ++k)

4931

bin.

decode_array

(&ex0_arr[0], this->tb_wflags_, &ex0_cnt);

4934  for

(

unsigned

k = 0; k < ex0_cnt; ++k)

4944

dst_block[1] = min_v;

4947

dst_block[

len

-1] = max_v+1;

4954 #ifdef BM_DBG_SERIAL 4956  if

(control != 0xFF)

4958

std::cerr <<

"SERIALIZATION INTEGRITY!"

<< std::endl;

4960  throw

std::logic_error(err_msg());

4962

BM_THROW(BM_ERR_SERIALFORMAT);

4970  if

(

cnt

!= cnt_saved)

4972

std::cerr <<

"SERIALIZATION INTEGRITY!"

<< std::endl;

4974  throw

std::logic_error(err_msg());

4976

BM_THROW(BM_ERR_SERIALFORMAT);

4990  unsigned

start_flag = bin.

get_bit

();

4991  unsigned

use_gamma = bin.

get_bit

();

4999  for

(

unsigned i

= 2;

i

<

len

; ++

i

)

5004  prev

= dst_block[

i

];

5009  for

(

unsigned i

= 1;

i

<

len

; ++

i

)

5012  BM_ASSERT

(

i

==1 || (dst_block[

i

-1] < dst_block[

i

]));

5022  throw

std::logic_error(err_msg());

5024

BM_THROW(BM_ERR_SERIALFORMAT);

5036 template

<

typename

DEC,

typename

BLOCK_IDX>

5047  if

(save_pos > skip_pos_)

5096  if

(nb_sync <= expect_nb)

5110 template

<

class

BV,

class

DEC>

5133 template

<

class

BV,

class

DEC>

5136

alloc_.free_bit_block(temp_block_);

5138

alloc_.free_bit_block(xor_block_, 2);

5146 template

<

class

BV,

class

DEC>

5150  if

(ref_vect_ && !xor_block_)

5151

xor_block_ = alloc_.alloc_bit_block(2);

5154 template

<

class

BV,

class

DEC>

5166  bool

inv_flag =

false

;

5169

bman.reserve_top_blocks(i0+1);

5170

bman.check_alloc_top_subblock(i0);

5179

(

sizeof

(

gap_word_t

) == 2 ? dec.get_16() : dec.get_32());

5186

*gap_temp_block = gap_head;

5187

dec.get_16(gap_temp_block+1,

len

- 1);

5192

blk = bman.get_allocator().alloc_bit_block();

5193

bman.set_block(nb, blk);

5200

bv.combine_operation_block_or(i0, j0, blk, temp_block_);

5211

bman.get_allocator().alloc_gap_block(

unsigned

(level), bman.glen());

5213

*gap_blk_ptr = gap_head;

5219

dec.get_16(gap_blk + 1,

len

- 1);

5225

*gap_temp_block = gap_head;

5226

dec.get_16(gap_temp_block + 1,

len

- 1);

5243  unsigned

arr_len = this->read_id_list(dec, btype, this->id_array_);

5244

gap_temp_block[0] = 0;

5255

bv.combine_operation_block_or(i0, j0, blk, temp_block_);

5261

gap_head = dec.get_16();

5268

this->read_gap_block(dec, btype, gap_temp_block, gap_head);

5273

gap_head = dec.get_16();

5274

this->read_gap_block(dec, btype, gap_temp_block, gap_head);

5278

this->read_gap_block(dec, btype, gap_temp_block, gap_head);

5282

this->read_gap_block(dec, btype, gap_temp_block, gap_head);

5286

this->read_gap_block(dec, btype, gap_temp_block, gap_head);

5291  throw

std::logic_error(this->err_msg());

5293

BM_THROW(BM_ERR_SERIALFORMAT);

5301

blk = bman.get_allocator().alloc_bit_block();

5303

bman.set_block_ptr(i0, j0, blk);

5308

bv.combine_operation_block_or(i0, j0, blk, temp_block_);

5315

bv.combine_operation_block_or(i0, j0, blk, tmp_blk);

5319 template

<

class

BV,

class

DEC>

5328

blk = bman.get_allocator().alloc_bit_block();

5329

bman.set_block(nb, blk);

5334

blk = bman.deoptimize_block(nb);

5342

blk = bman.deoptimize_block(nb);

5346  for

(

unsigned

k = 0; k <

len

; ++k)

5358

this->read_bic_arr(dec, blk, btype);

5365

blk = bman.deoptimize_block(nb);

5368

this->read_bic_arr(dec, temp_block_, btype);

5373

this->read_bic_gap(dec, blk);

5376

this->read_digest0_block(dec, blk);

5381  throw

std::logic_error(this->err_msg());

5383

BM_THROW(BM_ERR_SERIALFORMAT);

5388 template

<

class

BV,

class

DEC>

5394  unsigned

*

arr

= this->sb_id_array_;

5396  unsigned len

= this->read_bic_sb_arr(dec, btype,

arr

, &sb);

5399  typename

BV::size_type from = sb * sb_max_bc;

5402  for

(

typename

BV::size_type

i

= 0;

i

<

len

; ++

i

)

5404  typename

BV::size_type idx = from +

arr

[

i

];

5407  if

(idx < idx_from_)

5409

bv.set_bit_no_check(idx);

5414  for

(

typename

BV::size_type

i

= 0;

i

<

len

; ++

i

)

5416  typename

BV::size_type idx = from +

arr

[

i

];

5417

bv.set_bit_no_check(idx);

5423 template

<

class

BV,

class

DEC>

5432

blk = bman.get_allocator().alloc_bit_block();

5433

bman.set_block(nb, blk);

5439

bv.combine_operation_with_block(nb, temp_block_, 0,

BM_OR

);

5443 template

<

class

BV,

class

DEC>

5449  unsigned

head_idx = dec.get_16();

5450  unsigned

tail_idx = dec.get_16();

5454

blk = bman.get_allocator().alloc_bit_block();

5455

bman.set_block(nb, blk);

5456  for

(

unsigned

k = 0; k < head_idx; ++k)

5458

dec.get_32(blk + head_idx, tail_idx - head_idx + 1);

5465

dec.get_32(temp_block_ + head_idx, tail_idx - head_idx + 1);

5466

bv.combine_operation_with_block(nb, temp_block_, 0,

BM_OR

);

5470 template

<

class

BV,

class

DEC>

5480

blk = bman.deoptimize_block(nb);

5486

blk = bman.get_allocator().alloc_bit_block();

5488

bman.set_block(nb, blk);

5493  for

(

unsigned

k = 0; k <

len

; ++k)

5499  for

(

unsigned

k = 0; k <

len

; ++k)

5508 template

<

class

BV,

class

DEC>

5510  const unsigned char

*

buf

,

5514  if

(!bman.is_init())

5516  auto

bc = bman.compute_top_block_size(

bm::id_max

-1);

5522  typename

bvector_type::mem_pool_guard mp_guard_bv;

5523

mp_guard_bv.assign_if_not_set(pool_, bv);

5530  unsigned char

header_flag = dec.get_8();

5540  throw

std::logic_error(this->err_msg());

5542

BM_THROW(BM_ERR_SERIALFORMAT);

5559

bv_size = dec.get_32();

5560  if

(bv_size > bv.size())

5563  for

(

unsigned cnt

= dec.get_32();

cnt

; --

cnt

)

5569  return

dec.size()-1;

5589  throw

std::logic_error(this->err_msg());

5591

BM_THROW(BM_ERR_SERIALFORMAT);

5596

bv_size = dec.get_32();

5597  if

(bv_size > bv.size())

5604

xor_block_ = alloc_.alloc_bit_block();

5615  unsigned

row_idx(0);

5619  unsigned char

btype;

5623 size_t

dec_last_size = dec.size();

5624

std::cout <<

"size="

<< dec_last_size;

5636

btype = dec.get_8();

5637  if

(btype & (1 << 7))

5639

nb = btype & ~(1 << 7);

5645  bm::word_t

* blk = bman.get_block_ptr(i0, j0);

5647 auto

dec_size = dec.size();

5648

std::cout <<

"_sz="

<< (dec_size - dec_last_size);

5649

std::cout <<

" ["

<< unsigned(btype) <<

", "

<< nb_i <<

"]"

<< std::flush;

5650

dec_last_size = dec_size;

5684  throw

std::logic_error(this->err_msg());

5686

BM_THROW(BM_ERR_SERIALFORMAT);

5695

bman.set_block_all_set(nb_i);

5698

full_blocks = dec.get_8();

5699  goto

process_full_blocks;

5702

full_blocks = dec.get_16();

5703  goto

process_full_blocks;

5706

full_blocks = dec.get_32();

5707  goto

process_full_blocks;

5711

full_blocks = dec.get_64();

5712  goto

process_full_blocks;

5717  throw

std::logic_error(this->err_msg());

5719

BM_THROW(BM_ERR_SERIALFORMAT);

5722

process_full_blocks:

5727

bv.set_range(from, to-1);

5728

nb_i += full_blocks-1;

5732

decode_block_bit(dec, bv, nb_i, blk);

5738

bv.set_bit_no_check(bit_idx);

5744

this->read_0runs_block(dec, temp_block);

5745

bv.combine_operation_with_block(nb_i, temp_block, 0,

BM_OR

);

5749

decode_block_bit_interval(dec, bv, nb_i, blk);

5767

deserialize_gap(btype, dec, bv, bman, nb_i, blk);

5770

decode_arrbit(dec, bv, nb_i, blk);

5781

decode_bit_block(btype, dec, bman, nb_i, blk);

5784

decode_bit_block(btype, dec, bman, nb_i, blk);

5790

decode_arr_sblock(btype, dec, bv);

5801

this->bookmark_idx_ = nb_i;

5802

this->skip_offset_ = dec.get_32();

5803  goto

process_bookmark;

5805

this->bookmark_idx_ = nb_i;

5806

this->skip_offset_ = dec.get_24();

5807  goto

process_bookmark;

5809

this->bookmark_idx_ = nb_i;

5810

this->skip_offset_ = dec.get_16();

5814

this->skip_pos_ = dec.get_pos() + this->skip_offset_;

5816

nb_from = this->try_skip(dec, nb_i, nb_from);

5823

nb_sync = dec.get_8();

5824  goto

process_nb_sync;

5826

nb_sync = dec.get_16();

5827  goto

process_nb_sync;

5829

nb_sync = dec.get_24();

5830  goto

process_nb_sync;

5832

nb_sync = dec.get_32();

5833  goto

process_nb_sync;

5836  goto

process_nb_sync;

5840  BM_ASSERT

(nb_i == this->bookmark_idx_ + nb_sync);

5841  if

(nb_i != this->bookmark_idx_ + nb_sync)

5844  throw

std::logic_error(this->err_msg());

5846

BM_THROW(BM_ERR_SERIALFORMAT);

5859

row_idx = dec.get_32();

5860  size_type

idx = ref_vect_->find(row_idx);

5861  if

(idx == ref_vect_->not_found())

5870  const bm::word_t

* ref_blk = ref_bman.get_block_ptr(i0, j0);

5872

bv.combine_operation_with_block(nb_i, ref_blk,

5880

row_idx = dec.get_8();

5886

row_idx = dec.get_16();

5893

row_idx = dec.get_32();

5896

x_ref_d64_ = dec.get_64();

5901

x_ref_idx_ = ref_vect_->find(row_idx);

5903  if

(x_ref_idx_ == ref_vect_->not_found())

5911

or_block_ = bman.deoptimize_block(nb_i);

5912

bman.set_block_ptr(nb_i, 0);

5913

or_block_idx_ = nb_i;

5920

row_idx = dec.get_8();

5922  goto

process_xor_ref;

5926

row_idx = dec.get_16();

5928  goto

process_xor_ref;

5932

row_idx = dec.get_32();

5934  goto

process_xor_ref;

5939  unsigned char

vbr_flag = dec.get_8();

5942  case

1: row_idx = dec.get_8();

break

;

5943  case

2: row_idx = dec.get_16();

break

;

5944  case

0: row_idx = dec.get_32();

break

;

5947  bm::id64_t

acc64 = x_ref_d64_ = dec.get_h64(); (void) acc64;

5949

xor_chain_size_ = dec.get_8();

5951  for

(

unsigned

ci = 0; ci < xor_chain_size_; ++ci)

5955  case

1: xor_chain_[ci].ref_idx = dec.get_8();

break

;

5956  case

2: xor_chain_[ci].ref_idx = dec.get_16();

break

;

5957  case

0: xor_chain_[ci].ref_idx = dec.get_32();

break

;

5960

xor_chain_[ci].xor_d64 = dec.get_h64();

5962  BM_ASSERT

((xor_chain_[ci].xor_d64 & acc64) == 0);

5963

acc64 |= xor_chain_[ci].xor_d64;

5966  goto

process_xor_ref;

5972  throw

std::logic_error(this->err_msg());

5974

BM_THROW(BM_ERR_SERIALFORMAT);

5986

bv.set_new_blocks_strat(strat);

5988

bman.shrink_top_blocks();

5995 template

<

class

BV,

class

DEC>

6002  for

(

unsigned

ci = 0; ci < xor_chain_size_; ++ci)

6004  unsigned

ref_idx = (unsigned)ref_vect_->find(xor_chain_[ci].ref_idx);

6014

ref_blk = xor_block_;

6026 template

<

class

BV,

class

DEC>

6035  const bvector_type

* ref_bv = ref_vect_->get_bv(x_ref_idx_);

6040

ref_blk = ref_bman.get_block_ptr(i0, j0);

6042  BM_ASSERT

(!or_block_ || or_block_idx_ == x_nb_);

6048  bm::word_t

* blk = bman.deoptimize_block(i0, j0,

true

);

6052

alloc_.free_bit_block(or_block_);

6056

bman.set_block_ptr(x_nb_, or_block_);

6058

or_block_ = 0; or_block_idx_ = 0;

6061  if

(xor_chain_size_)

6063  bm::word_t

* blk = bman.deoptimize_block(i0, j0,

true

);

6064

xor_decode_chain(blk);

6075  bm::word_t

* blk = bman.get_block_ptr(i0, j0);

6077  if

(

BM_IS_GAP

(blk) && (x_ref_d64_==~0ULL) && !or_block_)

6088

bman.assign_gap_check(i0, j0, res, ++res_len, blk, tmp_buf);

6095

ref_blk = xor_block_;

6103  bm::word_t

* blk = bman.deoptimize_block(i0, j0,

true

);

6108  if

(xor_chain_size_)

6109

xor_decode_chain(blk);

6121

alloc_.free_bit_block(or_block_);

6134  if

(nb_from == x_nb_ || nb_to == x_nb_)

6137

bman.optimize_bit_block_nocheck(i0, j0);

6142 template

<

class

BV,

class

DEC>

6145

x_ref_idx_ = 0; x_ref_d64_ = 0; xor_chain_size_ = 0;

6151 template

<

typename

DEC,

typename

BLOCK_IDX>

6155

end_of_stream_(

false

),

6244  throw

std::bad_alloc();

6246

BM_THROW(BM_ERR_BADALLOC);

6253  if

(!this->ex0_arr_ || !this->ex1_arr_)

6256  throw

std::bad_alloc();

6258

BM_THROW(BM_ERR_BADALLOC);

6265 template

<

typename

DEC,

typename

BLOCK_IDX>

6277 template

<

typename

DEC,

typename

BLOCK_IDX>

6293

end_of_stream_ =

true

;

6297

last_id_ = decoder_.get_32();

6304

end_of_stream_ =

true

;

6309

block_type_ = decoder_.get_8();

6313  if

(block_type_ & (1u << 7u))

6315

mono_block_cnt_ = (block_type_ & ~(1u << 7u)) - 1;

6316

state_ = e_zero_blocks;

6320  switch

(block_type_)

6324

end_of_stream_ =

true

; state_ = e_unknown;

6327

state_ = e_zero_blocks;

6328

mono_block_cnt_ = 0;

6331

state_ = e_zero_blocks;

6332

mono_block_cnt_ = decoder_.get_8()-1;

6335

state_ = e_zero_blocks;

6336

mono_block_cnt_ = decoder_.get_16()-1;

6339

state_ = e_zero_blocks;

6340

mono_block_cnt_ = decoder_.get_32()-1;

6343

state_ = e_one_blocks;

6347

state_ = e_one_blocks;

6348

mono_block_cnt_ = 0;

6351

state_ = e_one_blocks;

6352

mono_block_cnt_ = decoder_.get_8()-1;

6355

state_ = e_one_blocks;

6356

mono_block_cnt_ = decoder_.get_16()-1;

6359

state_ = e_one_blocks;

6360

mono_block_cnt_ = decoder_.get_32()-1;

6363

state_ = e_one_blocks;

6381

state_ = e_bit_block;

6390

gap_head_ = decoder_.get_16();

6409

state_ = e_gap_block;

6418

state_ = e_gap_block;

6421

state_ = e_gap_block;

6427

this->bookmark_idx_ = block_idx_;

6428

this->skip_offset_ = decoder_.get_32();

6429

this->skip_pos_ = decoder_.get_pos() + this->skip_offset_;

6432

this->bookmark_idx_ = block_idx_;

6433

this->skip_offset_ = decoder_.get_24();

6434

this->skip_pos_ = decoder_.get_pos() + this->skip_offset_;

6437

this->bookmark_idx_ = block_idx_;

6438

this->skip_offset_ = decoder_.get_16();

6439

this->skip_pos_ = decoder_.get_pos() + this->skip_offset_;

6443

nb_sync = decoder_.get_8();

6444  goto

process_nb_sync;

6446

nb_sync = decoder_.get_16();

6447  goto

process_nb_sync;

6449

nb_sync = decoder_.get_24();

6450  goto

process_nb_sync;

6452

nb_sync = decoder_.get_32();

6453  goto

process_nb_sync;

6456  goto

process_nb_sync;

6460  BM_ASSERT

(block_idx_ == this->bookmark_idx_ + nb_sync);

6461  if

(block_idx_ != this->bookmark_idx_ + nb_sync)

6464  throw

std::logic_error(this->err_msg());

6466

BM_THROW(BM_ERR_SERIALFORMAT);

6494  throw

std::logic_error(this->err_msg());

6496

BM_THROW(BM_ERR_SERIALFORMAT);

6505  if

(!mono_block_cnt_)

6517  throw

std::logic_error(this->err_msg());

6519

BM_THROW(BM_ERR_SERIALFORMAT);

6524 template

<

typename

DEC,

typename

BLOCK_IDX>

6528  BM_ASSERT

(state_ == e_zero_blocks || state_ == e_one_blocks);

6529  if

(!mono_block_cnt_)

6533

block_idx_ += mono_block_cnt_+1;

6534

mono_block_cnt_ = 0;

6540 template

<

typename

DEC,

typename

BLOCK_IDX>

6548  for

(

unsigned

k = 0; k <

len

; ++k)

6556  for

(

unsigned

k = 0; k <

len

; ++k)

6562 template

<

typename

DEC,

typename

BLOCK_IDX>

6570  BM_ASSERT

(this->state_ == e_bit_block);

6573  switch

(this->block_type_)

6582  unsigned char

run_type = decoder_.get_8();

6585  unsigned

run_length = decoder_.get_16();

6588

decoder_.get_32(dst_block ? dst_block + j : dst_block, run_length);

6596  unsigned

head_idx = decoder_.get_16();

6597  unsigned

tail_idx = decoder_.get_16();

6600  for

(

unsigned i

= 0;

i

< head_idx; ++

i

)

6602

decoder_.get_32(dst_block + head_idx,

6603

tail_idx - head_idx + 1);

6609  int

pos =

int

(tail_idx - head_idx) + 1;

6617

get_arr_bit(dst_block,

true

);

6622  throw

std::logic_error(this->err_msg());

6624

BM_THROW(BM_ERR_SERIALFORMAT);

6628

get_inv_arr(dst_block);

6636

this->read_bic_arr(decoder_, dst_block, this->block_type_);

6641

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

6648

this->read_bic_gap(decoder_, dst_block);

6653

this->read_digest0_block(decoder_, dst_block);

6658  throw

std::logic_error(this->err_msg());

6660

BM_THROW(BM_ERR_SERIALFORMAT);

6666 template

<

typename

DEC,

typename

BLOCK_IDX>

6672  BM_ASSERT

(this->state_ == e_bit_block);

6674  switch

(block_type_)

6681  unsigned

head_idx = decoder_.get_16();

6682  unsigned

tail_idx = decoder_.get_16();

6683  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

6684

dst_block[

i

] |= decoder_.get_32();

6689  unsigned char

run_type = decoder_.get_8();

6692  unsigned

run_length = decoder_.get_16();

6695  unsigned

run_end = j + run_length;

6696  for

(;j < run_end; ++j)

6699

dst_block[j] |= decoder_.get_32();

6711

get_arr_bit(dst_block,

false

);

6714

get_inv_arr(tmp_block);

6721

this->read_bic_arr(decoder_, dst_block, this->block_type_);

6726

this->read_bic_arr_inv(decoder_, tmp_block, this->block_type_);

6730

this->read_bic_gap(decoder_, dst_block);

6733

this->read_digest0_block(decoder_, dst_block);

6738  throw

std::logic_error(this->err_msg());

6740

BM_THROW(BM_ERR_SERIALFORMAT);

6746 template

<

typename

DEC,

typename

BLOCK_IDX>

6752  BM_ASSERT

(this->state_ == e_bit_block);

6755  switch

(block_type_)

6762  unsigned char

run_type = decoder_.get_8();

6765  unsigned

run_length = decoder_.get_16();

6767  unsigned

run_end = j + run_length;

6770  for

(;j < run_end; ++j)

6773

dst_block[j] &= decoder_.get_32();

6778  for

(;j < run_end; ++j)

6789  unsigned

head_idx = decoder_.get_16();

6790  unsigned

tail_idx = decoder_.get_16();

6792  for

(

i

= 0;

i

< head_idx; ++

i

)

6794  for

(

i

= head_idx;

i

<= tail_idx; ++

i

)

6795

dst_block[

i

] &= decoder_.get_32();

6802

get_arr_bit(tmp_block,

true

);

6807

get_inv_arr(tmp_block);

6818

this->read_bic_arr(decoder_, tmp_block, block_type_);

6822

this->read_bic_arr(decoder_, 0, block_type_);

6827

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

6836

this->read_bic_gap(decoder_, tmp_block);

6840

this->read_bic_gap(decoder_, 0);

6847

this->read_digest0_block(decoder_, tmp_block);

6851

this->read_digest0_block(decoder_, 0);

6856  throw

std::logic_error(this->err_msg());

6858

BM_THROW(BM_ERR_SERIALFORMAT);

6864 template

<

typename

DEC,

typename

BLOCK_IDX>

6870  BM_ASSERT

(this->state_ == e_bit_block);

6874  switch

(block_type_)

6878

dst_block[

i

] ^= decoder_.get_32();

6882  unsigned char

run_type = decoder_.get_8();

6885  unsigned

run_length = decoder_.get_16();

6888  unsigned

run_end = j + run_length;

6889  for

(;j < run_end; ++j)

6892

dst_block[j] ^= decoder_.get_32();

6904  unsigned

head_idx = decoder_.get_16();

6905  unsigned

tail_idx = decoder_.get_16();

6906  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

6907

dst_block[

i

] ^= decoder_.get_32();

6913

get_arr_bit(tmp_block,

true

);

6918

get_inv_arr(tmp_block);

6927

this->read_bic_arr(decoder_, tmp_block, block_type_);

6934

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

6946

this->read_bic_gap(decoder_, tmp_block);

6950

this->read_bic_gap(decoder_, 0);

6957

this->read_digest0_block(decoder_, tmp_block);

6961

this->read_digest0_block(decoder_, 0);

6966  throw

std::logic_error(this->err_msg());

6968

BM_THROW(BM_ERR_SERIALFORMAT);

6974 template

<

typename

DEC,

typename

BLOCK_IDX>

6980  BM_ASSERT

(this->state_ == e_bit_block);

6984  switch

(block_type_)

6988

dst_block[

i

] &= ~decoder_.get_32();

6992  unsigned char

run_type = decoder_.get_8();

6995  unsigned

run_length = decoder_.get_16();

6998  unsigned

run_end = j + run_length;

6999  for

(;j < run_end; ++j)

7002

dst_block[j] &= ~decoder_.get_32();

7014  unsigned

head_idx = decoder_.get_16();

7015  unsigned

tail_idx = decoder_.get_16();

7016  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

7017

dst_block[

i

] &= ~decoder_.get_32();

7023

get_arr_bit(tmp_block,

true

);

7028

get_inv_arr(tmp_block);

7037

this->read_bic_arr(decoder_, tmp_block, block_type_);

7044

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7053

this->read_bic_gap(decoder_, tmp_block);

7057

this->read_bic_gap(decoder_, 0);

7064

this->read_digest0_block(decoder_, tmp_block);

7068

this->read_digest0_block(decoder_, 0);

7073  throw

std::logic_error(this->err_msg());

7075

BM_THROW(BM_ERR_SERIALFORMAT);

7082 template

<

typename

DEC,

typename

BLOCK_IDX>

7088  BM_ASSERT

(this->state_ == e_bit_block);

7091  switch

(block_type_)

7100  unsigned char

run_type = decoder_.get_8();

7103  unsigned

run_length = decoder_.get_16();

7106  unsigned

run_end = j + run_length;

7107  for

(;j < run_end; ++j)

7121  unsigned

head_idx = decoder_.get_16();

7122  unsigned

tail_idx = decoder_.get_16();

7123  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

7128  count

+= get_arr_bit(0);

7135

get_inv_arr(tmp_block);

7142

this->read_bic_arr(decoder_, tmp_block, block_type_);

7147

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7151

this->read_digest0_block(decoder_, tmp_block);

7155

this->read_bic_gap(decoder_, tmp_block);

7162  throw

std::logic_error(this->err_msg());

7164

BM_THROW(BM_ERR_SERIALFORMAT);

7171 template

<

typename

DEC,

typename

BLOCK_IDX>

7177  BM_ASSERT

(this->state_ == e_bit_block);

7185  switch

(block_type_)

7192  unsigned char

run_type = decoder_.get_8();

7195  unsigned

run_length = decoder_.get_16();

7198  unsigned

run_end = j + run_length;

7199  for

(;j < run_end; ++j)

7214  unsigned

head_idx = decoder_.get_16();

7215  unsigned

tail_idx = decoder_.get_16();

7216  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

7227

get_inv_arr(tmp_block);

7233

this->read_bic_arr(decoder_, tmp_block, block_type_);

7238

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7241

this->read_bic_gap(decoder_, tmp_block);

7244

this->read_digest0_block(decoder_, 0);

7249  throw

std::logic_error(this->err_msg());

7251

BM_THROW(BM_ERR_SERIALFORMAT);

7259 template

<

typename

DEC,

typename

BLOCK_IDX>

7265  BM_ASSERT

(this->state_ == e_bit_block);

7269  switch

(block_type_)

7278  unsigned char

run_type = decoder_.get_8();

7281  unsigned

run_length = decoder_.get_16();

7284  unsigned

run_end = j + run_length;

7285  for

(;j < run_end; ++j)

7299  unsigned

head_idx = decoder_.get_16();

7300  unsigned

tail_idx = decoder_.get_16();

7301  for

(

unsigned i

= head_idx;

i

<= tail_idx; ++

i

)

7308

get_arr_bit(tmp_block,

true

);

7312

get_inv_arr(tmp_block);

7320

this->read_bic_arr(decoder_, tmp_block, block_type_);

7325

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7329

this->read_digest0_block(decoder_, tmp_block);

7333

this->read_bic_gap(decoder_, tmp_block);

7340  throw

std::logic_error(this->err_msg());

7342

BM_THROW(BM_ERR_SERIALFORMAT);

7349 template

<

typename

DEC,

typename

BLOCK_IDX>

7355  BM_ASSERT

(this->state_ == e_bit_block);

7359  switch

(block_type_)

7376  unsigned char

run_type = decoder_.get_8();

7379  unsigned

run_length = decoder_.get_16();

7380  unsigned

run_end = j + run_length;

7383  for

(;j < run_end; ++j)

7391  for

(;j < run_end; ++j)

7402  unsigned

head_idx = decoder_.get_16();

7403  unsigned

tail_idx = decoder_.get_16();

7406  for

(

i

= 0;

i

< head_idx; ++

i

)

7408  for

(

i

= head_idx;

i

<= tail_idx; ++

i

)

7417

get_arr_bit(tmp_block,

true

);

7420

get_inv_arr(tmp_block);

7427

this->read_bic_arr(decoder_, tmp_block, block_type_);

7432

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7436

this->read_digest0_block(decoder_, tmp_block);

7440

this->read_bic_gap(decoder_, tmp_block);

7446  throw

std::logic_error(this->err_msg());

7448

BM_THROW(BM_ERR_SERIALFORMAT);

7452  return

count_adapter.

sum

();

7455 template

<

typename

DEC,

typename

BLOCK_IDX>

7461  BM_ASSERT

(this->state_ == e_bit_block);

7465  switch

(block_type_)

7482  unsigned char

run_type = decoder_.get_8();

7485  unsigned

run_length = decoder_.get_16();

7486  unsigned

run_end = j + run_length;

7489  for

(;j < run_end; ++j)

7497  for

(;j < run_end; ++j)

7508  unsigned

head_idx = decoder_.get_16();

7509  unsigned

tail_idx = decoder_.get_16();

7512  for

(

i

= 0;

i

< head_idx; ++

i

)

7514  for

(

i

= head_idx;

i

<= tail_idx; ++

i

)

7523

get_arr_bit(tmp_block,

true

);

7526

get_inv_arr(tmp_block);

7533

this->read_bic_arr(decoder_, tmp_block, block_type_);

7538

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7543

this->read_digest0_block(decoder_, tmp_block);

7547

this->read_bic_gap(decoder_, tmp_block);

7553  throw

std::logic_error(this->err_msg());

7555

BM_THROW(BM_ERR_SERIALFORMAT);

7559  return

count_adapter.

sum

();

7562 template

<

typename

DEC,

typename

BLOCK_IDX>

7568  BM_ASSERT

(this->state_ == e_bit_block);

7572  switch

(block_type_)

7589  unsigned char

run_type = decoder_.get_8();

7592  unsigned

run_length = decoder_.get_16();

7593  unsigned

run_end = j + run_length;

7596  for

(;j < run_end; ++j)

7604  for

(;j < run_end; ++j)

7615  unsigned

head_idx = decoder_.get_16();

7616  unsigned

tail_idx = decoder_.get_16();

7619  for

(

i

= 0;

i

< head_idx; ++

i

)

7621  for

(

i

= head_idx;

i

<= tail_idx; ++

i

)

7631

get_arr_bit(tmp_block,

true

);

7634

get_inv_arr(tmp_block);

7641

this->read_bic_arr(decoder_, tmp_block, block_type_);

7646

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7650

this->read_digest0_block(decoder_, tmp_block);

7654

this->read_bic_gap(decoder_, tmp_block);

7660  throw

std::logic_error(this->err_msg());

7662

BM_THROW(BM_ERR_SERIALFORMAT);

7666  return

count_adapter.

sum

();

7669 template

<

typename

DEC,

typename

BLOCK_IDX>

7675  BM_ASSERT

(this->state_ == e_bit_block);

7679  switch

(block_type_)

7696  unsigned char

run_type = decoder_.get_8();

7699  unsigned

run_length = decoder_.get_16();

7700  unsigned

run_end = j + run_length;

7703  for

(;j < run_end; ++j)

7718  unsigned

head_idx = decoder_.get_16();

7719  unsigned

tail_idx = decoder_.get_16();

7722  for

(

i

= head_idx;

i

<= tail_idx; ++

i

)

7730

get_arr_bit(tmp_block,

true

);

7733

get_inv_arr(tmp_block);

7740

this->read_bic_arr(decoder_, tmp_block, block_type_);

7745

this->read_bic_arr_inv(decoder_, tmp_block, block_type_);

7749

this->read_digest0_block(decoder_, tmp_block);

7753

this->read_bic_gap(decoder_, tmp_block);

7759  throw

std::logic_error(this->err_msg());

7761

BM_THROW(BM_ERR_SERIALFORMAT);

7764  return

count_adapter.

sum

();

7769 template

<

typename

DEC,

typename

BLOCK_IDX>

7790  for

(

unsigned

k = 0; k <

len

; ++k)

7802

decoder_.seek(

len

* 2);

7807 template

<

typename

DEC,

typename

BLOCK_IDX>

7811

++(this->block_idx_);

7812

this->state_ = e_blocks;

7814  return

decoder_.get_16();

7817 template

<

typename

DEC,

typename

BLOCK_IDX>

7821  BM_ASSERT

(this->state_ == e_gap_block ||

7825

this->read_gap_block(decoder_, block_type_, dst_block, gap_head_);

7827

++(this->block_idx_);

7828

this->state_ = e_blocks;

7832 template

<

typename

DEC,

typename

BLOCK_IDX>

7839  BM_ASSERT

(this->state_ == e_bit_block);

7841

get_bit_func_type bit_func = bit_func_table_[op];

7843  unsigned cnt

= ((*this).*(bit_func))(dst_block, tmp_block);

7844

this->state_ = e_blocks;

7845

++(this->block_idx_);

7854 template

<

class

BV>

7856

: temp_block_(0), ref_vect_(0)

7861 template

<

class

BV>

7865

alloc_.free_bit_block(temp_block_);

7872 template

<

class

BV>

7877  typename

BV::size_type

count

= 0;

7881

bv.bit_and(bv_tmp, BV::opt_compress);

7896  count

= bv_tmp.count();

7922

BM_THROW(BM_ERR_SERIALFORMAT);

7930 template

<

class

BV>

7933  const unsigned char

*

buf

,

7944  return

deserialize_xor(bv, bv_tmp, op);

7947 template

<

class

BV>

7950  const unsigned char

*

buf

,

7959  unsigned char

header_flag = dec.

get_8

();

7966  if

(bo_current == bo)

7968

de_.set_ref_vectors(ref_vect_);

7969

de_.set_range(idx_from, idx_to);

7970

de_.deserialize(bv,

buf

);

7997

bv.keep_range_no_check(idx_from, idx_to);

8002 template

<

class

BV>

8012

bv.bit_and(bv_tmp, bvector_type::opt_compress);

8024  count

= bv_tmp.count();

8047  throw

std::logic_error(

"BM: serialization error"

);

8049

BM_THROW(BM_ERR_SERIALFORMAT);

8058 template

<

class

BV>

8061  const unsigned char

*

buf

,

8067  unsigned char

header_flag = dec.

get_8

();

8072  return

deserialize_xor(bv,

buf

, op, exit_on_one);

8088  if

(bo_current == bo)

8093

de_.deserialize(bv,

buf

);

8097

bv_tmp_.clear(

true

);

8100

de_.deserialize(bv_tmp_,

buf

);

8112  if

(bo_current == bo)

8115  return

it_d_.deserialize(bv, ss, temp_block_, op, exit_on_one);

8122  return

it_d_be_.deserialize(bv, ss, temp_block_, op, exit_on_one);

8127  return

it_d_le_.deserialize(bv, ss, temp_block_, op, exit_on_one);

8132  throw

std::logic_error(

"BM::platform error: unknown endianness"

);

8134

BM_THROW(BM_ERR_SERIALFORMAT);

8139 template

<

class

BV>

8142  const unsigned char

*

buf

,

8148  unsigned char

header_flag = dec.

get_8

();

8156  if

(!bman.is_init())

8157

bv.set_range(idx_from, idx_to);

8166

deserialize_xor_range(bv_tmp,

buf

, idx_from, idx_to);

8169

bv.bit_and(bv_tmp, bvector_type::opt_compress);

8180  if

(bo_current == bo)

8182

bv_tmp_.clear(

true

);

8185

de_.set_range(idx_from, idx_to);

8186

de_.deserialize(bv_tmp_,

buf

);

8191

bv.bit_and(bv_tmp_, bvector_type::opt_compress);

8209  if

(bo_current == bo)

8212

it_d_.set_range(idx_from, idx_to);

8213

it_d_.deserialize(bv, ss, temp_block_, op,

false

);

8214

it_d_.unset_range();

8222

it_d_be_.set_range(idx_from, idx_to);

8223

it_d_be_.deserialize(bv, ss, temp_block_, op,

false

);

8224

it_d_be_.unset_range();

8230

it_d_le_.set_range(idx_from, idx_to);

8231

it_d_le_.deserialize(bv, ss, temp_block_, op,

false

);

8232

it_d_le_.unset_range();

8238  throw

std::logic_error(

"BM::platform error: unknown endianness"

);

8240

BM_THROW(BM_ERR_SERIALFORMAT);

8250 template

<

class

BV,

class

SerialIterator>

8254

is_range_set_ =

true

;

8260 template

<

class

BV,

class

SerialIterator>

8267  const unsigned

win_size = 64;

8272  for

(

unsigned i

= 0;

i

<= id_count;)

8275  for

(j = 0; j < win_size &&

i

<= id_count; ++j, ++

i

)

8277

id_buffer[j] = sit.get_id();

8285  for

(

unsigned i

= 0;

i

<= id_count;)

8288  for

(j = 0; j < win_size &&

i

<= id_count; ++j, ++

i

)

8290

id_buffer[j] = sit.get_id();

8298 template

<

class

BV,

class

SerialIterator>

8316  if

(bv_block_idx <= nblock_last)

8317

bman.set_all_zero(bv_block_idx, nblock_last);

8326  bm::word_t

*** blk_root = bman.top_blocks_root();

8327  unsigned

top_size = bman.top_block_size();

8328  for

(;

i

< top_size; ++

i

)

8341  count

+= bman.block_bitcount(blk_blk[j]);

8351  throw

std::logic_error(err_msg());

8353

BM_THROW(BM_ERR_SERIALFORMAT);

8359 template

<

class

BV,

class

SerialIterator>

8367  unsigned

id_count = sit.get_id_count();

8368  bool

set_clear =

true

;

8375

load_id_list(bv_tmp, sit, id_count,

true

);

8388

load_id_list(bv, sit, id_count, set_clear);

8391  for

(

unsigned i

= 0;

i

< id_count; ++

i

)

8399  for

(

unsigned i

= 0;

i

< id_count; ++

i

)

8412  count

+= bv.get_bit(

id

);

8420

load_id_list(bv_tmp, sit, id_count,

true

);

8428

load_id_list(bv_tmp, sit, id_count,

true

);

8436

load_id_list(bv_tmp, sit, id_count,

false

);

8437  count

+= bv_tmp.count();

8443

load_id_list(bv_tmp, sit, id_count,

true

);

8451  throw

std::logic_error(err_msg());

8453

BM_THROW(BM_ERR_SERIALFORMAT);

8461 template

<

class

BV,

class

SerialIterator>

8474

gap_temp_block[0] = 0;

8477  if

(!bman.is_init())

8480  if

(sit.bv_size() && (sit.bv_size() > bv.size()))

8481

bv.resize(sit.bv_size());

8483  typename

serial_iterator_type::iterator_state

state

;

8484  state

= sit.get_state();

8485  if

(

state

== serial_iterator_type::e_list_ids)

8487  count

= process_id_list(bv, sit, op);

8499  count

+= finalize_target_vector(bman, op, bv_block_idx);

8506  case

serial_iterator_type::e_blocks:

8511  if

(is_range_set_ && (bv_block_idx < nb_range_from_))

8514  bool

skip_flag = sit.try_skip(bv_block_idx, nb_range_from_);

8517

bv_block_idx = sit.block_idx();

8518  BM_ASSERT

(bv_block_idx <= nb_range_from_);

8519  BM_ASSERT

(sit.state() == serial_iterator_type::e_blocks);

8523  case

serial_iterator_type::e_bit_block:

8525  BM_ASSERT

(sit.block_idx() == bv_block_idx);

8528  bm::word_t

* blk = bman.get_block_ptr(i0, j0);

8541

blk = bman.make_bit_block(bv_block_idx);

8554  throw

std::logic_error(err_msg());

8556

BM_THROW(BM_ERR_SERIALFORMAT);

8573

blk = bman.deoptimize_block(bv_block_idx);

8579  unsigned

c = sit.get_bit_block(blk, temp_block, sop);

8581  if

(exit_on_one &&

count

)

8586

bman.optimize_bit_block(i0, j0, bvector_type::opt_compress);

8594  case

serial_iterator_type::e_zero_blocks:

8596  BM_ASSERT

(bv_block_idx == sit.block_idx());

8603

bv_block_idx = sit.skip_mono_blocks();

8609

bv_block_idx = sit.skip_mono_blocks();

8610

bman.set_all_zero(nb_start, bv_block_idx-1);

8621  bm::word_t

* blk = bman.get_block_ptr(i0, j0);

8632

bman.zero_block(bv_block_idx);

8646  count

+= blk ? bman.block_bitcount(blk) : 0;

8647  if

(exit_on_one &&

count

)

8659  case

serial_iterator_type::e_one_blocks:

8661  BM_ASSERT

(bv_block_idx == sit.block_idx());

8664  bm::word_t

* blk = bman.get_block_ptr(i0, j0);

8671

bman.set_block_all_set(bv_block_idx);

8679

bman.zero_block(bv_block_idx);

8683  if

(++empty_op_cnt > 64)

8686  bool b

= bv.find_reverse(last_id);

8690  if

(last_nb < bv_block_idx)

8696  count

+= blk ? bman.block_bitcount(blk) : 0;

8704

blk = bman.deoptimize_block(bv_block_idx);

8735

bman.set_block_all_set(bv_block_idx);

8749  if

(exit_on_one &&

count

)

8754  case

serial_iterator_type::e_gap_block:

8756  BM_ASSERT

(bv_block_idx == sit.block_idx());

8760  const bm::word_t

* blk = bman.get_block(i0, j0);

8762

sit.get_gap_block(gap_temp_block);

8780  if

(exit_on_one &&

count

)

8788

bman.zero_block(bv_block_idx);

8799

bv_block_idx, gap_temp_block, level);

8812

bv.combine_operation_with_block(bv_block_idx,

8820

bv.combine_operation_with_block(

8830

blk = bman.get_block_ptr(i0, j0);

8846  throw

std::logic_error(err_msg());

8848

BM_THROW(BM_ERR_SERIALFORMAT);

8855  if

(is_range_set_ && (bv_block_idx > nb_range_to_))

8869 #pragma warning( pop )

#define BM_DECLARE_TEMP_BLOCK(x)

Algorithms for bvector<> (main include)

#define IS_FULL_BLOCK(addr)

#define IS_VALID_ADDR(addr)

#define BMPTR_SETBIT0(ptr)

#define BMSET_PTRGAP(ptr)

#define FULL_BLOCK_FAKE_ADDR

#define FULL_BLOCK_REAL_ADDR

Bit manipulation primitives (internal)

#define BM_SER_NEXT_GRP(enc, nb, B_1ZERO, B_8ZERO, B_16ZERO, B_32ZERO, B_64ZERO)

Utilities for bit transposition (internal) (experimental!)

Bit manipulation primitives (internal)

Functions and utilities for XOR filters (internal)

Byte based reader for un-aligned bit streaming.

unsigned gamma() noexcept

decode unsigned value using Elias Gamma coding

unsigned get_24_no() noexcept

get 24 bits neutral order from the bit-stream

void bic_decode_u32_cm(bm::word_t *arr, unsigned sz, bm::word_t lo, bm::word_t hi) noexcept

Binary Interpolative array decode (32-bit)

unsigned delta16() noexcept

Custome variant of delta decoding.

unsigned delta16s() noexcept

Custome variant of delta decoding.

void bic_decode_u16(bm::gap_word_t *arr, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) noexcept

Binary Interpolative array decode.

unsigned gamma8() noexcept

decode unsigned value using Elias Gamma coding

void bic_decode_u16_dry(unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) noexcept

unsigned decode_array(bm::gap_word_t *arr, bm::word_t *tb_wflags, unsigned *sz, unsigned default_sz=0) noexcept

Selective array decode.

unsigned get_bit() noexcept

read 1 bit

unsigned get_16_no() noexcept

get 16 bits neutral order from the bit-stream

void bic_decode_u16_bitset(bm::word_t *block, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) noexcept

unsigned get_32_no() noexcept

get 32 bits neutral order from the bit-stream

unsigned get_bits(unsigned count) noexcept

read number of bits out of the stream

Byte based writer for un-aligned bit streaming.

void put_16_no(unsigned value) noexcept

put 16 bits neutral byte order

void put_32_no(unsigned value) noexcept

put 32 bits neutral byte order

void flush_if_full() noexcept

void delta16s(unsigned value) noexcept

Custome variant of delta encoding (safe for 8-bit values)

void encode_array(const bm::gap_word_t *arr, bm::gap_word_t *recalc_arr, bm::word_t *tb_wflags, bm::gap_word_t *tmp_arr, unsigned sz, bool one_flag, bool EOC_flag, unsigned force_code=0, bool save_size=true) noexcept

Selective array serialization (BIC encoding is used)

void put_24_no(unsigned value) noexcept

put 24 bits neutral byte order

void gamma(unsigned value) noexcept

Elias Gamma encode the specified value.

void bic_encode_u16(const bm::gap_word_t *arr, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) noexcept

Binary Interpolative array decode.

void bic_encode_u32_cm(const bm::word_t *arr, unsigned sz, bm::word_t lo, bm::word_t hi) noexcept

Binary Interpolative encoding (array of 32-bit ints) cm - "center-minimal".

void flush() noexcept

Flush the incomplete 32-bit accumulator word.

void delta16(unsigned value) noexcept

Custome variant of delta encoding.

void put_bits(unsigned value, unsigned count) noexcept

issue count bits out of value

void gamma8(unsigned value) noexcept

Elias Gamma encode the specified value.

Bit-block get adapter, takes bitblock and represents it as a get_32() accessor function.

Bit-block sum adapter, takes values and sums it /internal.

bm::word_t sum() const noexcept

Get accumulated sum.

List of reference bit-vectors with their true index associations.

const unsigned char * get_pos() const noexcept

Return current buffer pointer.

unsigned char get_8() noexcept

Reads character from the decoding buffer.

void set_pos(const unsigned char *pos) noexcept

Set current buffer pointer.

Class for decoding data from memory buffer.

bm::id64_t get_48() noexcept

Reads 64-bit word from the decoding buffer.

bm::id64_t get_64() noexcept

Reads 64-bit word from the decoding buffer.

bm::word_t get_24() noexcept

Reads 32-bit word from the decoding buffer.

bm::short_t get_16() noexcept

Reads 16-bit word from the decoding buffer.

bm::word_t get_32() noexcept

Reads 32-bit word from the decoding buffer.

Base deserialization class.

static void read_0runs_block(decoder_type &decoder, bm::word_t *blk) noexcept

read bit-block encoded as runs

const unsigned char * skip_pos_

decoder skip position

block_idx_type try_skip(decoder_type &decoder, block_idx_type nb, block_idx_type expect_nb) noexcept

Try to skip if skip bookmark is available within reach.

void read_bic_arr(decoder_type &decoder, bm::word_t *blk, unsigned block_type)

Read binary interpolated list into a bit-set.

bm::word_t * ex1_arr_

array for exceptions

bm::bit_block_t tb_wflags_

temp flags for sub-block DR compression

void read_bic_gap(decoder_type &decoder, bm::word_t *blk) noexcept

Read binary interpolated gap blocks into a bitset.

static const char * err_msg() noexcept

block_idx_type bookmark_idx_

last bookmark block index

unsigned skip_offset_

bookmark to skip 256 encoded blocks

void read_digest0_block(decoder_type &decoder, bm::word_t *blk) noexcept

Read digest0-type bit-block.

void read_bic_arr_inv(decoder_type &decoder, bm::word_t *blk, unsigned block_type) noexcept

Read inverted binary interpolated list into a bit-set.

bm::bit_in< DEC > bit_in_type

unsigned * sb_id_array_

ptr to super-block idx array (temp)

unsigned read_bic_sb_arr(decoder_type &decoder, unsigned block_type, unsigned *dst_arr, unsigned *sb_idx)

Read list of bit ids for super-blocks.

void read_gap_block(decoder_type &decoder, unsigned block_type, bm::gap_word_t *dst_block, bm::gap_word_t &gap_head)

Read GAP block from the stream.

bm::word_t * ex0_arr_

array for exceptions

unsigned read_id_list(decoder_type &decoder, unsigned block_type, bm::gap_word_t *dst_arr)

Read list of bit ids.

bm::gap_word_t * id_array_

ptr to idx array for temp decode use

Deserializer for bit-vector.

void xor_reset() noexcept

void set_ref_vectors(const bv_ref_vector_type *ref_vect)

Attach collection of reference vectors for XOR de-serialization (no transfer of ownership for the poi...

block_arridx_type bit_idx_arr_

allocator_type::allocator_pool_type allocator_pool_type

void xor_decode_chain(bm::word_t *blk) noexcept

void xor_decode(blocks_manager_type &bman)

deseriaizer_base< DEC, block_idx_type > parent_type

bm::bv_ref_vector< BV > bv_ref_vector_type

void decode_arr_sblock(unsigned char btype, decoder_type &dec, bvector_type &bv)

void reset() noexcept

reset range deserialization and reference vectors

void deserialize_gap(unsigned char btype, decoder_type &dec, bvector_type &bv, blocks_manager_type &bman, block_idx_type nb, bm::word_t *blk)

bvector_type::allocator_type allocator_type

parent_type::decoder_type decoder_type

void unset_range() noexcept

Disable range deserialization.

allocator_pool_type pool_

sblock_arridx_type sb_bit_idx_arr_

BV::blocks_manager_type blocks_manager_type

void set_range(size_type from, size_type to) noexcept

set deserialization range [from, to] This is NOT exact, approximate range, content outside range is n...

block_arridx_type gap_temp_block_

size_t deserialize(bvector_type &bv, const unsigned char *buf, bm::word_t *temp_block=0)

bvector_type::block_idx_type block_idx_type

void decode_arrbit(decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)

void decode_bit_block(unsigned char btype, decoder_type &dec, blocks_manager_type &bman, block_idx_type nb, bm::word_t *blk)

void decode_block_bit(decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)

void decode_block_bit_interval(decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)

void move_from(encoder &enc) noexcept

Move content from another encoder.

unsigned char * position_type

void put_prefixed_array_32(unsigned char c, const bm::word_t *w, unsigned count) noexcept

Encode 8-bit prefix + an array.

void put_16(bm::short_t s) noexcept

Puts short word (16 bits) into the encoding buffer.

void put_32(bm::word_t w) noexcept

Puts 32 bits word into encoding buffer.

void put_64(bm::id64_t w) noexcept

Puts 64 bits word into encoding buffer.

size_t size() const noexcept

Returns size of the current encoding stream.

void put_8(unsigned char c) noexcept

Puts one character into the encoding buffer.

void set_pos(unsigned char *buf_pos) noexcept

Set current memory stream position.

unsigned char * get_pos() const noexcept

Get current memory stream position.

void put_8_16_32(unsigned w, unsigned char c8, unsigned char c16, unsigned char c32) noexcept

but gat plus value based on its VBR evaluation

Functor for Elias Gamma encoding.

value_type * data() const noexcept

void resize(size_type new_size)

vector resize

Iterator to walk forward the serialized stream.

void set_range(size_type from, size_type to)

set deserialization range [from, to]

void unset_range() noexcept

disable range filtration

SerialIterator serial_iterator_type

BV::blocks_manager_type blocks_manager_type

bvector_type::size_type size_type

size_type deserialize(bvector_type &bv, serial_iterator_type &sit, bm::word_t *temp_block, set_operation op=bm::set_OR, bool exit_on_one=false)

static void load_id_list(bvector_type &bv, serial_iterator_type &sit, unsigned id_count, bool set_clear)

load data from the iterator of type "id list"

bvector_type::block_idx_type block_idx_type

static size_type process_id_list(bvector_type &bv, serial_iterator_type &sit, set_operation op)

Process (obsolete) id-list serialization format.

static const char * err_msg() noexcept

static size_type finalize_target_vector(blocks_manager_type &bman, set_operation op, size_type bv_block_idx)

Finalize the deserialization (zero target vector tail or bit-count tail)

Deserializer, performs logical operations between bit-vector and serialized bit-vector.

bm::iterator_deserializer< BV, serial_stream_le > it_d_le_

little-endian stream iterator

bm::bv_ref_vector< BV > bv_ref_vector_type

void set_ref_vectors(const bv_ref_vector_type *ref_vect)

Attach collection of reference vectors for XOR serialization (no transfer of ownership for the pointe...

void deserialize_range(bvector_type &bv, const unsigned char *buf, size_type idx_from, size_type idx_to)

BV::blocks_manager_type blocks_manager_type

BV::allocator_type allocator_type

bm::deserializer< BV, bm::decoder_little_endian > deserializer_le

~operation_deserializer()

bvector_type::block_idx_type block_idx_type

serial_stream_iterator< bm::decoder_little_endian, block_idx_type > serial_stream_le

void deserialize_xor_range(bvector_type &bv, const unsigned char *buf, size_type idx_from, size_type idx_to)

size_type deserialize(bvector_type &bv, const unsigned char *buf, set_operation op, bool exit_on_one=false)

Deserialize bvector using buffer as set operation argument.

void deserialize_range(bvector_type &bv, const unsigned char *buf, bm::word_t *, size_type idx_from, size_type idx_to)

bvector_type::size_type size_type

const bv_ref_vector_type * ref_vect_

xor ref.vector

size_type deserialize(bvector_type &bv, const unsigned char *buf, bm::word_t *, set_operation op=bm::set_OR, bool exit_on_one=false)

Obsolete! Deserialize bvector using buffer as set operation argument.

bm::deserializer< BV, bm::decoder_big_endian > deserializer_be

deserializer< BV, bm::decoder > de_

serial_stream_iterator< bm::decoder_big_endian, block_idx_type > serial_stream_be

bm::iterator_deserializer< BV, serial_stream_be > it_d_be_

big-endian stream iterator

size_type deserialize_xor(bvector_type &bv, const unsigned char *buf, set_operation op, bool exit_on_one)

bm::iterator_deserializer< BV, serial_stream_current > it_d_

default stream iterator (same endian)

serial_stream_iterator< bm::decoder, block_idx_type > serial_stream_current

static size_type deserialize_xor(bvector_type &bv, bvector_type &bv_tmp, set_operation op)

Serialization stream iterator.

bm::id_t last_id_

Last id from the id list.

unsigned get_bit_block_COUNT_B(bm::word_t *dst_block, bm::word_t *tmp_block)

deseriaizer_base< DEC, block_idx_type > parent_type

deseriaizer_base< DEC, BLOCK_IDX >::decoder_type decoder_type

unsigned char header_flag_

decoder_type & decoder()

Get low level access to the decoder (use carefully)

unsigned get_id_count() const noexcept

Number of ids in the inverted list (valid for e_list_ids)

void get_inv_arr(bm::word_t *block) noexcept

void next()

get next block

serial_stream_iterator(const unsigned char *buf)

block_idx_type mono_block_cnt_

number of 0 or 1 blocks

unsigned block_type_

current block type

block_idx_type skip_mono_blocks() noexcept

skip all zero or all-one blocks

unsigned get_bit_block_SUB(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_COUNT_SUB_AB(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_AND(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_COUNT_SUB_BA(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_COUNT_OR(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_COUNT(bm::word_t *dst_block, bm::word_t *tmp_block)

bool is_eof() const

Returns true if end of bit-stream reached.

unsigned get_bit() noexcept

block_idx_type block_idx_

current block index

unsigned get_bit_block_XOR(bm::word_t *dst_block, bm::word_t *tmp_block)

iterator_state get_state() const noexcept

unsigned get_bit_block_OR(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_ASSIGN(bm::word_t *dst_block, bm::word_t *tmp_block)

block_idx_type block_idx() const noexcept

Get current block index.

gap_word_t * block_idx_arr_

unsigned get_arr_bit(bm::word_t *dst_block, bool clear_target=true) noexcept

Get array of bits out of the decoder into bit block (Converts inverted list into bits) Returns number...

iterator_state state() const noexcept

Returns iterator internal state.

unsigned get_bit_block_COUNT_A(bm::word_t *dst_block, bm::word_t *tmp_block)

~serial_stream_iterator()

gap_word_t glevels_[bm::gap_levels]

GAP levels.

iterator_state

iterator is a state machine, this enum encodes its key value

@ e_bit_block

one bit block

@ e_list_ids

plain int array

@ e_zero_blocks

one or more zero bit blocks

@ e_one_blocks

one or more all-1 bit blocks

@ e_blocks

stream of blocks

void get_gap_block(bm::gap_word_t *dst_block)

Read gap block data (with head)

get_bit_func_type bit_func_table_[bm::set_END]

unsigned id_cnt_

Id counter for id list.

unsigned get_bit_block_COUNT_XOR(bm::word_t *dst_block, bm::word_t *tmp_block)

unsigned get_bit_block_COUNT_AND(bm::word_t *dst_block, bm::word_t *tmp_block)

bm::id_t get_id() const noexcept

Get last id from the id list.

block_idx_type bv_size() const

serialized bitvector size

unsigned get_bit_block(bm::word_t *dst_block, bm::word_t *tmp_block, set_operation op)

read bit block, using logical operation

Bit-vector serialization class.

unsigned compression_level_

void xor_tmp_product(const bm::word_t *s_block, const block_match_chain_type &mchain, unsigned i, unsigned j) noexcept

Compute digest based XOR product, place into tmp XOR block.

unsigned char find_gap_best_encoding(const bm::gap_word_t *gap_block) noexcept

Determine best representation for GAP block based on current set compression level.

void serialize(const BV &bv, typename serializer< BV >::buffer &buf, const statistics_type *bv_stat=0)

Bitvector serialization into buffer object (resized automatically)

void interpolated_gap_array(const bm::gap_word_t *gap_block, unsigned arr_len, bm::encoder &enc, bool inverted) noexcept

Encode GAP block as an array with binary interpolated coder.

size_type ref_idx_

current reference index

void set_sim_model(const xor_sim_model_type *sim_model) noexcept

Atach XOR similarity model (must be computed by the same ref vector)

bm::gamma_encoder< bm::gap_word_t, bit_out_type > gamma_encoder_func

serializer(bm::word_t *temp_block)

bm::bit_out< bm::encoder > bit_out_type

bm::word_t * gap_recalc_tmp_block1_

tmp area for GAP reduction

bool interpolated_arr_bit_block_v3s(bm::encoder &enc, const bm::word_t *block, bool inverted)

void set_sparse_cutoff(unsigned cutoff) noexcept

Fine tuning for Binary Interpolative Compression (levels 5+) The parameter sets average population co...

bm::heap_vector< bm::gap_word_t, allocator_type, true > block_arridx_type

unsigned bit_model_d0_size_

memory (bytes) by d0 method (bytes)

allocator_type::allocator_pool_type allocator_pool_type

bm::word_t * idx_arr_

temp space for bit-block decode into idxs

void reset_compression_stats() noexcept

Reset all accumulated compression statistics.

void gamma_gap_block(const bm::gap_word_t *gap_block, bm::encoder &enc) noexcept

unsigned char * enc_header_pos_

pos of top level header to roll back

bool bienc_gap_bit_block_enc(unsigned len, bm::encoder &enc) noexcept

encode bit-block as interpolated bit block of gaps

void reset_models() noexcept

void encode_bit_array(const bm::word_t *block, bm::encoder &enc, bool inverted) noexcept

Encode bit-block as an array of bits.

bvector_type::block_idx_type block_idx_type

bvector_type::size_type size_type

void gamma_gap_bit_block(const bm::word_t *block, bm::encoder &enc) noexcept

unsigned char find_bit_best_encoding_l5(const bm::word_t *block, const bm::bv_sub_survey &sub_stat, block_idx_type nb) noexcept

Determine best representation for a bit-block (level 5)

size_type * compression_stat_

void interpolated_encode_gap_block_v3s(const bm::gap_word_t *gap_block, bm::encoder &enc, unsigned len)

allocator_pool_type pool_

bm::bv_ref_vector< BV > bv_ref_vector_type

unsigned char header_flag_

set of masks used to save

unsigned char models_[bm::block_waves]

void encode_bit_interval(const bm::word_t *blk, bm::encoder &enc, unsigned size_control) noexcept

Encode BIT block with repeatable runs of zeroes.

bm::xor_scanner< BV > xor_scan_

scanner for XOR similarity

void gamma_gap_array(const bm::gap_word_t *gap_block, unsigned arr_len, bm::encoder &enc, bool inverted=false) noexcept

Encode GAP block as delta-array with Elias Gamma coder.

void set_bookmarks(bool enable, unsigned bm_interval=256) noexcept

Add skip-markers to serialization BLOB for faster range decode at the expense of some BLOB size incre...

void encode_xor_match_chain(bm::encoder &enc, const block_match_chain_type &mchain) noexcept

Encode XOR match chain.

void byte_order_serialization(bool value) noexcept

Set byte-order serialization (for cross platform compatibility)

void interpolated_gap_array_v0(const bm::gap_word_t *gap_block, unsigned arr_len, bm::encoder &enc, bool inverted) noexcept

void optimize_serialize_destroy(BV &bv, typename serializer< BV >::buffer &buf)

Bitvector serialization into buffer object (resized automatically) Input bit-vector gets optimized an...

bm::word_t * gap_ex1_tmp_block_

tmp area for GAP reduction

bvector_type::allocator_type allocator_type

byte_buffer< allocator_type > buffer

block_arridx_type bit_idx_arr_

unsigned ibc

inverse bit-count

bool bic_drange_

bic dynamic range compression flag

void set_compression_level(unsigned clevel) noexcept

Set compression level.

bm::heap_vector< unsigned, allocator_type, true > sblock_arridx_type

bool compute_sim_model(xor_sim_model_type &sim_model, const bv_ref_vector_type &ref_vect, const bm::xor_sim_params &params)

Calculate XOR similarity model for ref_vector refernece vector must be associated before.

void set_bic_dynamic_range_reduce(bool flag) noexcept

enable/disable dynamic range reduction for BIC compression where possible.

bm::word_t * xor_tmp_block_

tmp area for xor product

float bie_bits_per_int_

default coefficient for choosing BIC coding (2.2)

static void process_bookmark(block_idx_type nb, bookmark_state &bookm, bm::encoder &enc) noexcept

Check if bookmark needs to be placed and if so, encode it into serialization BLOB.

bool allow_stat_reset_

controls zeroing of telemetry

bvector_type::blocks_manager_type blocks_manager_type

unsigned bit_model_0run_size_

memory (bytes) by run-0 method (bytes)

void encode_gap_block(const bm::gap_word_t *gap_block, bm::encoder &enc)

void bienc_gap_bit_block(const bm::word_t *block, bm::encoder &enc) noexcept

encode bit-block as interpolated bit block of gaps

serializer(const serializer &)

bool free_

flag to free the input vector

void interpolated_gap_bit_block(const bm::word_t *block, bm::encoder &enc) noexcept

encode bit-block as interpolated gap block

struct bm::serializer::@939 bit_stat_

saved bit-block statistics (mostly for debugging)

bm::word_t * gap_ex0_tmp_block_

tmp area for GAP reduction

xor_sim_model_type::block_match_chain_type block_match_chain_type

void bienc_arr_bit_block(const bm::word_t *block, bm::encoder &enc, bool inverted) noexcept

bool optimize_

flag to optimize the input vector

void encode_bit_digest(const bm::word_t *blk, bm::encoder &enc, bm::id64_t d0) noexcept

Encode bit-block using digest (hierarchical compression)

void allow_stat_reset(bool allow) noexcept

Enable/disable statistics reset on each serilaization.

serializer(const allocator_type &alloc=allocator_type(), bm::word_t *temp_block=0)

Constructor.

void add_model(unsigned char mod, unsigned score) noexcept

bm::word_t * tb_wflags_

temp flags for sub-block DR compression

unsigned char find_bit_best_encoding(const bm::word_t *block, const bm::bv_sub_survey &sub_stat, block_idx_type nb) noexcept

Determine best representation for a bit-block.

sblock_arridx_type sb_bit_idx_arr_

bool interpolated_arr_bit_block_v3(bm::encoder &enc, const bm::word_t *block, bool inverted)

const bv_ref_vector_type * ref_vect_

ref.vector for XOR compression

const xor_sim_model_type * sim_model_

similarity model matrix

void gap_length_serialization(bool value) noexcept

Set GAP length serialization (serializes GAP levels of the original vector)

void bienc_gaps_sblock(const BV &bv, unsigned sb, const bm::bv_sub_survey &sub_stat, bm::encoder &enc) noexcept

bm::xor_sim_model< BV > xor_sim_model_type

bool sb_bookmarks_

Bookmarks flag.

void interpolated_arr_bit_block(const bm::word_t *block, bm::encoder &enc, bool inverted)

void set_bic_coeff(float bie_bits_per_int) noexcept

Coeffcicient to help choose if bit-block should be encoded using binary interpolative coder.

void bienc_arr_sblock(const BV &bv, unsigned sb, bm::encoder &enc) noexcept

unsigned sparse_cutoff_

number of bits per blocks to consider sparse

void gamma_arr_bit_block(const bm::word_t *block, bm::encoder &enc, bool inverted) noexcept

bm::word_t * try_buf_

temp space for trying alternative compressors

const size_type * get_compression_stat() const noexcept

Return serialization counter vector.

bm::word_t * gap_recalc_tmp_block0_

tmp area for GAP reduction

unsigned sb_range_

Desired bookmarks interval.

bvector_type::statistics statistics_type

bool interpolated_encode_gap_block_v3(const bm::gap_word_t *gap_block, bm::encoder &enc, unsigned len)

serializer & operator=(const serializer &)

void set_ref_vectors(const bv_ref_vector_type *ref_vect)

Attach collection of reference vectors for XOR serialization (no transfer of ownership for the pointe...

void encode_header(const BV &bv, bm::encoder &enc) noexcept

Encode serialization header information.

void set_curr_ref_idx(size_type ref_idx) noexcept

Set current index in rer.vector collection (not a row idx or plain idx)

unsigned scores_[bm::block_waves]

size_type serialize(const BV &bv, unsigned char *buf, size_t buf_size)

Bitvector serialization into memory block.

void alloc_temp_buffers()

Allocate serialization temp buffers.

unsigned get_compression_level() const noexcept

Get current compression level.

void interpolated_encode_gap_block(const bm::gap_word_t *gap_block, bm::encoder &enc, unsigned len)

XOR scanner to search for complement-similarities in collections of bit-vectors.

static vector< string > arr

Encoding utilities for serialization (internal)

static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

bm::id_t bit_block_count(const bm::word_t *block) noexcept

Bitcount for bit block.

unsigned bit_count_nonzero_size(const T *blk, unsigned data_size) noexcept

Inspects block for full zero words.

unsigned word_bitcount64(bm::id64_t x) noexcept

bm::id_t bit_operation_sub_count(const bm::word_t *src1, const bm::word_t *src2) noexcept

Performs bitblock SUB operation and calculates bitcount of the result.

bm::id64_t bit_block_xor(bm::word_t *dst, const bm::word_t *src) noexcept

Plain bitblock XOR operation. Function does not analyse availability of source and destination blocks...

bm::id_t word_bitcount(bm::id_t w) noexcept

void bit_invert(T *start) noexcept

bool bit_block_or(bm::word_t *dst, const bm::word_t *src) noexcept

Plain bitblock OR operation. Function does not analyse availability of source and destination blocks.

bm::id64_t bit_block_and(bm::word_t *dst, const bm::word_t *src) noexcept

Plain bitblock AND operation. Function does not analyse availability of source and destination blocks...

unsigned bit_block_convert_to_arr(T *dest, const unsigned *src, bool inverted) noexcept

Convert bit block into an array of ints corresponding to 1 bits.

void bit_block_rle_split(T *dst_s, T *dst_r, T *rlen, unsigned &s_cnt, unsigned &r_cnt, const unsigned *src, bool inverted) noexcept

Convert bit block into two arrays of ints( corresponding to 1 bits)

unsigned bit_block_find(const bm::word_t *block, unsigned nbit, unsigned *pos) noexcept

Searches for the next 1 bit in the BIT block.

void bit_block_set(bm::word_t *dst, bm::word_t value) noexcept

Bitblock memset operation.

void bit_block_copy(bm::word_t *dst, const bm::word_t *src) noexcept

Bitblock copy operation.

void clear_bit(unsigned *dest, unsigned bitpos) noexcept

Set 1 bit in a block.

void set_bit(unsigned *dest, unsigned bitpos) noexcept

Set 1 bit in a block.

bm::id_t bit_operation_xor_count(const bm::word_t *src1, const bm::word_t *src2) noexcept

Performs bitblock XOR operation and calculates bitcount of the result.

void bit_block_rle_set(unsigned *blk, const T *s, const T *r, const T *rlen, unsigned s_cnt, unsigned r_cnt) noexcept

Set bits using rle split scheme (reverse of bit_block_rle_split)

bm::id_t bit_operation_or_count(const bm::word_t *src1, const bm::word_t *src2) noexcept

Performs bitblock OR operation and calculates bitcount of the result.

bm::id64_t calc_block_digest0(const bm::word_t *const block) noexcept

Compute digest for 64 non-zero areas.

bm::id_t bit_operation_and_count(const bm::word_t *src1, const bm::word_t *src2) noexcept

Performs bitblock AND operation and calculates bitcount of the result.

bm::id64_t bit_block_sub(bm::word_t *dst, const bm::word_t *src) noexcept

Plain bitblock SUB (AND NOT) operation. Function does not analyse availability of source and destinat...

operation

Bit operations.

set_operation

Codes of set operations.

strategy

Block allocation strategies.

@ BM_GAP

GAP compression is ON.

size_t serialize(const BV &bv, unsigned char *buf, bm::word_t *temp_block=0, unsigned serialization_flags=0)

Saves bitvector into memory.

serialization_flags

Bit mask flags for serialization algorithm.

size_t deserialize(BV &bv, const unsigned char *buf, bm::word_t *temp_block=0, const bm::bv_ref_vector< BV > *ref_vect=0)

Bitvector deserialization from a memory BLOB.

void deserialize_range(BV &bv, const unsigned char *buf, typename BV::size_type from, typename BV::size_type to, const bm::bv_ref_vector< BV > *ref_vect=0)

Bitvector range deserialization from a memory BLOB.

@ BM_NO_GAP_LENGTH

save no GAP info (save some space)

@ BM_NO_BYTE_ORDER

save no byte-order info (save some space)

distance_metric

Distance metrics codes defined for vectors A and B.

distance_metric operation2metric(set_operation op) noexcept

Convert set operation into compatible distance metric.

@ COUNT_XOR

(A ^ B).count()

@ COUNT_SUB_BA

(B - A).count()

gap_word_t * gap_operation_xor(const gap_word_t *vect1, const gap_word_t *vect2, gap_word_t *tmp_buf, unsigned &dsize) noexcept

GAP XOR operation.

void gap_invert(T *buf) noexcept

Inverts all bits in the GAP buffer.

void gap_add_to_bitset(unsigned *dest, const T *pcurr, unsigned len) noexcept

Adds(OR) GAP block to bitblock.

void set_gap_level(T *buf, int level) noexcept

Sets GAP block capacity level.

unsigned gap_set_array(T *buf, const T *arr, unsigned len) noexcept

Convert array to GAP buffer.

unsigned gap_bit_count(const T *buf, unsigned dsize=0) noexcept

Calculates number of bits ON in GAP buffer.

void gap_convert_to_bitset(unsigned *dest, const T *buf, unsigned len=0) noexcept

GAP block to bitblock conversion.

unsigned gap_bit_count_unr(const T *buf) noexcept

Calculates number of bits ON in GAP buffer. Loop unrolled version.

unsigned gap_set_value(unsigned val, T *buf, unsigned pos) noexcept

Sets or clears bit in the GAP buffer.

bool gap_split(const T *buf, unsigned len, unsigned h_limit, const unsigned *hist0, const unsigned *hist1, T *tbuf, T *ex0_arr, T *ex1_arr, unsigned &ex0_cnt, unsigned &ex1_cnt) noexcept

split GAP block into pure GAPs and exceptions

int gap_calc_level(unsigned len, const T *glevel_len) noexcept

Calculates GAP block capacity level.

bool arr_calc_delta_min(const T *arr, unsigned arr_len, T &min0) noexcept

calculate minimal delta between monotonic growing numbers

void gap_calc_mins(const T *buf, T &min0, T &min1) noexcept

minimal delta sizes

void gap_calc_hist(const T *buf, unsigned len, unsigned *hist0, unsigned *hist1, unsigned hist_len) noexcept

compute histogram of exceptions on GAP block

void gap_restore_mins(T *buf, T min0, T min1) noexcept

Restore GAP block using two minimal GAP lens.

T gap_recalc_mins(T *tbuf, const T *buf, T min0, T min1) noexcept

Recalculate GAP block using two minimal GAP lens.

bm::gap_word_t gap_length(const bm::gap_word_t *buf) noexcept

Returs GAP block length.

void gap_set_all(T *buf, unsigned set_max, unsigned value) noexcept

Sets all bits to 0 or 1 (GAP)

D gap_convert_to_arr(D *dest, const T *buf, unsigned dest_len, bool invert=false) noexcept

Convert gap block into array of ints corresponding to 1 bits.

unsigned gap_add_value(T *buf, unsigned pos) noexcept

Add new value to the end of GAP buffer.

unsigned int

A callback function used to compare two keys in a database.

BV::size_type count_and(const BV &bv1, const BV &bv2) noexcept

Computes bitcount of AND operation of two bitsets.

void combine_sub(BV &bv, It first, It last)

SUB Combine bitvector and the iterable sequence.

bm::distance_metric_descriptor::size_type count_xor(const BV &bv1, const BV &bv2) noexcept

Computes bitcount of XOR operation of two bitsets.

BV::size_type count_sub(const BV &bv1, const BV &bv2) noexcept

Computes bitcount of SUB operation of two bitsets.

void combine_or(BV &bv, It first, It last)

OR Combine bitvector and the iterable sequence.

BV::size_type count_or(const BV &bv1, const BV &bv2) noexcept

Computes bitcount of OR operation of two bitsets.

const unsigned char set_block_ref_eq

block is a copy of a reference block

const unsigned char set_block_xor_ref32_um

..... 32-bit (should never happen)

const unsigned set_block_digest_wave_size

const unsigned char set_block_gap

Plain GAP block.

BV::size_type process_operation(BV &bv, BV &bv_tmp, bm::set_operation op)

Utility function to process operation using temp vector.

const unsigned char set_block_arrbit_inv

List of bits OFF.

const unsigned char set_nb_sync_mark8

bookmark sync point (8-bits)

const unsigned sblock_flag_max16

const unsigned sblock_flag_sb16

16-bit SB index (8-bit by default)

const unsigned char set_block_bit_interval

Interval block.

const unsigned char set_sblock_bienc_v3

super-block interpolated list v3

const unsigned char set_block_bit_digest0

H-compression with digest mask.

const unsigned char set_block_xor_ref32

..... 32-bit (should never happen)

const unsigned char set_block_arrgap_bienc_inv_v2

Interpolated GAP array (inverted)

const unsigned char set_block_bitgap_bienc

Interpolated bit-block as GAPs.

unsigned char check_pair_vect_vbr(const BMChain &mchain, const RVect &ref_vect)

Check effective bit-rate for the XOR encode vector.

const unsigned char set_block_arrgap_egamma_inv

Gamma compressed inverted delta GAP array.

const unsigned char set_block_arr_bienc_inv_v3

Interpolated array (v3)

void bit_recomb(It1 &it1, It2 &it2, BinaryOp &op, Encoder &enc, unsigned block_size=bm::set_block_size) noexcept

const unsigned set_block_mask

const unsigned short h3f_min0_8bit

min0 is not applied

const unsigned char set_sblock_bienc_gaps_v3

super-block of sparse GAPs

unsigned gamma_size(const T v) noexcept

Compute gamma size( in bytes)

T arr_recalc_min(T *tarr, const T *arr, unsigned arr_len, T min0, T delta_acc=0) noexcept

Recalculate array using minimal delta for better BIC compression.

const unsigned sblock_flag_sbgamma

const unsigned char set_block_arr_bienc_inv

Interpolated inverted block int array.

const unsigned set_sub_array_size

void get_block_coord(BI_TYPE nb, unsigned &i, unsigned &j) noexcept

Recalc linear bvector block index into 2D matrix coordinates.

const unsigned char set_block_gap_egamma_v3

Gamma compressed GAP block (v3)

const unsigned sblock_flag_sb32

32-bit SB index

bool check_block_zero(const bm::word_t *blk, bool deep_scan) noexcept

Checks all conditions and returns true if block consists of only 0 bits.

bm::gap_word_t recalc_tail_delta(bm::gap_word_t tail_delta, bm::gap_word_t &head, unsigned char &head_v3) noexcept

recalculate tail_delta for VBR compression: if tail_delta < 2048 then part of it (3 bits) is stored i...

const unsigned char set_block_16one

UP to 65536 all-set blocks.

const unsigned short h2f_max_v_8bit

min_v is 1 char, 8-bit (0 - 16-bit)

unsigned char compute_min_flags(bm::gap_word_t min0, bm::gap_word_t min1, unsigned char head_v3) noexcept

compute bienc_v3 serialization flags

bool is_const_set_operation(bm::set_operation op) noexcept

Returns true if set operation is constant (bitcount)

const unsigned short h3f_min1_8bit

min0 is 1 char, 8-bit (0 - 16-bit)

void encode_mins(BOUT &bout, unsigned head_v3, bm::gap_word_t min0, bm::gap_word_t min1) noexcept

save drange compression info

const unsigned char set_block_gap_bienc_v3s

Interpolated GAP array (v3)

const unsigned set_total_blocks

const unsigned char set_nb_sync_mark48

const unsigned char set_block_arrgap_bienc

Interpolated GAP array.

ByteOrder

Byte orders recognized by the library.

const unsigned char set_block_8one

Up to 256 all-set blocks.

const unsigned char set_nb_sync_mark16

const unsigned char set_block_32one

UP to 4G all-set blocks.

const unsigned char set_block_arr_bienc_v3

Interpolated array (v3)

const unsigned short h3f_min1_skip

min1 is 1 char, 8-bit (0 - 16-bit)

const unsigned char set_block_bit_0runs

Bit block with encoded zero intervals.

const unsigned char set_block_xor_ref8_um

block is un-masked XOR of a reference block (8-bit)

unsigned long long bmi_bslr_u64(unsigned long long w) noexcept

const unsigned char set_block_64one

lots of all-set blocks

const unsigned char set_block_gap_bienc

Interpolated GAP block (legacy)

const unsigned char set_block_xor_gap_ref16

..... 16-bit

bool check_block_one(const bm::word_t *blk, bool deep_scan) noexcept

Checks if block has only 1 bits.

const unsigned set_compression_default

Default compression level.

const unsigned char set_block_arrbit

List of bits ON.

const unsigned char set_block_1one

One block all-set (1111...)

void encode_min_max(BOUT &bout, bm::gap_word_t min_v, bm::gap_word_t tail_delta) noexcept

save range compression info [min_v..max_v]

const unsigned char set_block_arrgap_inv

List of bits OFF (GAP block)

void bit_block_change_bc(const bm::word_t *block, unsigned *gc, unsigned *bc) noexcept

void convert_sub_to_arr(const BV &bv, unsigned sb, VECT &vect)

convert sub-blocks to an array of set 1s (32-bit)

const unsigned gap_levels

const unsigned char set_block_gapbit

GAP compressed bitblock.

const unsigned char set_block_arr_bienc_8bh

BIC block 8bit header.

const unsigned char set_sblock_bienc

super-block interpolated list

const unsigned char set_block_xor_chain

XOR chain (composit of sub-blocks)

const unsigned char h3f_ex_upper2

void decode_min_max(BIN &bin, bm::gap_word_t gap_head, unsigned head_v3, bm::gap_word_t &min_v, bm::gap_word_t &max_v) noexcept

const unsigned char set_nb_bookmark32

jump ahead mark (32-bit)

const unsigned sblock_flag_max24

const unsigned set_sub_total_bits

const unsigned gap_len_cut_off_v3

const unsigned set_block_size

unsigned bit_to_gap(gap_word_t *dest, const unsigned *block, unsigned dest_len) noexcept

Convert bit block to GAP representation.

unsigned long long int id64_t

const unsigned block_waves

const unsigned char set_block_xor_ref16

block is masked XOR of a reference block (16-bit)

const unsigned char set_block_arrgap_bienc_inv

Interpolated GAP array (inverted)

const unsigned char set_block_arrgap_egamma

Gamma compressed delta GAP array.

const unsigned gap_equiv_len

const unsigned char set_block_1zero

One all-zero block.

const unsigned sblock_flag_min24

24-bit minv

const unsigned char set_block_end

End of serialization.

void arr_restore_min(T *arr, unsigned arr_len, T min0, T delta_acc=0) noexcept

Restore array using two minimal delta for better BIC compression.

const unsigned gap_max_buff_len

const unsigned char set_block_arrgap_bienc_v2

//!< Interpolated GAP array (v2)

const unsigned char set_block_xor_gap_ref32

..... 32-bit (should never happen)

bm::operation setop2op(bm::set_operation op) noexcept

Convert set operation to operation.

const unsigned char set_block_arrgap

List of bits ON (GAP block)

const unsigned char set_nb_sync_mark64

..... 64-bit (should never happen)

const unsigned char set_nb_sync_mark32

const unsigned char set_block_sgapgap

SGAP compressed GAP block.

const unsigned char h3f_ex_arr_1

const unsigned sparse_max_l5

serialization_header_mask

@ BM_HM_NO_GAPL

no GAP levels

@ BM_HM_ID_LIST

id list stored

@ BM_HM_NO_BO

no byte-order

@ BM_HM_SPARSE

very sparse vector

@ BM_HM_64_BIT

64-bit vector

@ BM_HM_RESIZE

resized vector

@ BM_HM_HXOR

horizontal XOR compression turned ON

const unsigned char set_block_arr_bienc

Interpolated block as int array.

const unsigned char set_block_64zero

lots of zero blocks

const unsigned sblock_flag_dr_min

const unsigned short h3f_exceptions

min0 is not applied

const unsigned char set_block_gap_bienc_v2

Interpolated GAP block (v2)

const unsigned gap_max_safe_len

const unsigned char set_block_xor_ref8

block is masked XOR of a reference block (8-bit)

const unsigned char set_block_gap_egamma

Gamma compressed GAP block.

unsigned short gap_word_t

const unsigned char set_block_32zero

Up to 4G zero blocks.

const unsigned char set_block_8zero

Up to 256 zero blocks.

const unsigned char set_block_xor_ref16_um

block is un-masked XOR of a reference block (16-bit)

const unsigned gap_max_bits

const unsigned short h3f_min0_skip

max_v is 1 char, 8-bit (0 - 16-bit)

const unsigned char set_block_bit_1bit

Bit block with 1 bit ON.

const unsigned char set_block_aone

All other blocks one.

const unsigned char set_nb_bookmark16

jump ahead mark (16-bit)

const unsigned char set_block_gap_bienc_v3

Interpolated GAP array (v3)

const unsigned set_block_shift

const unsigned char set_block_arr_bienc_inv_v3s

Interpolated array (v3)

void decode_mins(BIN &bin, unsigned head_v3, bm::gap_word_t &min0, bm::gap_word_t &min1) noexcept

const unsigned sblock_flag_len16

16-bit len (8-bit by default)

const unsigned set_compression_max

Maximum supported compression level.

const unsigned short h2f_min_v_8bit

bit 0 is reserved (used for head start bit)

const unsigned char set_nb_sync_mark24

const unsigned char set_block_xor_gap_ref8

..... 8-bit

const unsigned sparse_max_l6

const unsigned char set_block_azero

All other blocks zero.

unsigned calc_hist_limit(const unsigned *hist0, const unsigned *hist1, unsigned hist_len, unsigned ex_limit, unsigned *ex_sum) noexcept

claculate the effective exceptions limit using two histograms

const unsigned bits_in_block

const unsigned char h3f_ex_arr_ex_EOC

use gamma code for size

const unsigned tmp_buff_alloc_factor

multiplier for alloc_bit_block()

const unsigned char set_block_16zero

Up to 65536 zero blocks.

const unsigned char set_block_bit

Plain bit block.

const unsigned char set_block_bitgap_bienc_v2

Interpolated bit-block as GAPs (v2 - reseved)

const unsigned char set_nb_bookmark24

jump ahead mark (24-bit)

unsigned long long bmi_blsi_u64(unsigned long long w)

void combine_count_operation_with_block(const bm::word_t *blk, const bm::word_t *arg_blk, distance_metric_descriptor *dmit, distance_metric_descriptor *dmit_end) noexcept

Internal function computes different distance metrics.

const unsigned sblock_flag_min16

16-bit minv

const unsigned char set_block_arr_bienc_v3s

Interpolated array (v3)

const unsigned char set_block_sgapbit

SGAP compressed bitblock.

void gap_survey(const T *gap_buf, unsigned &gamma_size_bits) noexcept

Compute various GAP encoding characteristics.

const GenericPointer< typename T::ValueType > T2 value

Int4 delta(size_t dimension_, const Int4 *score_)

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

std::vector< bm::id64_t > ref_vect

Bit COUNT SUB AB functor.

bm::xor_complement_match match

Basic stats on second level group of blocks.

unsigned avg_gap_len() const noexcept

average length of GAP blocks

void init(void *bv, unsigned i) noexcept

void * bv_ptr

pointer to bit-vector

unsigned top_level_idx

index of the sub-block of blocks

bool is_only_gaps() const noexcept

true if sub contains multiple gap blocks and nothing else

static ByteOrder byte_order()

Bookmark state structure.

unsigned bm_type_

0:32-bit, 1: 24-bit, 2: 16-bit

size_t min_bytes_range_

minumal distance (bytes) between marks

block_idx_type nb_

bookmark block idx

unsigned char * ptr_

bookmark pointer

block_idx_type nb_range_

target bookmark range in blocks

bookmark_state(block_idx_type nb_range) noexcept

Parameters for XOR similarity search.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4