Kernel implements Serializable { public double get(int i) { if (i < getMinIndex() || i > getMaxIndex()) { return 0.0; } return values[i - getMinIndex()]; } 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 testSimpleKernel() { Kernel k = new Kernel(1.0); assertEquals(0.0, k.get(-1), DELTA); assertEquals(1.0, k.get( 0), DELTA); assertEquals(0.0, k.get( 1), DELTA); }