help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Help with random sampling


From: Timothy Frasier
Subject: [Help-gsl] Help with random sampling
Date: Thu, 27 Mar 2008 06:06:31 -0400

Hello,

I am new to programming, so I apologize for the simplicity of this
question.  I am trying to learn how to use the gsl_ran_choose and
gsl_ran_sample functions, but am having trouble getting them to work.  I
always get the error "implicit declaration of function
'gsl_ran_choose'".  I am just trying to work through simple examples
now, and my code is below (for taking an array from 0 to 9, and
shuffling those into another array).  I would appreciate any help that
you could give.  Thank you for your time.

-Tim Frasier

int main(void)
{
        int i, r;
        int a[10];
        int b[10];

        r = 10;

        for (i = 0; i < 10; i++)
        {
                a[i] = i;
        }

        gsl_ran_choose (r, a, 10, b, 10, sizeof(int));

        for(i = 0; i < 10; i++)
        {
                printf("\nb[%d] = ", i);
                printf("%d", b[i]);
        }
        printf("\n");

        return(0);
}


Timothy R. Frasier, Ph.D.
Trent University
DNA Building
2140 East Bank Drive
Peterborough, Ontario K9J 7B8
Canada
Tel: 705-748-1011 ext. 7226
E-mail: address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]