This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

i have got a problem in using GSL random under BCB6!


here is my program
//---------------------------------------------------------------------------

#pragma hdrstop

//---------------------------------------------------------------------------
#include "stdio.h"
#include "conio.h"
#include "gsl/gsl_rng.h"
#include "gsl/gsl_randist.h"
#pragma argsused
int main(int argc, char* argv[])
{
    double* out=new double[100];
    const gsl_rng_type * T;
    gsl_rng *r;
    int i,j;
    gsl_rng_env_setup();
    T=gsl_rng_default;
    r=gsl_rng_alloc(T);
    for(i=0;i<100;i++){
        out[i]=gsl_ran_gaussian(r,1);
    }
    gsl_rng_free(r);
}
//--------------------------------------------------------------------------
it can pass the compiling but when run it ,following problem occurs:
"Project project1.exe raised exception class EAccessViolatoin with message 'Access violation at address 10061FF6. Read of address 5070260B. Process stopped."

somthing seems wrong when i trace into the gsl_rng_alloc(T); 

who can help me?is this is a bug?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]