MCPcopy Create free account
hub / github.com/ImageEngine/cortex / doNearestNeighbour

Method doNearestNeighbour

test/IECore/KDTree.py:45–56  ·  view source on GitHub ↗
(self, numPoints)

Source from the content-addressed store, hash-verified

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

Callers 4

testNearestNeighbourMethod · 0.80
testNearestNeighbourMethod · 0.80
testNearestNeighbourMethod · 0.80
testNearestNeighbourMethod · 0.80

Calls 2

nearestNeighbourMethod · 0.80
makeTreeMethod · 0.45

Tested by

no test coverage detected