-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProva.cpp
More file actions
35 lines (30 loc) · 823 Bytes
/
Prova.cpp
File metadata and controls
35 lines (30 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cmath>
#include<iostream>
#include<gsl/gsl_rng.h>
#include<Hevolve.h>
#include<Hsplit.h>
#include<Constants.h>
#include<Deterministic.h>
using namespace std;
int main(){
Constants cons;
double Nc[2],Nd[2],x[2];
gsl_rng *r; //Pointer to the type of rng
FILE *pfile; //file to read from /usr/urandom
unsigned int seed; //Seed of the random number generator
pfile = fopen ("/dev/urandom", "r");
fread (&seed, sizeof (seed), 1, pfile);
fclose(pfile);
r = gsl_rng_alloc(gsl_rng_mt19937); //I'm using the "Mersenne Twister" generator!
gsl_rng_set(r,seed); // Starting the generator
Nc[0]=41.;
Nd[0]=41.;
Nc[1]=-1.;
Nd[1]=-1.;
fill3(1,0,x,Nc,Nd,r);
cout<<Nc[0]<<" "<<Nd[0]<<" "<<Nc[1]<<" "<<Nd[1]<<" "<<x[0]<<" "<<x[1]<<endl;
return 0;
}