| 1 | <?php |
||
| 13 | abstract class Distance implements DistanceInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var float|int |
||
| 17 | */ |
||
| 18 | public $norm = 2; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Distance constructor. |
||
| 22 | * @param float $norm |
||
| 23 | */ |
||
| 24 | public function __construct(float $norm = 3.0) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param array $a |
||
| 31 | * @param array $b |
||
| 32 | * |
||
| 33 | * @return float |
||
| 34 | * |
||
| 35 | * @throws InvalidArgumentException |
||
| 36 | */ |
||
| 37 | public function distance(array $a, array $b): float |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param array $a |
||
| 53 | * @param array $b |
||
| 54 | * |
||
| 55 | * @return array |
||
| 56 | * |
||
| 57 | * @throws InvalidArgumentException |
||
| 58 | */ |
||
| 59 | protected function deltas(array $a, array $b): array |
||
| 73 | } |
||
| 74 |