public function range(array $sample, float $radius) : array
    {
        if ($radius <= 0.) {
            throw new InvalidArgumentException('Radius must be'
                . " greater than 0, $radius given.");
        }

        $samples = $labels = $distances = [];

        $stack = [$this->root];

        while ($stack) {
            $current = array_pop($stack);

            if (!$current instanceof BinaryNode) {
                continue 1;
            }

            if ($current instanceof Cluster) {
                foreach ($current->samples() as $i => $neighbor) {
                    $distance = $this->kernel->compute($sample, $neighbor);

                    if ($distance <= $radius) {
                        $samples[] = $neighbor;
                        $labels[] = $current->label($i);
                        $distances[] = $distance;
                    }
                }

                continue 1;
            }

            foreach ($current->children() as $child) {
                if ($child instanceof Ball) {
                    $distance = $this->kernel->compute($sample, $child->center());

                    if ($distance <= ($child->radius() + $radius)) {
                        $stack[] = $child;
                    }
                }
            }
        }

        return [$samples, $labels, $distances];
    }