enumerable-statistics 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/enumerable/statistics/extension/statistics.c +16 -10
- data/lib/enumerable_statistics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caf1b8203b177aef325480c7d7d5a4c0ddb7cecdad3d12944d4b2caa71eebe13
|
4
|
+
data.tar.gz: 00d91f25e099eb2577eb1f6078dafb5c884538fe3863eb1b6795de58c0c3b642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9ab8a29752eb46cd00bf8f3f9787d6f151bc10e06d2179fa5f80e3ebb4625b96144a49fd907eb52c02e8f88767f9da1717761643d87e1489677a9eab227af9
|
7
|
+
data.tar.gz: de2d3d348ead4d6e99cffdb66f95a56ac7cfe603a4450db23deaddb6eeb82e454f79e84c236ea89142ea334999a82c6c307e16ac7085b1afe2895c63a6a8c5d4
|
data/CHANGELOG.md
CHANGED
@@ -2104,10 +2104,15 @@ histogram_edge_bin_index(VALUE edge, VALUE rb_x, int left_p)
|
|
2104
2104
|
static void
|
2105
2105
|
histogram_weights_push_values(VALUE bin_weights, VALUE edge, VALUE values, VALUE weight_array, int left_p)
|
2106
2106
|
{
|
2107
|
+
const VALUE one = INT2FIX(1);
|
2108
|
+
long bi, i, n, n_bins, weighted = 0;
|
2107
2109
|
VALUE x, cur;
|
2108
|
-
|
2110
|
+
|
2111
|
+
assert(RB_TYPE_P(edge, T_ARRAY));
|
2112
|
+
assert(RB_TYPE_P(values, T_ARRAY));
|
2109
2113
|
|
2110
2114
|
n = RARRAY_LEN(values);
|
2115
|
+
n_bins = RARRAY_LEN(edge) - 1;
|
2111
2116
|
|
2112
2117
|
if (! NIL_P(weight_array)) {
|
2113
2118
|
assert(RB_TYPE_P(weight_array, T_ARRAY));
|
@@ -2115,7 +2120,6 @@ histogram_weights_push_values(VALUE bin_weights, VALUE edge, VALUE values, VALUE
|
|
2115
2120
|
weighted = 1;
|
2116
2121
|
}
|
2117
2122
|
|
2118
|
-
one = INT2FIX(1);
|
2119
2123
|
for (i = 0; i < n; ++i) {
|
2120
2124
|
x = RARRAY_AREF(values, i);
|
2121
2125
|
|
@@ -2143,15 +2147,17 @@ histogram_weights_push_values(VALUE bin_weights, VALUE edge, VALUE values, VALUE
|
|
2143
2147
|
|
2144
2148
|
bi = histogram_edge_bin_index(edge, x, left_p);
|
2145
2149
|
|
2146
|
-
|
2147
|
-
|
2148
|
-
cur
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2150
|
+
if (0 <= bi && bi < n_bins) {
|
2151
|
+
cur = rb_ary_entry(bin_weights, bi);
|
2152
|
+
if (NIL_P(cur)) {
|
2153
|
+
cur = w;
|
2154
|
+
}
|
2155
|
+
else {
|
2156
|
+
cur = rb_funcall(cur, idPLUS, 1, w);
|
2157
|
+
}
|
2153
2158
|
|
2154
|
-
|
2159
|
+
rb_ary_store(bin_weights, bi, cur);
|
2160
|
+
}
|
2155
2161
|
}
|
2156
2162
|
return;
|
2157
2163
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerable-statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Murata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -289,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
289
|
- !ruby/object:Gem::Version
|
290
290
|
version: '0'
|
291
291
|
requirements: []
|
292
|
-
rubygems_version: 3.2.
|
292
|
+
rubygems_version: 3.2.21
|
293
293
|
signing_key:
|
294
294
|
specification_version: 4
|
295
295
|
summary: Statistics features for Enumerable
|