}
@Test
public void testMedianSparse() throws Exception {
assertEquals(1,
KDTree.median(new SparseDoubleVector(new double[] { 2, 3 }), 0));
assertEquals(0,
KDTree.median(new SparseDoubleVector(new double[] { 9, 6 }), 0));
assertEquals(2,
KDTree.median(new SparseDoubleVector(new double[] { 9, 6, 8 }), 0));
assertEquals(1,
KDTree.median(new SparseDoubleVector(new double[] { 9, 8, 7 }), 0));
assertEquals(0,
KDTree.median(new SparseDoubleVector(new double[] { 8, 9, 6 }), 0));
assertEquals(
7,
KDTree.median(new SparseDoubleVector(new double[] { 8, 9, 6, 19, 25, 2,
3, 4 }), 0));
}