| 1 | <?php |
||
| 5 | abstract class SearchAbstract |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var KDTreeInterface |
||
| 9 | */ |
||
| 10 | protected $tree; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | protected $dimensions; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * SearchAbstract constructor. |
||
| 19 | * @param KDTreeInterface $tree |
||
| 20 | */ |
||
| 21 | 42 | public function __construct(KDTreeInterface $tree) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Search items it the tree by given algorithm |
||
| 29 | * |
||
| 30 | * @param PointInterface $point |
||
| 31 | * @param int $resultLength |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | abstract public function search(PointInterface $point, int $resultLength = 1) : array; |
||
| 35 | } |
||
| 36 |