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: /* Similar to binary, but has different bit probabilities samer@0: for elements of vector samer@0: */ samer@0: samer@0: package samer.maths.random; samer@0: import samer.maths.*; samer@0: import samer.core.types.*; samer@0: samer@0: public class BinaryVec extends BaseRandom samer@0: { samer@0: int n; samer@0: VVector probs; samer@0: double [] p; samer@0: boolean ownp; samer@0: samer@0: public BinaryVec(int n, double pp) { samer@0: this(new VVector("probs",n)); samer@0: ownp=true; samer@0: for (int i=0; i=n) j=0; samer@0: x[i]=(rnd.nextDouble()