kder 0.0.3 → 0.0.5

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.
Files changed (3) hide show
  1. data/lib/kder/kde.rb +3 -1
  2. data/lib/kder/version.rb +1 -1
  3. metadata +2 -2
@@ -6,6 +6,7 @@ class Kder
6
6
  Sigmas = 2.5
7
7
  MeshCount = 2e3
8
8
  MinimumThresholdValue = 1e-2
9
+ MinimumStepSize = 1e-3
9
10
  class << self
10
11
  ##
11
12
  # :singleton-method: kde
@@ -18,7 +19,8 @@ class Kder
18
19
  # Initialization steps
19
20
  min = arr.min - bw*opts[:sigmas]
20
21
  max = arr.max + bw*opts[:sigmas]
21
- step_size = (max-min)/opts[:sampling_density].to_f
22
+ step_size = (max-min)/(opts[:sampling_density].to_f)
23
+ step_size = step_size < MinimumStepSize ? MinimumStepSize : step_size
22
24
  arr.sort!
23
25
  # Step through the range
24
26
  output = (min..max).step(step_size).map do |mid|
@@ -1,3 +1,3 @@
1
1
  class Kder
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
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: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-05-31 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A KDE implementation in Ruby.
15
15
  email: