search for: hashdata

Displaying 6 results from an estimated 6 matches for "hashdata".

Did you mean: has_data
2010 Feb 22
1
shash in unique.c
...to hash the pointer itself rather than the string it points to? In other words could the SEXP pointer be cast to unsigned int and the usual scatter be called on that as if it were integer? shash would look like a slightly modified version of ihash like this : static int shash(SEXP x, int indx, HashData *d) { if (STRING_ELT(x,indx) == NA_STRING) return 0; return scatter((unsigned int) (STRING_ELT(x,indx), d); } rather than its current form which appears to hash the string it points to : static int shash(SEXP x, int indx, HashData *d) { unsigned int k; const char *p; if(d->...
2010 Jan 18
0
Fix for bug in match()
...ot;A", incomparables=NA) I found the reason in the hash table implementation in unique.c. Values in the table argument of match are stored in a hash table. Incomparables are then removed by (potentially multiple) calls to removeEntry(): static void removeEntry(SEXP table, SEXP x, int indx, HashData *d) { int i, *h; h = INTEGER(d->HashTable); i = d->hash(x, indx, d); while (h[i] != NIL) { if (d->equal(table, h[i], x, indx)) { h[i] = NA_INTEGER; /* < 0, only index values are inserted */ return; } i = (i + 1) % d->M; } h[i] = N...
2008 Aug 16
1
unique.default problem (PR#12551)
...line of code (produced by a mistake) caused an infinite loop unique("a",c("a","b")) or also unique(1,1:2) I made a little investigation, and it seems to be that the following function from unique.c is looping infinitely static int isDuplicated(SEXP x, int indx, HashData *d) { int i, *h; h = INTEGER(d->HashTable); i = d->hash(x, indx, d); while (h[i] != NIL) { if (d->equal(x, h[i], x, indx)) return h[i] >= 0 ? 1 : 0; i = (i + 1) % d->M; } h[i] = indx; return 0; } In this case h contains only one negative value,...
2011 Oct 05
1
unique possible bug
...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
...eed 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; } } "n&quo...
2010 Feb 05
0
Wine release 1.1.38
...ource dir. Anders Jonsson (1): wordpad: Update Swedish translation. Andrew Eikum (1): wininet: Handle PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT per-connection flags. Andrew Nguyen (10): shlwapi: Change a magic HRESULT value to the appropriate name. shlwapi/tests: Add tests for HashData. shlwapi: Only check for NULL pointers in HashData. pdh: Implement and test PdhGetDllVersion. mapi32/tests: Invoke MAPIInitialize before performing the FPropContainsProp tests. mapi32/tests: Centralize utility function pointer initialization. mapi32/tests: Fix prototyp...