Created
April 10, 2012 11:03
-
-
Save jalada/2350481 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DNA | |
def self.points | |
raw_points = 1000.times.map do |p| | |
5.times.map do |c| | |
Random.rand(100) | |
end | |
end | |
raw_points.map{|p| KDTree::Point.new(p)} | |
end | |
def self.tree | |
@tree ||= KDTree.new(self.points) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment