random_variable 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ext/xrandlib.c CHANGED
@@ -40,16 +40,20 @@
40
40
  #include "xrandlib.h"
41
41
  #include "randlib.h"
42
42
 
43
- /* Bernoulli */
44
- int genbern(double p)
43
+ int gen_bernoulli(double p)
45
44
  {
46
45
  if (ranf() > p)
47
46
  return 0;
48
47
  return 1;
49
48
  }
50
49
 
50
+ double gen_exponential(double lambda)
51
+ {
52
+ return genexp(1.0 / lambda);
53
+ }
54
+
51
55
  /* Rayleigh */
52
- double genray(double sigma)
56
+ double gen_rayleigh(double sigma)
53
57
  {
54
58
  return sqrt( -2 * sigma * sigma * log(1.0 - ranf()) );
55
59
  }
data/lib/ext/xrandlib.h CHANGED
@@ -17,7 +17,8 @@
17
17
  #ifndef _XRANDLIB_H_
18
18
  #define _XRANDLIB_H_
19
19
 
20
- extern int genbern(double p);
21
- extern double genray(double sigma);
20
+ extern int gen_bernoulli(double);
21
+ extern double gen_exponential(double);
22
+ extern double gen_rayleigh(double);
22
23
 
23
24
  #endif /* _XRANDLIB_H_ */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_variable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,31 +9,9 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-17 00:00:00.000000000 Z
12
+ date: 2012-11-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: ! 'Create and operate with Random Variables in Ruby
15
-
16
- To date, the supported distributions are:
17
-
18
- Bernoulli
19
-
20
- Beta
21
-
22
- Binomial
23
-
24
- Continous Uniform
25
-
26
- Discrete Uniform
27
-
28
- Exponential
29
-
30
- F
31
-
32
- Normal
33
-
34
- Poisson
35
-
36
- Rayleigh'
14
+ description: Create and operate with random variables in Ruby
37
15
  email: jorge.madronal.rinaldi@gmail.com
38
16
  executables: []
39
17
  extensions: