ruby_native_statistics 0.7.1 → 0.7.2
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +3 -3
- data/README.md +1 -2
- data/ext/dispersion/dispersion.c +12 -4
- data/lib/ruby_native_statistics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52cf53c63c8128a6280c289b0670c3e60e999c2b
|
4
|
+
data.tar.gz: 963420d1f1b62e85553b2d377eaa0fc929194799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fc91f7644dd63d5a3d472c7258c536bec4537859703e4dab6398688c6a0320d138a6be7b256d2067b327e19c909c2a58e1d671f93e5a7ee3a82d6ecaa367143
|
7
|
+
data.tar.gz: 44c796d4939933db97bd403368fe17f498ac07da9ef1f76db78c478e5530c78d4c875f17765d04fff28cd19dbd3d3f95a9720af6fac39e7bc9cbc29d2c599304
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -9,8 +9,7 @@ This is a native extension to Ruby that adds native (C) statistical functions to
|
|
9
9
|
* [Sample Variance](https://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance) (var)
|
10
10
|
* [Population Variance](https://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance) (varp)
|
11
11
|
|
12
|
-
|
13
|
-
Check the TravisCI build to see the currently supported versions of Ruby. This list will match whatever versions are specified at https://www.ruby-lang.org/en/downloads/.
|
12
|
+
Check the TravisCI build to see the currently supported versions of Ruby. This list will match whatever stable versions are specified at https://www.ruby-lang.org/en/downloads/.
|
14
13
|
|
15
14
|
It is much more performant than calculating the standard deviation with pure Ruby. For a comparison, run the benchmarks with rake.
|
16
15
|
|
data/ext/dispersion/dispersion.c
CHANGED
@@ -30,9 +30,11 @@ double calculate_total_distance_from_mean(VALUE array, unsigned long array_lengt
|
|
30
30
|
}
|
31
31
|
|
32
32
|
VALUE rb_sample_standard_deviation(VALUE self) {
|
33
|
+
unsigned int array_length;
|
34
|
+
|
33
35
|
Check_Type(self, T_ARRAY);
|
34
36
|
|
35
|
-
|
37
|
+
array_length = rb_long2int(RARRAY_LEN(self));
|
36
38
|
|
37
39
|
if (array_length <= 1) {
|
38
40
|
rb_raise(rb_eRangeError, "array must have more than one element");
|
@@ -42,9 +44,11 @@ VALUE rb_sample_standard_deviation(VALUE self) {
|
|
42
44
|
}
|
43
45
|
|
44
46
|
VALUE rb_sample_variance(VALUE self) {
|
47
|
+
unsigned int array_length;
|
48
|
+
|
45
49
|
Check_Type(self, T_ARRAY);
|
46
50
|
|
47
|
-
|
51
|
+
array_length = rb_long2int(RARRAY_LEN(self));
|
48
52
|
|
49
53
|
if (array_length <= 1) {
|
50
54
|
rb_raise(rb_eRangeError, "array must have more than one element");
|
@@ -54,9 +58,11 @@ VALUE rb_sample_variance(VALUE self) {
|
|
54
58
|
}
|
55
59
|
|
56
60
|
VALUE rb_population_standard_deviation(VALUE self) {
|
61
|
+
unsigned int array_length;
|
62
|
+
|
57
63
|
Check_Type(self, T_ARRAY);
|
58
64
|
|
59
|
-
|
65
|
+
array_length = rb_long2int(RARRAY_LEN(self));
|
60
66
|
|
61
67
|
if (array_length <= 1) {
|
62
68
|
rb_raise(rb_eRangeError, "array must have more than one element");
|
@@ -66,9 +72,11 @@ VALUE rb_population_standard_deviation(VALUE self) {
|
|
66
72
|
}
|
67
73
|
|
68
74
|
VALUE rb_population_variance(VALUE self) {
|
75
|
+
unsigned int array_length;
|
76
|
+
|
69
77
|
Check_Type(self, T_ARRAY);
|
70
78
|
|
71
|
-
|
79
|
+
array_length = rb_long2int(RARRAY_LEN(self));
|
72
80
|
|
73
81
|
if (array_length <= 1) {
|
74
82
|
rb_raise(rb_eRangeError, "array must have more than one element");
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_native_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cory Buecker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.6.11
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: This is a native extension to Ruby that adds various statistical functions
|