#include "Random.h"
#include <ctime>

namespace util
{

// Class implementation (continued)
// ================================

// constructors
Random::
Random( )
    : rand_max_plus_1( RAND_MAX+1.0), val(0)
{
    // get system's time
    time_t s;
    time( &s);
    unsigned int  seed = s;

    // initialize random numbers generator
    srand( seed);
    random_value = get_int(0, 1<<15);
}

Random::
Random( unsigned int  seed)
    : rand_max_plus_1( RAND_MAX+1.0), val(0)
{
    // initialize random numbers generator
    srand( seed);
    random_value = get_int(0, 1<<15);
}

// Global variables
// ================
Random  default_random;

}

// ===== EOF ==================================================================
