(self, rr)
| 605 | self._xhs = xhs |
| 606 | |
| 607 | def query(self, rr): |
| 608 | nearest = list() |
| 609 | dists = list() |
| 610 | for r in rr: |
| 611 | d = cdist(r[np.newaxis, :], self._xhs) |
| 612 | idx = np.argmin(d) |
| 613 | nearest.append(idx) |
| 614 | dists.append(d[0, idx]) |
| 615 | return np.array(dists), np.array(nearest) |
| 616 | |
| 617 | |
| 618 | def _compute_nearest(xhs, rr, method="BallTree", return_dists=False): |
no test coverage detected