ValueServer { public void fill(double[] values) throws IOException, MathIllegalStateException, MathIllegalArgumentException { for (int i = 0; i < values.length; i++) { values[i] = getNext(); } } ValueServer(); @Deprecated  ValueServer(RandomDataImpl randomData);  ValueServer(RandomGenerator generator); double getNext(); void fill(double[] values); double[] fill(int length); void computeDistribution(); void computeDistribution(int binCount); int getMode(); void setMode(int mode); URL getValuesFileURL(); void setValuesFileURL(String url); void setValuesFileURL(URL url); EmpiricalDistribution getEmpiricalDistribution(); void resetReplayFile(); void closeReplayFile(); double getMu(); void setMu(double mu); double getSigma(); void setSigma(double sigma); void reSeed(long seed); static final int DIGEST_MODE; static final int REPLAY_MODE; static final int UNIFORM_MODE; static final int EXPONENTIAL_MODE; static final int GAUSSIAN_MODE; static final int CONSTANT_MODE; }
@Test public void testFill() throws Exception { vs.setMode(ValueServer.CONSTANT_MODE); vs.setMu(2); double[] val = new double[5]; vs.fill(val); for (int i = 0; i < 5; i++) { Assert.assertEquals("fill test in place",2,val[i],Double.MIN_VALUE); } double v2[] = vs.fill(3); for (int i = 0; i < 3; i++) { Assert.assertEquals("fill test in place",2,v2[i],Double.MIN_VALUE); } }