search for: mksetup

Displaying 3 results from an estimated 3 matches for "mksetup".

Did you mean: ksetup
2010 Jan 14
1
Mksetup() limited to hashing with 32 bits
The MKsetup() in unique.c throws an error if the vector to be hashed is longer than (2^32)/8: if(n < 0 || n > 536870912) /* protect against overflow to -ve */ error(_("length %d is too large for hashing"), n); I occasionally work with vectors longer than this on 64-bit builds. Wo...
2011 Oct 05
1
unique possible bug
...et K = log2(M). Need K >= 1 and hence M >= 2, and 2^M <= 2^31 -1, hence n <= 2^29. Dec 2004: modified from 4*n to 2*n, since in the worst case we have a 50% full table, and that is still rather efficient -- see R. Sedgewick (1998) Algorithms in C++ 3rd edition p.606. */ static void MKsetup(int n, HashData *d) { int n4 = 2 * n; if(n < 0 || n > 536870912) /* protect against overflow to -ve */ error(_("length %d is too large for hashing"), n); d->M = 2; d->K = 1; while (d->M < n4) { d->M *= 2; d->K += 1; } }
2012 Aug 10
3
Vector size limit for table() in R-2.15.1
...= log2(M). Need K >= 1 and hence M >= 2, and 2^M <= 2^31 -1, hence n <= 2^30. Dec 2004: modified from 4*n to 2*n, since in the worst case we have a 50% full table, and that is still rather efficient -- see R. Sedgewick (1998) Algorithms in C++ 3rd edition p.606. */ static void MKsetup(int n, HashData *d) { int n2 = 2 * n; if(n < 0 || n > 1073741824) /* protect against overflow to -ve */ error(_("length %d is too large for hashing"), n); d->M = 2; d->K = 1; while (d->M < n2) { d->M *= 2; d->K += 1;...