Kernel implements Serializable { public Kernel normalize() { double sum = 0.0; for (double value : values) { sum += value; } return mul(1.0/sum); } Kernel(int offset, double[] values);  Kernel(double... values); static Kernel getBinomial(double variance); static Kernel getBinomial(int size); static Kernel getUniform(int size, int offset, double value); double get(int i); int getOffset(); int size(); int getMinIndex(); int getMaxIndex(); Kernel add(double v); Kernel add(Kernel k); Kernel mul(double v); Kernel mul(Kernel k); Kernel normalize(); Kernel negate();  }
@Test public void testNormalize() { Kernel k = new Kernel(1.0, 1.0); k.normalize(); assertEquals(0.5, k.get(-1), DELTA); assertEquals(0.5, k.get( 0), DELTA); }