samer@0: /* samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.maths.random; samer@0: import samer.core.types.*; samer@0: import java.util.*; samer@0: samer@0: public class BoundedUniform extends BaseRandom implements Observer samer@0: { samer@0: VDouble min = new VDouble("min",0); samer@0: VDouble max = new VDouble("max",1); samer@0: double a, b; samer@0: samer@0: public String toString() { return "Uniform["+min.value+","+max.value+")"; } samer@0: samer@0: public void dispose() { min.dispose(); max.dispose(); } samer@0: public double next() { return a + b*rnd.nextDouble(); } samer@0: public void next(double [] x) { samer@0: for (int i=0; i