Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random sampling lines of file using Vitter's method #644

Open
lmanchon opened this issue Sep 14, 2023 · 0 comments
Open

random sampling lines of file using Vitter's method #644

lmanchon opened this issue Sep 14, 2023 · 0 comments

Comments

@lmanchon
Copy link

--Hi,

i found a piece of code here: https://getkerf.wordpress.com/2016/03/30/the-best-algorithm-no-one-knows-about/

and i want to know if it's possible to adapt it to extract random lines from a file.

I have tried to compile it but it failed:

gcc -O2 -m64 vitter.c -lm -o vitter
vitter.c: In function ‘random_double’:
vitter.c:7:10: warning: implicit declaration of function ‘genrand64_real2’ [-Wimplicit-function-declaration]
return genrand64_real2();
^~~~~~~~~~~~~~~
vitter.c: At top level:
vitter.c:16:13: error: unknown type name ‘int64_t’
void vitter(int64_t *a, int64_t n, int64_t N) //Method D
^~~~~~~
vitter.c:16:25: error: unknown type name ‘int64_t’
void vitter(int64_t *a, int64_t n, int64_t N) //Method D
^~~~~~~
vitter.c:16:36: error: unknown type name ‘int64_t’
void vitter(int64_t *a, int64_t n, int64_t N) //Method D
^~~~~~~
vitter.c:141:15: error: unknown type name ‘int64_t’
void vitter_a(int64_t *a, int64_t n, int64_t N, int64_t j) //Method A
^~~~~~~
vitter.c:141:27: error: unknown type name ‘int64_t’
void vitter_a(int64_t *a, int64_t n, int64_t N, int64_t j) //Method A
^~~~~~~
vitter.c:141:38: error: unknown type name ‘int64_t’
void vitter_a(int64_t *a, int64_t n, int64_t N, int64_t j) //Method A
^~~~~~~
vitter.c:141:49: error: unknown type name ‘int64_t’
void vitter_a(int64_t *a, int64_t n, int64_t N, int64_t j) //Method A

Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant