-
Notifications
You must be signed in to change notification settings - Fork 5
/
GridCDFRDDTest10x10.scala
44 lines (36 loc) · 1.49 KB
/
GridCDFRDDTest10x10.scala
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
package org.hammerlab.magic.rdd.grid
class GridCDFRDDTest10x10
extends PrefixSumTest(10) {
/*
Input matrix:
9 8 7 6 5 4 3 2 1 0
19 18 17 16 15 14 13 12 11 10
29 28 27 26 25 24 23 22 21 20
39 38 37 36 35 34 33 32 31 30
49 48 47 46 45 44 43 42 41 40
59 58 57 56 55 54 53 52 51 50
69 68 67 66 65 64 63 62 61 60
79 78 77 76 75 74 73 72 71 70
89 88 87 86 85 84 83 82 81 80
99 98 97 96 95 94 93 92 91 90
*/
val expectedStr =
"""
| 45 36 28 21 15 10 6 3 1 0
| 190 162 136 112 90 70 52 36 22 10
| 435 378 324 273 225 180 138 99 63 30
| 780 684 592 504 420 340 264 192 124 60
| 1225 1080 940 805 675 550 430 315 205 100
| 1770 1566 1368 1176 990 810 636 468 306 150
| 2415 2142 1876 1617 1365 1120 882 651 427 210
| 3160 2808 2464 2128 1800 1480 1168 864 568 280
| 4005 3564 3132 2709 2295 1890 1494 1107 729 360
| 4950 4410 3880 3360 2850 2350 1860 1380 910 450
"""
test("1-1") { testFn(1, 1) }
test("3-3") { testFn(3, 3) }
test("4-4") { testFn(4, 4) }
test("10-10") { testFn(10, 10) }
test("2-8") { testFn(2, 8) }
test("8-2") { testFn(8, 2) }
}