buncher 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/buncher/extconf.rb +5 -0
- data/lib/buncher.rb +2 -1
- metadata +2 -2
data/ext/buncher/extconf.rb
CHANGED
@@ -4,6 +4,11 @@ require 'mkmf'
|
|
4
4
|
# Give it a name
|
5
5
|
extension_name = 'buncher'
|
6
6
|
|
7
|
+
# still necessary in order to avoid compile errors like this:
|
8
|
+
# https://gist.github.com/48a9a212fd8f9011009f
|
9
|
+
# isnan - not a member of std:
|
10
|
+
# random library - doesn't exist
|
11
|
+
# and other incompatibilities
|
7
12
|
self.class::CONFIG['CXX'] = "#{self.class::CONFIG['CXX']} -std=c++11"
|
8
13
|
# The destination
|
9
14
|
dir_config(extension_name)
|
data/lib/buncher.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'buncher/buncher'
|
2
2
|
module Buncher
|
3
|
-
VERSION = "1.0.
|
3
|
+
VERSION = "1.0.11"
|
4
4
|
# your cluster needs to look like this. Make a bunch of them and pass them in. It's ok to pass in empty elements to start.
|
5
5
|
class Cluster
|
6
6
|
attr_accessor :elements
|
@@ -67,6 +67,7 @@ module Buncher
|
|
67
67
|
# that.
|
68
68
|
not_clustered = last_sK = last_aK =last_fK=nil
|
69
69
|
max_clusters=[min_size,(elements.size/2).floor].max
|
70
|
+
max_clusters=[max_clusters,elements.size].min
|
70
71
|
(1..max_clusters).each do |number_clusters|
|
71
72
|
initial_centers = choose_centers(elements, weights, number_clusters) # C++ Native code
|
72
73
|
centers = initial_centers.map(&:dup)
|
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.11
|
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-
|
12
|
+
date: 2015-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|