5152535455565758596061
public void testNorm() { Vector vector = new SparseVector(); vector.add(10, 3); vector.add(20, 4); System.out.println(vector); assertTrue(vector.norm() == 5); vector.add(10, 3); vector.add(20, 4); System.out.println(vector); assertTrue(vector.norm() == 10); }
5556575859606162636465
System.out.println(vector); assertTrue(vector.norm() == 5); vector.add(10, 3); vector.add(20, 4); System.out.println(vector); assertTrue(vector.norm() == 10); } @Test public void testSimilarity() { Vector vector1 = new SparseVector();