librtl

distributions.h

This is the verbatim text of the distributions.h include file.
#ifndef distributions_h
#define distributions_h

#include <jgl/defines.h>


class rtl_normaldist
{
public:


    rtl_normaldist ( jFlt=0, jFlt=1 );


    jFlt x();

protected:


    jFlt mean, stddev;

private:
    
    // x1,x2
    //
    // The pair of random variates last generated by generatePair.
    jFlt x1,x2;
    
    // generate
    //
    // Flag that indicates we have to generate a new pair of variates.
    bool generate;

    // generatePair
    //
    // Generates a new pair of random variates.
    void generatePair();
};


class rtl_lognormal
{
public:

    rtl_lognormal( jFlt=1.0, jFlt=1.0 );


    jFlt x();

private:
    rtl_normaldist nd;
};

#endif

JSP / librtl v0.2 mtigges@cpsc.ucalgary.ca