![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sparse Indexing: Large Scale, Inline Deduplication Using Sampling and Locality | iBot | UNIX and Linux RSS News | 0 | 06-09-2009 12:30 AM |
| Sampling and Binning- Engineering problem | Needhelp2 | Shell Programming and Scripting | 7 | 09-05-2008 04:11 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Uniform sampling
Hi My goal is to build a C function that perform a uniform sampling. I mean that I have a big file with a lot of data and I'd like to take just some data samples accordly the uniform distribution. Es. file1: a b c d e f g h i l m n o p q An example would be to flip a coin for each letter and select all letters for which the coin showed the head. I have used the srand() system call, but it is not uniform. Can anyone suggest a way to start? Thanks D ---------- Post updated at 08:00 PM ---------- Previous update was at 06:30 PM ---------- Hi i'm trying in this way: Code:
...... #define RAND_MAX 2 srand(time(NULL)); ....... in the loop p=rand()%RAND_MAX and if the index is greater than 0 grab the letter otherwise leave it. If you have a different suggestion let me know thanks D. |
| Bookmarks |
| Tags |
| sampling, uniform |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|