Range { public double[][] getSamples() { double[][] samples = new double[totalSamples][this.getDimensions()]; for (int i = 0; i < samples[0].length; i++) { final double interval = this.stop[i] - this.start[i]; for (int j = 0; j < samples.length; j++) { final double value; if (this.random[i]) { value = this.rng.nextDouble() * interval; } else { value = this.step[i] * j; } samples[j][i] = this.start[i] + value; } } return samples; } Range(String s);  Range(String s, RandomNumberGenerator rng); void stringToRange(String s); double[][] getSamples(); boolean isRandom(); void setRandom(boolean random); boolean isRandom(int i); void setRandom(boolean random, int i); double getStart(int dim); double getStep(int dim); double getStop(int dim); int getDimensions(); @Override String toString();  }
@Test public void testGetSamples() { System.out.println("getSamples"); String s = "x0 eq [1:2:7]; x1 eq [2:1:5]"; Range r = new Range(s); double[][] res = r.getSamples(); double[][] exp = {{1,2},{3,3},{5,4}}; JUnitHelper.checkMatrix(exp, res); s = "x0 eq rnd(0,2,1); x1 eq rnd(1,2,2)"; r = new Range(s, new MersenneTwisterFast(0)); MersenneTwisterFast rng2 = new MersenneTwisterFast(0); res = r.getSamples(); double d1 = rng2.nextDouble(); double d2 = rng2.nextDouble(); double d3 = rng2.nextDouble()+1; double d4 = rng2.nextDouble()+1; double[][] exp2 = {{d1,d3},{d2,d4}}; JUnitHelper.checkMatrix(exp2, res); }