(self, numPoints)
| 43 | numNeighbours = [1, 4, 10, 20] |
| 44 | |
| 45 | def doNearestNeighbour(self, numPoints): |
| 46 | |
| 47 | self.makeTree(numPoints) |
| 48 | |
| 49 | for i in range(0, numPoints): |
| 50 | pIdx = self.tree.nearestNeighbour( self.points[i] ) |
| 51 | self.assertTrue(pIdx >= 0) |
| 52 | self.assertTrue(pIdx < numPoints) |
| 53 | nearestPt = self.points[pIdx] |
| 54 | |
| 55 | self.assertEqual( pIdx, i ) |
| 56 | self.assertTrue( nearestPt.equalWithRelError(self.points[i], 0.00001) ) |
| 57 | |
| 58 | def doNearestNeighbours(self, numPoints): |
| 59 |
no test coverage detected