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/gena_8h_source.html below:

NCBI C++ ToolKit: src/util/bitset/stress_test/gena.h Source File

23 template

<

typename

VT>

27  VT

v_tmp {0, 10, 31, 32, 62, 63,

30

bm::id_max48/2 + 10, bm::id_max48/2 + 16,

40 template

<

typename

VT,

typename

DISTR,

typename

MT_RAND>

42

DISTR& dist, MT_RAND& mt_rand)

44  for

(

unsigned i

= 0;

i

< 256; ++

i

)

49  for

(

unsigned

j = 0; j < 65536/3; ++j)

52

vect.push_back(sub_base + idx);

57  for

(

unsigned

j = 0; j < 65536;)

59  unsigned

to = j + ((unsigned)rand() % 256);

60  for

(

unsigned

k = j; k < to && k < 65536; ++k, ++j)

61

vect.push_back(sub_base + k);

69 template

<

typename

VT>

72

std::random_device rd;

73

std::mt19937_64 mt_rand(rd());

74

std::uniform_int_distribution<int> dist(0, 65535);

87

range_base = bm::id_max48 / 2;

91 #if defined(BMAVX2OPT) 93

range_base = bm::id_max48 - (65536 * 257);

98

vect.erase(std::unique(vect.begin(), vect.end() ), vect.end());

105 template

<

typename

BV>

108  typename

BV::size_type

i

, j;

109  for

(

i

= 0;

i

< vector_max;)

112  for

(j = 0; j < 65535*8;

i

+= 10, j++)

119  for

(j = 0; j < 65535;

i

+= 120, j++)

121  unsigned len

= (unsigned)rand() % 64;

122

bv.set_range(

i

,

i

+

len

);

123  bool

all_one_range = bv.is_all_one_range(

i

,

i

+

len

);

134 template

<

typename

VT,

typename

SIZE_TYPE>

142  for

(j = from; j < to; j += 2)

144  for

(j = from; j < to; j += 5)

146  for

(j = from; j < to; j += 120)

151 template

<

typename

BV>

154  typename

BV::size_type

min

,

155  typename

BV::size_type

max

,

156  unsigned

fill_factor)

158  typename

BV::bulk_insert_iterator bii1(bv1);

159  for

(

typename

BV::size_type

i

=

min

;

i

<

max

;

i

+= fill_factor)

171 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

177  bool

set_flag =

true

)

179

std::random_device rd;

180

std::mt19937_64 mt_rand(rd());

182  while

(fill_factor == 0)

184

fill_factor = (unsigned)rand() % 10;

188

cout <<

"Intervals filling. Factor=" 189

<< fill_factor << endl << endl;

192

SZT factor = 70 * fill_factor;

193

std::uniform_int_distribution<unsigned> dist_f(1,

unsigned

(factor));

194

std::uniform_int_distribution<unsigned> dist_f10(1,

unsigned

(factor) * 10);

195

std::uniform_int_distribution<unsigned> dist_f10_max(1,

unsigned

(factor) * 10 *

bm::gap_max_bits

);

204  len

= dist_f(mt_rand);

207

}

while

(end >=

max

);

210

bvect_full.set_range(

i

, end - 1, set_flag);

211  bool

all_one_range = bvect_full.is_all_one_range(

i

, end - 1);

212  assert

(all_one_range == set_flag);

215  for

(j =

i

; j < end; ++j)

220

bvect_min->set_bit(j);

225

bvect_min->clear_bit(j);

229  len

= dist_f10_max(mt_rand);

232  len

*= dist_f10(mt_rand);

238  for

(

unsigned

k = 0; k < 1000 &&

i

<

max

; k += 3,

i

+= 3)

243

bvect_min->set_bit(

i

);

244

bvect_full.set_bit_no_check(

i

);

249

bvect_min->clear_bit(j);

250

bvect_full.clear_bit(j);

257 template

<

typename

BV,

typename

SZT>

263  bool

set_flag =

true

)

265

std::random_device rd;

266

std::mt19937_64 mt_rand(rd());

268

std::uniform_int_distribution<unsigned> dist10(1, 10);

270  while

(fill_factor == 0)

272

fill_factor = dist10(mt_rand);

276

cout <<

"Intervals filling. Factor=" 277

<< fill_factor << endl << endl;

280

SZT factor = 70 * fill_factor;

282

std::uniform_int_distribution<unsigned> dist_f(1,

unsigned

(factor));

283

std::uniform_int_distribution<unsigned> dist_f10(1,

unsigned

(factor) * 10);

284

std::uniform_int_distribution<unsigned> dist_f10_max(1,

unsigned

(factor) * 10 *

bm::gap_max_bits

);

293  len

= dist_f(mt_rand);

296

}

while

(end >=

max

);

299

bvect_full.set_range(

i

, end - 1, set_flag);

300  bool

all_one_range = bvect_full.is_all_one_range(

i

, end - 1);

301  assert

(all_one_range == set_flag);

306  len

= dist_f10_max(mt_rand);

309  len

*= dist_f10(mt_rand);

316  for

(

unsigned

k = 0; k < 1000 &&

i

<

max

; k += 3,

i

+= 3)

320

bvect_full.set_bit_no_check(

i

);

324

bvect_full.clear_bit(

i

);

332 template

<

typename

SZT>

335

SZT

r

= (unsigned(rand()) << 16u) |

unsigned

(rand());

338

SZT

r2

= (unsigned(rand()) << 16u) |

unsigned

(rand());

344 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

355  if

(fill_factor == 0)

357

SZT n_id = (

max

-

min

) / 1000;

358

cout <<

"random filling : "

<< n_id << endl;

359  for

(

i

= 0;

i

< n_id;

i

++)

362

bvect_min->set_bit(

id

);

363

bvect_full->set_bit(

id

);

369

cout <<

"fill_factor random filling : factor = " 370

<< fill_factor << std::endl;

372  for

(

i

= 0;

i

< fill_factor;

i

++)

374  unsigned

k = unsigned(rand()) % 10;

379

SZT start =

min

+ (

max

-

min

) / (fill_factor * k);

390

SZT end = start + (

max

- start) / (fill_factor * 2);

400  typename

BV::bulk_insert_iterator iit = bvect_full->inserter();

405  unsigned r

= unsigned(rand()) % 8;

409  unsigned

inc = unsigned(rand()) % 3;

411

SZT end2 = start + (unsigned)rand() % 1000;

416

bvect_min->set_bit(start);

425

bvect_min->set_bit(start);

432

bvect_min->set_bit(start);

439  unsigned

c = unsigned(rand()) % 15;

442  for

(; start < end; ++start)

444

bvect_min->set_bit(start);

457 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

468 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

475

SZT bit_idx = SZT(rand()) % range;

476

bvect_min->set_bit(bit_idx);

477

bvect_full->set_bit(bit_idx);

478

cout <<

"Bit_idx="

<< bit_idx << endl;

481 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

506  for

(

unsigned i

= 0;

i

<

count

; ++

i

)

508

SZT bn = SZT(rand()) %

count

;

514

bvect_min->set_bit(bn);

515

bvect_full->set_bit_no_check(bn);

517

cout <<

"Ok"

<< endl;

521 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

528  typename

BV::bulk_insert_iterator iit = bvect_full->inserter();

529

SZT step = (unsigned)rand() % 4;

530  if

(step < 2) ++step;

531  for

(SZT

i

= 0;

i

<

max

;

i

+=step)

533

bvect_min->set_bit(

i

);

536

cout <<

"Ok"

<< endl;

553 template

<

typename

BVMINI,

typename

BV,

typename

SZT>

571

cout <<

"Random filling: method - FillSets - factor(0)"

<< endl;

576

cout <<

"Random filling: method - FillSets - factor(random)"

<< endl;

577

factor = (unsigned)rand()%3;

582

cout <<

"Random filling: method - Set-Clear Intervals - factor(random)"

<< endl;

583

factor = (unsigned)rand()%10;

587

cout <<

"Random filling: method - FillRandom - factor(random)"

<< endl;

588

factor = (unsigned)rand()%3;

592

cout <<

"Random set one bit"

<< endl;

596

cout <<

"Regular pattern filling"

<< endl;

618

cout <<

"Random filling: method - Set Intervals - factor(random)"

<< endl;

619

factor = (unsigned)rand()%10;

627

cout <<

"Vector optimization..."

<< flush;

629

bvect_full->optimize(tb);

630

cout <<

"OK"

<< endl;

637 template

<

typename

BV>

639  typename

BV::size_type

min

,

640  typename

BV::size_type

max

= 40000000,

641  unsigned

fill_factor = 65536)

643  typename

BV::bulk_insert_iterator iit(bv);

644  unsigned

ff = fill_factor / 10;

645  for

(

typename

BV::size_type

i

=

min

;

i

<

max

;

i

+= ff)

649  if

(ff > fill_factor)

650

ff = fill_factor / 10;

656 template

<

typename

VECT>

659  unsigned long long

vector_max,

666  unsigned

cnt1 = (

count

/ 2);

669  for

(

i

= 0;

i

< cnt1; ++

i

)

671

std::unique_ptr<typename VECT::value_type> bv (

new typename VECT::value_type

);

676

target->push_back(std::move(*bv));

679  unsigned long long

fill_factor = 10;

682

std::unique_ptr<typename VECT::value_type> bv (

new typename VECT::value_type

);

686

target->push_back(std::move(*bv));

691 template

<

typename

SV>

696  unsigned

max_idx_value = 1000000;

701

cout <<

"SV Ultra sparse generation"

<< endl;

702  for

(

unsigned i

= 0;

i

< max_idx_value;)

704  value_type

v = (unsigned)(rand() * rand()) % 650000;

716  i

+= 10000 + (unsigned)rand() % 65535;

722

cout <<

"SV Dense intervals generation 1"

<< endl;

723  for

(

unsigned i

= 0;

i

< max_idx_value;)

725  value_type

v = (unsigned)(rand() * rand()) % 650000;

726  for

(

unsigned

j = 0;

i

< max_idx_value; ++

i

, ++j)

739  i

+= 20000 + (unsigned)rand() % 65535;

745

cout <<

"SV Dense intervals generation 2"

<< endl;

746  value_type

v = (unsigned)(rand() * rand()) % 650000;

747  for

(

unsigned i

= 0;

i

< max_idx_value/4; ++

i

)

752  for

(

unsigned i

= 0;

i

< max_idx_value;)

754

v = unsigned(rand() * rand()) % 650000;

755  for

(

unsigned

j = 0;

i

< max_idx_value; ++

i

, ++j)

760

sv[

i

] = -

int

(

unsigned

(v) +

i

);

764  i

+= 30000 + unsigned(rand()) % 65535;

770

cout <<

"SV random generation"

<< endl;

771  unsigned

rand_max = (unsigned)rand() % 300000;

772  for

(

unsigned i

= 0;

i

< rand_max; ++

i

)

775  unsigned

idx = unsigned(rand()) % max_idx_value;

783

sv.clear(idx,

true

);

790

cout <<

"SV empty generation"

<< endl;

791  unsigned

idx = unsigned(rand()) % max_idx_value;

793

sv.clear(idx,

true

);

798

cout <<

"SV uniform power 2 value generation"

<< endl;

800  for

(

unsigned i

= 0;

i

< max_idx_value; ++

i

)

808

cout <<

"SV uniform power 2+1 value generation"

<< endl;

810  for

(

unsigned i

= 0;

i

< max_idx_value; ++

i

)

822

cout <<

"SV linear growth/decline value generation"

<< endl;

823  for

(

unsigned i

= 0;

i

< max_idx_value; ++

i

)

828

sv[

i

] = -

int

(

i

);

844  typename

SV::size_type

min

,

845  typename

SV::size_type

max

,

846  unsigned

fill_factor)

848  typename

SV::size_type diap =

max

-

min

;

849  typename

SV::size_type

count

;

865  if

(vect.size() <

max

)

866

vect.resize(

max

+ 1);

867  if

(svect.size() <

max

)

868

svect.resize(

max

+ 1);

874  val

= (unsigned)rand() % (65535 * 2);

886  unsigned

inc = (unsigned)rand() % 2048;

892  val

= (unsigned)rand() % 8;

905 template

<

typename

SSV>

908  string

prefix =

"az"

;

910  for

(

unsigned i

= 0;

i

< max_coll; ++

i

)

913  str

.append(to_string(

i

));

914

str_coll.emplace_back(

str

);

918  unsigned

prefix_len = (unsigned)rand() % 5;

919  for

(

unsigned

j = 0; j < prefix_len; ++j)

921  char

cch = char(

'a'

+ (

unsigned

)rand() % 26);

922

prefix.push_back(cch);

930 template

<

typename

CBCBuf>

933  unsigned

sz_factor = (unsigned)rand() % 10;

936  unsigned size

= 65000 + (128000 / sz_factor);

938  unsigned char

*

data

=

buf

.data();

939  for

(

unsigned i

= 0;

i

<

size

; ++

i

)

941  data

[

i

] = (

unsigned

char)

i

;

945 template

<

typename

CBC>

948  unsigned

sz = (unsigned)rand() % 10000;

950  unsigned

key_factor = (unsigned)rand() % 128;

953  for

(

unsigned i

= 0;

i

< sz; ++

i

)

956  typename

CBC::buffer_type

buf

;

958

cbc.move_buffer(

key

,

buf

);

966 template

<

typename

SV>

968  typename

SV::size_type vector_max)

970  typename

SV::back_insert_iterator bi(sv.get_back_inserter());

973  for

(

typename

SV::size_type

i

= 0;

i

< vector_max; ++

i

)

975  unsigned

plato = (unsigned)rand() % 16;

976  for

(

unsigned

j = 0;

i

< vector_max && j < plato; ++

i

, ++j)

982  unsigned

nulls = (unsigned)rand() % 16;

#define BM_DECLARE_TEMP_BLOCK(x)

#define test(a, b, c, d, e)

static const char * str(char *buf, int n)

void FillTestBuffer(CBCBuf &buf)

void FillSetsIntervals(BVMINI *bvect_min, BV &bvect_full, SZT min, SZT max, SZT fill_factor, bool set_flag=true)

void FillSetsRegular(BVMINI *bvect_min, BV *bvect_full, SZT, SZT max, SZT)

void generate_vect48_range(VT &vect, unsigned long long range_base, DISTR &dist, MT_RAND &mt_rand)

sub-range vector generator

int FillSetsRandomMethod(BVMINI *bvect_min, BV *bvect_full, SZT min, SZT max, int optimize=0, int method=-1)

void GenerateShiftTestCollection(VECT *target, unsigned count, unsigned long long vector_max, bool optimize)

void generate_bvector(BV &bv, typename BV::size_type vector_max, bool optimize)

void generate_sparse_bvector(BV &bv, typename BV::size_type min, typename BV::size_type max=40000000, unsigned fill_factor=65536)

void FillSetClearIntervals(BVMINI *bvect_min, BV *bvect_full, SZT min, SZT max, SZT fill_factor)

void GenerateCompressedBufferCollection(CBC &cbc)

void GenerateTestStrCollection(SSV &str_coll, typename SSV::size_type max_coll)

void SimpleGapFillSets(BV &bv0, BV &bv1, typename BV::size_type min, typename BV::size_type max, unsigned fill_factor)

void FillSetsRandom(BVMINI *bvect_min, BV *bvect_full, SZT min, SZT max, SZT fill_factor)

void generate_vect_simpl0(VT &vect)

generate certain simple benchmark values

void FillSparseIntervals(std::vector< unsigned > &vect, SV &svect, typename SV::size_type min, typename SV::size_type max, unsigned fill_factor)

void FillSets(BVMINI *bvect_min, BV *bvect_full, SZT min, SZT max, SZT fill_factor)

void generate_serialization_test_set(SV &sv, typename SV::size_type vector_max)

void FillSetsRandomOne(BVMINI *bvect_min, BV *bvect_full, SZT min, SZT max)

void generate_test_vectors(VT &v1, VT &v2, VT &v3, SIZE_TYPE from, SIZE_TYPE to)

void GenerateSV(SV &sv, unsigned strategy=0)

SZT random_minmax(SZT min, SZT max)

void generate_vect48(VT &vect)

generate test random vector in 48-bit range

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

NCBI_NS_STD::string::size_type SIZE_TYPE

strategy

Block allocation strategies.

unsigned int

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

const unsigned bits_in_array

unsigned long long int id64_t

const unsigned gap_max_bits

constexpr auto sort(_Init &&init)

double value_type

The numeric datatype used by the parser.

const struct ncbi::grid::netcache::search::fields::SIZE size

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

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

static const sljit_gpr r2

ad-hoc conditional expressions


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