2016-04-11 19:44:48 +00:00
|
|
|
<?php
|
|
|
|
|
2016-11-20 21:53:17 +00:00
|
|
|
declare(strict_types=1);
|
2016-04-11 19:44:48 +00:00
|
|
|
|
2016-04-20 21:56:33 +00:00
|
|
|
namespace Phpml\Math\Distance;
|
2016-04-11 19:44:48 +00:00
|
|
|
|
2019-02-06 07:00:17 +00:00
|
|
|
/**
|
|
|
|
* Class Chebyshev
|
|
|
|
*/
|
|
|
|
class Chebyshev extends Distance
|
2016-04-11 19:44:48 +00:00
|
|
|
{
|
|
|
|
/**
|
2019-02-06 07:00:17 +00:00
|
|
|
* {@inheritdoc}
|
2016-04-11 19:44:48 +00:00
|
|
|
*/
|
2017-11-22 21:16:10 +00:00
|
|
|
public function distance(array $a, array $b): float
|
2016-04-11 19:44:48 +00:00
|
|
|
{
|
2019-02-06 07:00:17 +00:00
|
|
|
return max($this->deltas($a, $b));
|
2016-04-11 19:44:48 +00:00
|
|
|
}
|
|
|
|
}
|