Skip to content

Commit aada687

Browse files
committed
formatting
1 parent e296ad8 commit aada687

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/main/java/net/imglib2/KDTree.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public KDTreeImpl impl()
4444
*/
4545
public < L extends RealLocalizable > KDTree( final List< T > values, final List< L > positions )
4646
{
47-
this( verifySize(values, positions), values, positions );
47+
this( verifySize( values, positions ), values, positions );
4848
}
4949

5050
private static int verifySize( final List< ? > values, final List< ? > positions )
@@ -61,7 +61,7 @@ private static int verifySize( final List< ? > values, final List< ? > positions
6161
* {@link IterableRealInterval}.
6262
*
6363
* @param interval
64-
* elements in the tree are obtained by iterating this
64+
* elements in the tree are obtained by iterating this
6565
*/
6666
public KDTree( final IterableRealInterval< T > interval )
6767
{
@@ -129,16 +129,15 @@ public < L extends RealLocalizable > KDTree( final int numPoints, final Iterable
129129
public KDTree( final KDTreeData< T > data )
130130
{
131131
treeData = data;
132-
impl = new KDTreeImpl(treeData.positions);
132+
impl = new KDTreeImpl( treeData.positions() );
133133
}
134134

135135
/**
136136
* Get the root node.
137137
*
138138
* @return the root node.
139139
*
140-
* @deprecated
141-
* {@link KDTreeNode} is now a re-usable proxy (like {@code NativeType}).
140+
* @deprecated {@link KDTreeNode} is now a re-usable proxy (like {@code NativeType}).
142141
* To work with existing code, {@link KDTreeNode#left()}, {@link
143142
* KDTreeNode#right()}, {@link KDTree#getRoot()} etc create new objects in each
144143
* call, instead of re-using existing proxies.
@@ -253,7 +252,8 @@ private String toString( final int node, final String indent, final KDTreeNode<
253252
* {@link KDTreeNode#setNodeIndex(int)} can be used to point the proxy to a
254253
* particular node in the tree.
255254
*/
256-
public KDTreeNode< T > createNode() {
255+
public KDTreeNode< T > createNode()
256+
{
257257
return new KDTreeNode<>( this );
258258
}
259259

src/main/java/net/imglib2/kdtree/KDTreeImpl.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* / \ /
2525
* 7 8 9
2626
* </pre>
27-
*
27+
* <p>
2828
* never like this:
2929
* <pre>
3030
* 0
@@ -35,7 +35,7 @@
3535
* / / /
3636
* 7 8 9
3737
* </pre>
38-
*
38+
* <p>
3939
* By choosing pivots in this way, the tree structure is fully
4040
* determined. For every node index, the child indices can be calculated
4141
* without dependent reads. And iff the calculated child index is less
@@ -49,7 +49,8 @@ public class KDTreeImpl
4949

5050
protected final KDTreePositions positions;
5151

52-
public KDTreeImpl(final KDTreePositions positions) {
52+
public KDTreeImpl( final KDTreePositions positions )
53+
{
5354
this.numDimensions = positions.numDimensions;
5455
this.numPoints = positions.numPoints;
5556
this.positions = positions;
@@ -126,8 +127,9 @@ public int splitDimension( final int i )
126127
return ( 31 - Integer.numberOfLeadingZeros( i + 1 ) ) % numDimensions;
127128
}
128129

129-
public double getDoublePosition(final int i, final int d) {
130-
return positions.get(i, d);
130+
public double getDoublePosition( final int i, final int d )
131+
{
132+
return positions.get( i, d );
131133
}
132134

133135
/**
@@ -138,7 +140,7 @@ public float squDistance( final int i, final float[] pos )
138140
float sum = 0;
139141
for ( int d = 0; d < numDimensions; ++d )
140142
{
141-
final float diff = pos[ d ] - ( float ) positions.get(i, d);
143+
final float diff = pos[ d ] - ( float ) positions.get( i, d );
142144
sum += diff * diff;
143145
}
144146
return sum;
@@ -152,7 +154,7 @@ public double squDistance( final int i, final double[] pos )
152154
double sum = 0;
153155
for ( int d = 0; d < numDimensions; ++d )
154156
{
155-
final double diff = pos[ d ] - positions.get(i, d);
157+
final double diff = pos[ d ] - positions.get( i, d );
156158
sum += diff * diff;
157159
}
158160
return sum;
@@ -166,7 +168,7 @@ public double squDistance( final int i, final RealLocalizable pos )
166168
double sum = 0;
167169
for ( int d = 0; d < numDimensions; ++d )
168170
{
169-
final double diff = pos.getDoublePosition( d ) - positions.get(i, d);
171+
final double diff = pos.getDoublePosition( d ) - positions.get( i, d );
170172
sum += diff * diff;
171173
}
172174
return sum;

src/main/java/net/imglib2/kdtree/KNearestNeighborSearchImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,4 @@ public KNearestNeighborSearchImpl copy()
121121
System.arraycopy( bestSquDistance, 0, copy.bestSquDistance, 0, bestSquDistance.length );
122122
return copy;
123123
}
124-
125124
}

0 commit comments

Comments
 (0)