@@ -36,14 +36,14 @@ class BoruvkaAlgorithmFunctionsTest {
36
36
@ Test
37
37
void singleComponentShouldWorkOnLeaf (){
38
38
KdNode kdNode = KdNode .createLeaf (0 , 0 , 4 , null );
39
- var kdTree =new KdTree (
39
+ var kdTree = new KdTree (
40
40
HugeLongArray .of (0 ,1 ,2 ,3 ),
41
41
null ,
42
42
kdNode ,
43
43
1
44
44
);
45
45
46
- var boruvkaMST = BoruvkaMST .createWithZeroCores (
46
+ var boruvkaMST = BoruvkaMST .createWithZeroCores (
47
47
null ,
48
48
kdTree ,
49
49
4 ,
@@ -62,14 +62,14 @@ void singleComponentShouldWorkOnLeaf(){
62
62
63
63
@ Test
64
64
void singleComponentOrShouldWork (){
65
- var kdTree =new KdTree (
65
+ var kdTree = new KdTree (
66
66
HugeLongArray .of (0 ,1 ,2 ,3 ),
67
67
null ,
68
68
null ,
69
69
1
70
70
);
71
71
72
- var boruvkaMST = BoruvkaMST .createWithZeroCores (
72
+ var boruvkaMST = BoruvkaMST .createWithZeroCores (
73
73
null ,
74
74
kdTree ,
75
75
4 ,
@@ -102,14 +102,14 @@ void singleComponentShouldWorkOnSplitNode(){
102
102
kdNode .leftChild (left );
103
103
kdNode .rightChild (right );
104
104
105
- var kdTree =new KdTree (
105
+ var kdTree = new KdTree (
106
106
HugeLongArray .of (0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ),
107
107
null ,
108
108
kdNode ,
109
109
1
110
110
);
111
111
112
- var boruvkaMST = BoruvkaMST .createWithZeroCores (
112
+ var boruvkaMST = BoruvkaMST .createWithZeroCores (
113
113
null ,
114
114
kdTree ,
115
115
8 ,
@@ -136,7 +136,7 @@ void singleComponentShouldWorkOnSplitNode(){
136
136
137
137
@ Test
138
138
void baseCaseShouldWork (){
139
- DoubleArrayNodePropertyValues nodeProps = new DoubleArrayNodePropertyValues () {
139
+ DoubleArrayNodePropertyValues nodeProps = new DoubleArrayNodePropertyValues () {
140
140
@ Override
141
141
public double [] doubleArrayValue (long nodeId ) {
142
142
return new double []{nodeId };
@@ -154,9 +154,9 @@ public long nodeCount() {
154
154
when (coreResult .createCoreArray ()).thenReturn (HugeDoubleArray .of (0 ,0 ,10 ,10 ,0 ,0 ,0 ,0 ,0 ,0 ));
155
155
when (coreResult .neighboursOf (anyLong ())).thenReturn (new Neighbour [0 ]);
156
156
157
- var distances =new DoubleArrayDistances (nodeProps );
157
+ var distances = new DoubleArrayDistances (nodeProps );
158
158
159
- var boruvkaMST = BoruvkaMST .create (
159
+ var boruvkaMST = BoruvkaMST .create (
160
160
distances ,
161
161
kdTree ,
162
162
coreResult ,
@@ -174,16 +174,16 @@ public long nodeCount() {
174
174
175
175
@ Test
176
176
void baseCaseShouldIgnoreSameComponents (){
177
- DoubleArrayNodePropertyValues nodeProps = mock (DoubleArrayNodePropertyValues .class );
177
+ DoubleArrayNodePropertyValues nodeProps = mock (DoubleArrayNodePropertyValues .class );
178
178
var kdTree = mock (KdTree .class );
179
179
180
180
var coreResult = mock (CoreResult .class );
181
181
when (coreResult .createCoreArray ()).thenReturn (HugeDoubleArray .of (0 ,0 ,10 ,10 ));
182
182
when (coreResult .neighboursOf (anyLong ())).thenReturn (new Neighbour [0 ]);
183
183
184
- var distances =new DoubleArrayDistances (nodeProps );
184
+ var distances = new DoubleArrayDistances (nodeProps );
185
185
186
- var boruvkaMST = BoruvkaMST .create (
186
+ var boruvkaMST = BoruvkaMST .create (
187
187
distances ,
188
188
kdTree ,
189
189
coreResult ,
@@ -199,13 +199,13 @@ void baseCaseShouldIgnoreSameComponents(){
199
199
@ Test
200
200
void shouldPruneProperly (){
201
201
202
- DoubleArrayNodePropertyValues nodeProps = mock (DoubleArrayNodePropertyValues .class );
202
+ DoubleArrayNodePropertyValues nodeProps = mock (DoubleArrayNodePropertyValues .class );
203
203
204
- var distances =new DoubleArrayDistances (nodeProps );
204
+ var distances = new DoubleArrayDistances (nodeProps );
205
205
var kdRoot = KdNode .createLeaf (0 ,0 ,2 ,mock (AABB .class ));
206
- var kdTree =new KdTree (HugeLongArray .of (0 ,1 ,2 ),distances ,kdRoot ,1 );
206
+ var kdTree = new KdTree (HugeLongArray .of (0 ,1 ,2 ),distances ,kdRoot ,1 );
207
207
208
- var boruvkaMST = BoruvkaMST .createWithZeroCores (
208
+ var boruvkaMST = BoruvkaMST .createWithZeroCores (
209
209
distances ,
210
210
kdTree ,
211
211
3 ,
@@ -214,7 +214,7 @@ void shouldPruneProperly(){
214
214
);
215
215
216
216
//prune based on distance
217
- boruvkaMST .tryUpdate (2 ,2 , 3 ,5 );
217
+ boruvkaMST .tryUpdate (2 ,1 , 2 , 1 ,5 );
218
218
assertThat (boruvkaMST .prune (kdRoot ,2 ,100 )).isTrue ();
219
219
assertThat (boruvkaMST .prune (kdRoot ,2 ,4 )).isFalse ();
220
220
0 commit comments