*/ public function compatibility() : array { return [ DataType::continuous(), ]; } /** * Compute the distance between two vectors. * * @internal * * @param list $a * @param list $b * @return float */ public function compute(array $a, array $b) : float { $deltas = []; foreach ($a as $i => $value) { $deltas[] = abs($value - $b[$i]); } return max($deltas) ?: 0.0; } /** * Return the string representation of the object. * * @internal * * @return string */ public function __toString() : string { return 'Diagonal'; } }