MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testMedian

Method testMedian

JSAT/test/jsat/linear/SparseVectorTest.java:287–297  ·  view source on GitHub ↗

Test of median method, of class SparseVector.

()

Source from the content-addressed store, hash-verified

285 * Test of median method, of class SparseVector.
286 */
287 @Test
288 public void testMedian()
289 {
290 System.out.println("median");
291
292 assertEquals(0.0, x.median(), 1e-15);
293 assertEquals(0.0, y.median(), 1e-15);
294
295 x.mutableAdd(y);
296 assertEquals(1.0, x.median(), 1e-15);
297 }
298
299 /**
300 * Test of skewness method, of class SparseVector.

Callers

nothing calls this directly

Calls 2

medianMethod · 0.45
mutableAddMethod · 0.45

Tested by

no test coverage detected