Libraryless. Click here for Pure Java version (4919L/27K).
svoid test_PtTree() { int n = 10; Set<Pt> set = repFToSet(n, () -> randomPt(10)); print(set); PtTree tree = PtTree.fromPointSet(set); //printIndentedStruct(tree); print(asList(iterator(tree))); for (var p : set) { Rect r = rectAround(p, 1); var l = tree.pointsIn(r); printVars(+p, +l); assertTrueVerbose(str(r), l.contains(p)); for (p2 : set) if (!r.contains(p2)) if (l.contains(p2)) fail("Bad bad: " + p2); } }
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032242 |
Snippet name: | test_PtTree [OK] |
Eternal ID of this version: | #1032242/1 |
Text MD5: | b32f10cfb0adadd7a2d0d08d232ace39 |
Transpilation MD5: | 7d9393f1f10a4232387aaa284ea3e707 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-21 04:54:35 |
Source code size: | 488 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 123 / 187 |
Referenced in: | [show references] |