#include <stdio.h>
#include <stdlib.h>
#include <cmath>


//
// This is where the user-specified seed is sent. It
// uses the seed to initialize the stock gcc rand() generator,
// which is then used to generate an array of 256 numbers.
// That array is used to initialize the MT rand generator.
//
void init_rand ( long seed );
//
//


//
// MT rand generator fcns...
//
void init_by_array(unsigned long init_key[], int key_length);
unsigned long genrand_int32(void);
long genrand_int31(void);

// The following are the same as genrand_real*() in mt19937ar.c ...

// Calculates result for rand_uniform[]
/* generates a random number on [0,1)*/
inline double rand_uniform(void) 
{ 
    return genrand_int32()*(1.0/4294967296.0); 
    /* divided by 2^32 */
} 

// Calculates result for rand_uniform_oo[]
/* generates a random number on (0,1)*/
inline double rand_uniform_oo(void) 
{ 
    return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0); 
    /* divided by 2^32 */
} 

// Calculates result for rand_uniform_cc[]
/* generates a random number on [0,1]*/
inline double rand_uniform_cc(void) 
{ 
    return genrand_int32()*(1.0/4294967295.0); 
    /* divided by 2^32-1 */ 
} 
//
//
//

//
// (Modified) GSL functions...
//

/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 James Theiler, Brian Gough
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */


// Calculates result for rand_normal[..]
double gsl_ran_gaussian (const double mean, const double sigma);

// Calculates result for rand_poisson[..]
unsigned int gsl_ran_poisson (double mu);

// Calculates result for rand_poisson[..]
double gsl_ran_gamma (const double a, const double b);

// Calculates result for rand_binomial[..]
unsigned int gsl_ran_binomial (double p, unsigned int n);

// rand_exponential[m] is calculated simply as -log(rand_uniform_oo())*m .




