Phpml\Clustering\KMeans\Space::getBoundaries PHP Method

getBoundaries() public method

public getBoundaries ( ) : array | boolean
return array | boolean
    public function getBoundaries()
    {
        if (!count($this)) {
            return false;
        }
        $min = $this->newPoint(array_fill(0, $this->dimension, null));
        $max = $this->newPoint(array_fill(0, $this->dimension, null));
        foreach ($this as $point) {
            for ($n = 0; $n < $this->dimension; ++$n) {
                ($min[$n] > $point[$n] || $min[$n] === null) && ($min[$n] = $point[$n]);
                ($max[$n] < $point[$n] || $max[$n] === null) && ($max[$n] = $point[$n]);
            }
        }
        return array($min, $max);
    }