-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assignment5-KdTree-SearchTree.txt
656 lines (514 loc) · 27.5 KB
/
Assignment5-KdTree-SearchTree.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
See the Assessment Guide for information on how to interpret this report.
ASSESSMENT SUMMARY
Compilation: PASSED
API: PASSED
Findbugs: FAILED (3 warnings)
PMD: PASSED
Checkstyle: FAILED (0 errors, 2 warnings)
Correctness: 36/36 tests passed
Memory: 16/16 tests passed
Timing: 42/42 tests passed
Aggregate score: 100.00%
[Compilation: 5%, API: 5%, Findbugs: 0%, PMD: 0%, Checkstyle: 0%, Correctness: 60%, Memory: 10%, Timing: 20%]
ASSESSMENT DETAILS
The following files were submitted:
----------------------------------
6.8K Jul 7 06:28 KdTree.java
3.4K Jul 7 06:28 PointSET.java
********************************************************************************
* COMPILING
********************************************************************************
% javac PointSET.java
*-----------------------------------------------------------
% javac KdTree.java
*-----------------------------------------------------------
================================================================
Checking the APIs of your programs.
*-----------------------------------------------------------
PointSET:
KdTree:
================================================================
********************************************************************************
* CHECKING STYLE AND COMMON BUG PATTERNS
********************************************************************************
% findbugs *.class
*-----------------------------------------------------------
M D MOM_MISLEADING_OVERLOAD_MODEL MOM: Class KdTree 'overloads' a method with both instance and static versions At KdTree.java:[lines 109-113]
M D MOM_MISLEADING_OVERLOAD_MODEL MOM: Class KdTree 'overloads' a method with both instance and static versions At KdTree.java:[lines 124-138]
M D MOM_MISLEADING_OVERLOAD_MODEL MOM: Class KdTree 'overloads' a method with both instance and static versions At KdTree.java:[lines 154-158]
Warnings generated: 3
================================================================
% pmd .
*-----------------------------------------------------------
KdTree.java:71: Avoid using assignment statements in expressions; this can make code harder to read. [AssignmentInOperand]
PMD ends with 1 warning.
================================================================
% checkstyle *.java
*-----------------------------------------------------------
[WARN] KdTree.java:16:31: The instance variable 'VERTICAL' must start with a lowercase letter and use camelCase. [MemberName]
[WARN] KdTree.java:19:46: The parameter variable 'VERTICAL' must start with a lowercase letter and use camelCase. [ParameterName]
Checkstyle ends with 0 errors and 2 warnings.
% custom checkstyle checks for PointSET.java
*-----------------------------------------------------------
% custom checkstyle checks for KdTree.java
*-----------------------------------------------------------
================================================================
********************************************************************************
* TESTING CORRECTNESS
********************************************************************************
Testing correctness of PointSET
*-----------------------------------------------------------
Running 8 total tests.
A point in an m-by-m grid means that it is of the form (i/m, j/m),
where i and j are integers between 0 and m
Test 1: inserting n random points and check size() after each insertion
(size may be less than n because of duplicates)
* 100000 random points in a 65536-by-65536 grid
* 100000 random points in a 8192-by-8192 grid
* 100000 random points in a 1024-by-1024 grid
* 100000 random points in a 128-by-128 grid
* 100000 random points in a 16-by-16 grid
==> passed
Test 2: check isEmpty() for n = 0, 1, and 2 points
* 0 points
* 1 point
* 2 points
==> passed
Test 3: insert n random points and check contains() for n random query points
* 100000 random points in a 65536-by-65536 grid
* 100000 random points in a 8192-by-8192 grid
* 100000 random points in a 1024-by-1024 grid
* 100000 random points in a 128-by-128 grid
* 100000 random points in a 16-by-16 grid
==> passed
Test 4: insert n random points and check nearest() for n random query points
* 1000 random points in a 65536-by-65536 grid
* 1000 random points in a 8192-by-8192 grid
* 1000 random points in a 1024-by-1024 grid
* 1000 random points in a 128-by-128 grid
* 1000 random points in a 16-by-16 grid
==> passed
Test 5: insert n random points and check range() for n random query rectangles
* 1000 random rectangles and points in a 65536-by-65536 grid
* 1000 random rectangles and points in a 8192-by-8192 grid
* 1000 random rectangles and points in a 1024-by-1024 grid
* 1000 random rectangles and points in a 128-by-128 grid
* 1000 random rectangles and points in a 16-by-16 grid
==> passed
Test 6: check intermixed sequence of calls to isEmpty(), size(),
insert(), contains(), range(), and nearest() with probabilities
p1, p2, p3, p4, p5, and p6, respectively
* 10000 calls with random points in a 8192-by-8192 grid
and probabilities 0.05, 0.05, 0.3, 0.2, 0.2, 0.2
* 10000 calls with random points in a 1024-by-1024 grid
and probabilities 0.05, 0.05, 0.3, 0.2, 0.2, 0.2
* 10000 calls with random points in a 128-by-128 grid
and probabilities 0.05, 0.05, 0.3, 0.2, 0.2, 0.2
* 10000 calls with random points in a 16-by-16 grid
and probabilities 0.05, 0.05, 0.3, 0.2, 0.2, 0.2
* 10000 calls with random points in a 1-by-1 grid
and probabilities 0.05, 0.05, 0.3, 0.2, 0.2, 0.2
==> passed
Test 7: check intermixed sequence of calls to isEmpty(), size(),
insert(), contains(), range(), and nearest() with probabilities
p1, p2, p3=0, p4, p5, and p6, respectively
(data structure with 0 points)
* 1000 calls with random points in a 1024-by-1024 grid
and probabilities 0.5, 0.5, 0.0, 0.0, 0.0, 0.0
* 1000 calls with random points in a 1024-by-1024 grid
and probabilities 0.2, 0.2, 0.0, 0.6, 0.0, 0.0
* 1000 calls with random points in a 1024-by-1024 grid
and probabilities 0.2, 0.2, 0.0, 0.0, 0.6, 0.0
* 1000 calls with random points in a 1024-by-1024 grid
and probabilities 0.2, 0.2, 0.0, 0.0, 0.0, 0.6
* 1000 calls with random points in a 1024-by-1024 grid
and probabilities 0.2, 0.2, 0.0, 0.2, 0.2, 0.2
==> passed
Test 8: check whether two PointSET objects can be created at the same time
==> passed
Total: 8/8 tests passed!
================================================================
Testing correctness of KdTree
*-----------------------------------------------------------
Running 28 total tests.
In the tests below, we consider three classes of points and rectangles.
* Non-degenerate points: no two points (or rectangles) share either an
x-coordinate or a y-coordinate
* Distinct points: no two points (or rectangles) share both an
x-coordinate and a y-coordinate
* General points: no restrictions on the x-coordinates or y-coordinates
of the points (or rectangles)
A point in an m-by-m grid means that it is of the form (i/m, j/m),
where i and j are integers between 0 and m (inclusive).
Test 1a: insert points from file; check size() and isEmpty() after each insertion
* input0.txt
* input1.txt
* input5.txt
* input10.txt
==> passed
Test 1b: insert non-degenerate points; check size() and isEmpty() after each insertion
* 1 random non-degenerate points in a 1-by-1 grid
* 5 random non-degenerate points in a 8-by-8 grid
* 10 random non-degenerate points in a 16-by-16 grid
* 50 random non-degenerate points in a 128-by-128 grid
* 500 random non-degenerate points in a 1024-by-1024 grid
* 50000 random non-degenerate points in a 65536-by-65536 grid
==> passed
Test 1c: insert distinct points; check size() and isEmpty() after each insertion
* 1 random distinct points in a 1-by-1 grid
* 10 random distinct points in a 8-by-8 grid
* 20 random distinct points in a 16-by-16 grid
* 10000 random distinct points in a 128-by-128 grid
* 100000 random distinct points in a 1024-by-1024 grid
* 100000 random distinct points in a 65536-by-65536 grid
==> passed
Test 1d: insert general points; check size() and isEmpty() after each insertion
* 5 random general points in a 1-by-1 grid
* 10 random general points in a 4-by-4 grid
* 50 random general points in a 8-by-8 grid
* 100000 random general points in a 16-by-16 grid
* 100000 random general points in a 128-by-128 grid
* 100000 random general points in a 1024-by-1024 grid
==> passed
Test 2a: insert points from file; check contains() with random query points
* input0.txt
* input1.txt
* input5.txt
* input10.txt
==> passed
Test 2b: insert non-degenerate points; check contains() with random query points
* 1 random non-degenerate points in a 1-by-1 grid
* 5 random non-degenerate points in a 8-by-8 grid
* 10 random non-degenerate points in a 16-by-16 grid
* 20 random non-degenerate points in a 32-by-32 grid
* 500 random non-degenerate points in a 1024-by-1024 grid
* 10000 random non-degenerate points in a 65536-by-65536 grid
==> passed
Test 2c: insert distinct points; check contains() with random query points
* 1 random distinct points in a 1-by-1 grid
* 10 random distinct points in a 4-by-4 grid
* 20 random distinct points in a 8-by-8 grid
* 10000 random distinct points in a 128-by-128 grid
* 100000 random distinct points in a 1024-by-1024 grid
* 100000 random distinct points in a 65536-by-65536 grid
==> passed
Test 2d: insert general points; check contains() with random query points
* 10000 random general points in a 1-by-1 grid
* 10000 random general points in a 16-by-16 grid
* 10000 random general points in a 128-by-128 grid
* 10000 random general points in a 1024-by-1024 grid
==> passed
Test 3a: insert points from file; check range() with random query rectangles
* input0.txt
* input1.txt
* input5.txt
* input10.txt
==> passed
Test 3b: insert non-degenerate points; check range() with random query rectangles
* 1 random non-degenerate points and random rectangles in a 2-by-2 grid
* 5 random non-degenerate points and random rectangles in a 8-by-8 grid
* 10 random non-degenerate points and random rectangles in a 16-by-16 grid
* 20 random non-degenerate points and random rectangles in a 32-by-32 grid
* 500 random non-degenerate points and random rectangles in a 1024-by-1024 grid
* 10000 random non-degenerate points and random rectangles in a 65536-by-65536 grid
==> passed
Test 3c: insert distinct points; check range() with random query rectangles
* 2 random distinct points and random rectangles in a 2-by-2 grid
* 10 random distinct points and random rectangles in a 4-by-4 grid
* 20 random distinct points and random rectangles in a 8-by-8 grid
* 100 random distinct points and random rectangles in a 16-by-16 grid
* 1000 random distinct points and random rectangles in a 64-by-64 grid
* 10000 random distinct points and random rectangles in a 128-by-128 grid
==> passed
Test 3d: insert general points; check range() with random query rectangles
* 5000 random general points and random rectangles in a 2-by-2 grid
* 5000 random general points and random rectangles in a 16-by-16 grid
* 5000 random general points and random rectangles in a 128-by-128 grid
* 5000 random general points and random rectangles in a 1024-by-1024 grid
==> passed
Test 3e: insert random points; check range() with tiny rectangles
enclosing each point
* 5 tiny rectangles and 5 general points in a 2-by-2 grid
* 10 tiny rectangles and 10 general points in a 4-by-4 grid
* 20 tiny rectangles and 20 general points in a 8-by-8 grid
* 5000 tiny rectangles and 5000 general points in a 128-by-128 grid
* 5000 tiny rectangles and 5000 general points in a 1024-by-1024 grid
* 5000 tiny rectangles and 5000 general points in a 65536-by-65536 grid
==> passed
Test 4a: insert points from file; check range() with random query rectangles
and check traversal of kd-tree
* input5.txt
* input10.txt
==> passed
Test 4b: insert non-degenerate points; check range() with random query rectangles
and check traversal of kd-tree
* 3 random non-degenerate points and 1000 random rectangles in a 4-by-4 grid
* 6 random non-degenerate points and 1000 random rectangles in a 8-by-8 grid
* 10 random non-degenerate points and 1000 random rectangles in a 16-by-16 grid
* 20 random non-degenerate points and 1000 random rectangles in a 32-by-32 grid
* 30 random non-degenerate points and 1000 random rectangles in a 64-by-64 grid
==> passed
Test 5a: insert points from file; check nearest() with random query points
* input0.txt
* input1.txt
* input5.txt
* input10.txt
==> passed
Test 5b: insert non-degenerate points; check nearest() with random query points
* 5 random non-degenerate points in a 8-by-8 grid
* 10 random non-degenerate points in a 16-by-16 grid
* 20 random non-degenerate points in a 32-by-32 grid
* 30 random non-degenerate points in a 64-by-64 grid
* 10000 random non-degenerate points in a 65536-by-65536 grid
==> passed
Test 5c: insert distinct points; check nearest() with random query points
* 10 random distinct points in a 4-by-4 grid
* 15 random distinct points in a 8-by-8 grid
* 20 random distinct points in a 16-by-16 grid
* 100 random distinct points in a 32-by-32 grid
* 10000 random distinct points in a 65536-by-65536 grid
==> passed
Test 5d: insert general points; check nearest() with random query points
* 10000 random general points in a 16-by-16 grid
* 10000 random general points in a 128-by-128 grid
* 10000 random general points in a 1024-by-1024 grid
==> passed
Test 6a: insert points from file; check nearest() with random query points
and check traversal of kd-tree
* input5.txt
* input10.txt
==> passed
Test 6b: insert non-degenerate points; check nearest() with random query points
and check traversal of kd-tree
* 5 random non-degenerate points in a 8-by-8 grid
* 10 random non-degenerate points in a 16-by-16 grid
* 20 random non-degenerate points in a 32-by-32 grid
* 30 random non-degenerate points in a 64-by-64 grid
* 50 random non-degenerate points in a 128-by-128 grid
* 1000 random non-degenerate points in a 2048-by-2048 grid
==> passed
Test 7: insert n random points; check that repeated calls to get(),
range(), and nearest() with the same argument yield same results
* 10 random general points in a 4-by-4 grid
* 20 random general points in a 8-by-8 grid
* 100 random general points in a 128-by-128 grid
* 1000 random general points in a 65536-by-65536 grid
==> passed
Test 8a: check intermixed sequence of calls to insert(), isEmpty(),
size(), contains(), range(), and nearest() with probabilities
(p1, p2, p3, p4, p5, p6), respectively
* 20000 calls with non-degenerate points in a 1-by-1 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with non-degenerate points in a 16-by-16 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with non-degenerate points in a 128-by-128 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with non-degenerate points in a 1024-by-1024 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with non-degenerate points in a 8192-by-8192 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with non-degenerate points in a 65536-by-65536 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
==> passed
Test 8b: check intermixed sequence of calls to insert(), isEmpty(),
size(), contains(), range(), and nearest() with probabilities
(p1, p2, p3, p4, p5, p6), respectively
* 20000 calls with distinct points in a 1-by-1 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with distinct points in a 10-by-10 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with distinct points in a 100-by-100 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with distinct points in a 1000-by-1000 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with distinct points in a 8192-by-8192 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with distinct points in a 65536-by-65536 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
==> passed
Test 8c: check intermixed sequence of calls to insert(), isEmpty(),
size(), contains(), range(), and nearest() with probabilities
(p1, p2, p3, p4, p5, p6), respectively
* 20000 calls with general points in a 1-by-1 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with general points in a 10-by-10 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with general points in a 100-by-100 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with general points in a 1000-by-1000 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with general points in a 8192-by-8192 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
* 20000 calls with general points in a 65536-by-65536 grid
and probabilities (0.3, 0.05, 0.05, 0.2, 0.2, 0.2)
==> passed
Test 9: check intermixed sequence of calls to insert(), isEmpty(),
size(), contains(), range(), and nearest() with probabilities
(p1=0, p2, p3, p4, p5, p6), respectively
(data structure with 0 points)
* 1000 calls with no points in a 1024-by-1024 grid
and probabilities (0.0, 0.5, 0.5, 0.0, 0.0, 0.0)
* 1000 calls with no points in a 1024-by-1024 grid
and probabilities (0.0, 0.2, 0.2, 0.6, 0.0, 0.0)
* 1000 calls with no points in a 1024-by-1024 grid
and probabilities (0.0, 0.2, 0.2, 0.0, 0.6, 0.0)
* 1000 calls with no points in a 1024-by-1024 grid
and probabilities (0.0, 0.2, 0.2, 0.0, 0.0, 0.6)
* 1000 calls with no points in a 1024-by-1024 grid
and probabilities (0.0, 0.2, 0.2, 0.2, 0.2, 0.2)
==> passed
Test 10: check that two KdTree objects can be created at the same time
==> passed
Test 11: check that the specified exception is thrown with null arguments
* argument to insert() is null
* argument to contains() is null
* argument to range() is null
* argument to nearest() is null
==> passed
Total: 28/28 tests passed!
================================================================
********************************************************************************
* MEMORY
********************************************************************************
Analyzing memory of Point2D
*-----------------------------------------------------------
Memory of Point2D object = 32 bytes
================================================================
Analyzing memory of RectHV
*-----------------------------------------------------------
Memory of RectHV object = 48 bytes
================================================================
Analyzing memory of PointSET
*-----------------------------------------------------------
Running 8 total tests.
Memory usage of a PointSET with n points (including Point2D and RectHV objects).
Maximum allowed memory is 96n + 200 bytes.
n student (bytes) reference (bytes)
--------------------------------------------------------------
=> passed 1 240 264
=> passed 2 336 360
=> passed 5 624 648
=> passed 10 1104 1128
=> passed 25 2544 2568
=> passed 100 9744 9768
=> passed 400 38544 38568
=> passed 800 76944 76968
==> 8/8 tests passed
Total: 8/8 tests passed!
Estimated student memory (bytes) = 96.00 n + 144.00 (R^2 = 1.000)
Estimated reference memory (bytes) = 96.00 n + 168.00 (R^2 = 1.000)
================================================================
Analyzing memory of KdTree
*-----------------------------------------------------------
Running 8 total tests.
Memory usage of a KdTree with n points (including Point2D and RectHV objects).
Maximum allowed memory is 312n + 192 bytes.
n student (bytes) reference (bytes)
--------------------------------------------------------------
=> passed 1 168 160
=> passed 2 304 288
=> passed 5 712 672
=> passed 10 1392 1312
=> passed 25 3432 3232
=> passed 100 13632 12832
=> passed 400 54432 51232
=> passed 800 108832 102432
==> 8/8 tests passed
Total: 8/8 tests passed!
Estimated student memory (bytes) = 136.00 n + 32.00 (R^2 = 1.000)
Estimated reference memory (bytes) = 128.00 n + 32.00 (R^2 = 1.000)
================================================================
********************************************************************************
* TIMING
********************************************************************************
Timing PointSET
*-----------------------------------------------------------
Running 14 total tests.
Inserting n points into a PointSET
n ops per second
----------------------------------------
=> passed 160000 1488125
=> passed 320000 1489035
=> passed 640000 1196616
=> passed 1280000 892926
==> 4/4 tests passed
Performing contains() queries after inserting n points into a PointSET
n ops per second
----------------------------------------
=> passed 160000 388384
=> passed 320000 372373
=> passed 640000 328307
=> passed 1280000 295304
==> 4/4 tests passed
Performing range() queries after inserting n points into a PointSET
n ops per second
----------------------------------------
=> passed 10000 3911
=> passed 20000 1773
=> passed 40000 734
==> 3/3 tests passed
Performing nearest() queries after inserting n points into a PointSET
n ops per second
----------------------------------------
=> passed 10000 4677
=> passed 20000 2169
=> passed 40000 859
==> 3/3 tests passed
Total: 14/14 tests passed!
================================================================
Timing KdTree
*-----------------------------------------------------------
Running 28 total tests.
Test 1a-d: Insert n points into a 2d tree. The table gives the average number of calls
to methods in RectHV and Point per call to insert().
Point2D
n ops per second RectHV() x() y() equals()
----------------------------------------------------------------------------------------------------------------
=> passed 160000 871233 1.0 22.6 21.6 43.3
=> passed 320000 840823 1.0 23.0 22.0 44.1
=> passed 640000 679077 1.0 24.5 23.5 47.1
=> passed 1280000 561942 1.0 26.6 25.6 51.3
==> 4/4 tests passed
Test 2a-h: Perform contains() queries after inserting n points into a 2d tree. The table gives
the average number of calls to methods in RectHV and Point per call to contains().
Point2D
n ops per second x() y() equals()
-----------------------------------------------------------------------------------------------
=> passed 10000 404880 18.5 17.5 36.0
=> passed 20000 414135 19.7 18.7 38.3
=> passed 40000 400776 21.8 20.8 42.6
=> passed 80000 383921 22.0 21.0 43.0
=> passed 160000 352000 23.2 22.2 45.5
=> passed 320000 316771 25.0 24.0 49.1
=> passed 640000 278957 25.7 24.7 50.4
=> passed 1280000 252557 27.2 26.2 53.4
==> 8/8 tests passed
Test 3a-h: Perform range() queries after inserting n points into a 2d tree. The table gives
the average number of calls to methods in RectHV and Point per call to range().
n ops per second intersects() contains() x() y()
---------------------------------------------------------------------------------------------------------------
=> passed 10000 290221 49.4 31.1 50.1 12.1
=> passed 20000 268665 51.7 32.6 53.3 16.2
=> passed 40000 239180 63.9 39.3 63.1 14.1
=> passed 80000 224171 66.1 40.7 65.2 14.9
=> passed 160000 196648 69.0 42.5 70.9 20.4
=> passed 320000 160720 66.0 40.2 65.2 15.7
=> passed 640000 139661 71.0 43.3 70.7 19.2
=> passed 1280000 121194 77.7 47.0 74.8 14.2
==> 8/8 tests passed
Test 4a-h: Perform nearest() queries after inserting n points into a 2d tree. The table gives
the average number of calls to methods in RectHV and Point per call to nearest().
Point2D RectHV
n ops per second distanceSquaredTo() distanceSquaredTo() x() y()
------------------------------------------------------------------------------------------------------------------------
=> passed 10000 290088 69.0 19.4 69.6 68.8
=> passed 20000 294582 75.9 21.6 76.7 76.1
=> passed 40000 261747 89.4 25.6 91.7 89.9
=> passed 80000 250007 91.3 26.3 92.5 92.5
=> passed 160000 213046 99.2 28.7 101.5 101.1
=> passed 320000 174273 103.5 30.1 106.3 104.8
=> passed 640000 141768 107.4 31.2 109.6 108.9
=> passed 1280000 116551 120.3 35.2 122.9 122.2
==> 8/8 tests passed
Total: 28/28 tests passed!
================================================================