Class: Cluda::Chebyshev

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

Class Method Summary collapse

Class Method Details

.distance(x0, x) ⇒ Object



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

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

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