Displaying 2 results from an estimated 2 matches for "reallocvector".
Did you mean:
allocvector
1998 Jan 21
2
alloc
...or S_alloc is called. I did nm R.binary | grep alloc to see if this was
supported and I find there are some choices:
[2490] | 446036| 272|FUNC |GLOB |0 |7 |R_alloc
[806] | 693956| 312|FUNC |LOCL |0 |7 |ReallocString
[807] | 693220| 736|FUNC |LOCL |0 |7 |ReallocVector
[3444] | 446308| 144|FUNC |GLOB |0 |7 |S_alloc
[2429] | 446452| 200|FUNC |GLOB |0 |7 |S_realloc
...
[2204] | 1445856| 0|FUNC |GLOB |0 |UNDEF |calloc
[2595] | 1444644| 0|FUNC |GLOB |0 |UNDEF |malloc
[3066] | 1444728| 0|FUNC |GLOB |0 |U...
2017 Oct 18
1
uniform sampling without replacement algorithm
...NTEGER(r);
int i;
for (i = 0; i < n; i++)
y[i] = n-i;
for (i = 0; i < k; i++) {
int j = n - 1 - (int) ((n-i) * unif_rand());
int t = y[j];
y[j] = y[i];
y[i] = t;
}
if (k < n)
r = reallocVector(r,k,1);
}
else {
/* Hash table implementation, producing same result as previous code.
Mimics previous code by using a hash table to record how 'x' would
have been changed. At each iteration, it looks up x[j] in the
hash table (j from 1 up...