Class: RClusters::Base
- Inherits:
-
Object
- Object
- RClusters::Base
- Defined in:
- lib/rclusters/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #calculate(points = nil, max_distance = nil, opts = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
3 4 5 6 |
# File 'lib/rclusters/base.rb', line 3 def initialize(opts = {}) @points = opts[:points] @max_distance = opts[:max_distance] end |
Instance Method Details
#calculate(points = nil, max_distance = nil, opts = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/rclusters/base.rb', line 8 def calculate(points = nil,max_distance = nil, opts={}) points ||= @points max_distance ||= @max_distance cluster(points,max_distance,opts) end |