Last change
on this file since 13 was
13,
checked in by daniel, 20 years ago
|
* empty log message *
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.1 KB
|
Line | |
---|
1 | // Inline functions (A-Z) |
---|
2 | ///////////////////////// |
---|
3 | double random_singleton::get_exponential( const double& mu ) const |
---|
4 | { |
---|
5 | return gsl_ran_exponential( r_, mu ); |
---|
6 | } |
---|
7 | |
---|
8 | |
---|
9 | double random_singleton::get_gaussian( const double& sigma ) const |
---|
10 | { |
---|
11 | return gsl_ran_gaussian( r_, sigma ); |
---|
12 | } |
---|
13 | |
---|
14 | |
---|
15 | inline std::string random_singleton::get_generator_type() const |
---|
16 | { |
---|
17 | return static_cast<std::string>( gsl_rng_name( r_ ) ); |
---|
18 | } |
---|
19 | |
---|
20 | |
---|
21 | size_t random_singleton::get_rnd_discrete() |
---|
22 | { |
---|
23 | assert( gen_ != NULL ); |
---|
24 | return gsl_ran_discrete( r_, gen_ ); |
---|
25 | } |
---|
26 | |
---|
27 | |
---|
28 | int random_singleton::get_seed() const |
---|
29 | { |
---|
30 | return gsl_rng_default_seed; |
---|
31 | } |
---|
32 | |
---|
33 | |
---|
34 | double random_singleton::get_uniform_double() const |
---|
35 | { |
---|
36 | return gsl_rng_uniform( r_ ); |
---|
37 | } |
---|
38 | |
---|
39 | |
---|
40 | long int random_singleton::get_uniform_int() const |
---|
41 | { |
---|
42 | return gsl_rng_get( r_ ); |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | long int random_singleton::get_uniform_min() const |
---|
47 | { |
---|
48 | return gsl_rng_min( r_ ); |
---|
49 | } |
---|
50 | |
---|
51 | |
---|
52 | long int random_singleton::get_uniform_max() const |
---|
53 | { |
---|
54 | return gsl_rng_max( r_ ); |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | void random_singleton::set_general_distribution_prob( const size_t& k, |
---|
59 | const double* p ) |
---|
60 | { |
---|
61 | gen_ = gsl_ran_discrete_preproc( k, p ); |
---|
62 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.