buncher 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/buncher/cluster.cpp +3 -5
- data/lib/buncher.rb +1 -1
- metadata +2 -2
data/ext/buncher/cluster.cpp
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
#include "definitions.hpp"
|
2
2
|
#include <random>
|
3
|
-
#include <limits>
|
4
|
-
#include <math.h>
|
5
3
|
|
6
4
|
VALUE new_array()
|
7
5
|
{
|
@@ -21,7 +19,7 @@ VALUE element_at(VALUE rb_array, int index)
|
|
21
19
|
|
22
20
|
double coalesce(double in)
|
23
21
|
{
|
24
|
-
return isnan(in) ? 0.0 : in;
|
22
|
+
return std::isnan(in) ? 0.0 : in;
|
25
23
|
}
|
26
24
|
|
27
25
|
double nullif(VALUE rb_float)
|
@@ -31,7 +29,7 @@ double nullif(VALUE rb_float)
|
|
31
29
|
|
32
30
|
VALUE rb_nullif(double in)
|
33
31
|
{
|
34
|
-
return isnan(in) ? Qnil : DBL2NUM(in);
|
32
|
+
return std::isnan(in) ? Qnil : DBL2NUM(in);
|
35
33
|
}
|
36
34
|
|
37
35
|
Weights::Weights(VALUE rb_element)
|
@@ -78,7 +76,7 @@ double Element::distance(Element& other, Weights& weights)
|
|
78
76
|
double rslt=0.0;
|
79
77
|
double sum=0.0;
|
80
78
|
for(int iii=0;iii<size() && iii<other.size() && iii<weights.size();iii++)
|
81
|
-
if(!(isnan((*this)[iii]) && isnan(other[iii])))
|
79
|
+
if(!(std::isnan((*this)[iii]) && std::isnan(other[iii])))
|
82
80
|
{
|
83
81
|
double distance = coalesce((*this)[iii]) - coalesce(other[iii]);
|
84
82
|
sum+=weights[iii];
|
data/lib/buncher.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buncher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|