Class: Cluda::Manhattan

Inherits:
Distance show all
Defined in:
lib/cluda/distances/manhattan.rb

Class Method Summary collapse

Class Method Details

.distance(x0, x) ⇒ Object



4
5
6
7
8
# File 'lib/cluda/distances/manhattan.rb', line 4

def self.distance(x0, x)
  Cluda.validate( [x0,x] )

  (x0[:x] - x[:x]).abs + (x0[:y] - x[:y]).abs
end