# Changeset 359

Ignore:
Timestamp:
Aug 4, 2005, 11:38:47 AM (18 years ago)
Message:

moved inline implementations

File:
1 edited

### Legend:

Unmodified
 r358 /// @see uniform_int_min() and uniform_int_max(). /// inline u_long uniform_int(const u_long n=0) const; inline u_long uniform_int(const u_long n=0) const { return ( n ? gsl_rng_uniform_int(r_,n) : gsl_rng_get( r_ )); } /// distribution between [ 0, 1 [. /// inline double uniform_double() const; inline double uniform_double() const { return gsl_rng_uniform( r_ ); } /// /// \f$f(x) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{x^2}{2\sigma^2}}\f$ /// inline double gaussian( const double& sigma=1 ) const; inline double gaussian( const double& sigma=1 ) const { return gsl_ran_gaussian( r_, sigma ); } /// \frac{1}{\mu}e^{-\frac{x}{\mu}}\f\$. /// inline double exponential( const double& mu=1 ) const; inline double exponential( const double& mu=1 ) const { return gsl_ran_exponential( r_, mu ); } /// /// @See uniform_int()! /// inline u_long uniform_min() const; inline u_long uniform_min() const { return gsl_rng_min( r_ ); } /// /// @See uniform_int()! /// inline u_long uniform_max() const; inline u_long uniform_max() const { return gsl_rng_max( r_ ); } /// /// Return seed to user for documentation purposes. /// inline int seed() const; inline int seed() const { return gsl_rng_default_seed; } /// /// inline void general_distribution_prob( const size_t& k, const double* p ); const double* p ) { gen_ = gsl_ran_discrete_preproc( k, p ); } /// /// @see general_distribution_prob /// inline size_t rnd_discrete(); inline size_t rnd_discrete() { return gsl_ran_discrete( r_, gen_ );} /// /// returns the one used. /// std::string generator_type(void) const; std::string generator_type(void) const { return static_cast( gsl_rng_name( r_ ) ); } /// }; double random_singleton::exponential( const double& mu ) const { return gsl_ran_exponential( r_, mu ); } double random_singleton::gaussian( const double& sigma ) const { return gsl_ran_gaussian( r_, sigma ); } inline std::string random_singleton::generator_type() const { return static_cast( gsl_rng_name( r_ ) ); } size_t random_singleton::rnd_discrete() { return gsl_ran_discrete( r_, gen_ ); } int random_singleton::seed() const { return gsl_rng_default_seed; } double random_singleton::uniform_double() const { return gsl_rng_uniform( r_ ); } u_long random_singleton::uniform_int(const u_long n) const { return ( n ? gsl_rng_uniform_int(r_,n) : gsl_rng_get( r_ )); } u_long random_singleton::uniform_min() const { return gsl_rng_min( r_ ); } u_long random_singleton::uniform_max() const { return gsl_rng_max( r_ ); } void random_singleton::general_distribution_prob( const size_t& k, const double* p ) { gen_ = gsl_ran_discrete_preproc( k, p ); } }} // of namespace utility and namespace theplu