Package java.util

Examples of java.util.Random.nextDouble()


                            rand = new Random();
                        }

                        try
                        {
                            Thread.sleep(500l + (long)(500l * rand.nextDouble()));
                        }
                        catch (InterruptedException e1)
                        {

                        }
View Full Code Here


    rnm2 = svd_ddot(n, wptr[0], 1, wptr[0], 1);
    Random random = new Random(918273L + step); // irand = 918273 + step;
    r = wptr[0];
    for (id = 0; id < 3; id++) {
      if (id > 0 || step > 0 || rnm2 == 0)
        for (i = 0; i < n; i++) r[i] = random.nextDouble(); // svd_random2(&irand);
      svd_dcopy(n, wptr[0], 1, wptr[3], 1);

      /* apply operator to put r in range (essential if m singular) */
      svd_opb(A, wptr[3], wptr[0], OPBTemp);
      svd_dcopy(n, wptr[0], 1, wptr[3], 1);
View Full Code Here

      while (idx < orig.length) {
        float val = rand.nextFloat();
        orig[idx] = val;
        fromEmpty.set(idx, val);
        idx += 1;
        while (rand.nextDouble() > density) {
          idx++;
        }
      }
      float[] copy = new float[orig.length];
      System.arraycopy(orig, 0, copy, 0, orig.length);
View Full Code Here

      AffineTransform currentAf = properties.getAffineTransform();
      AffineTransform af = new AffineTransform();
      af.scale(properties.getAffineTransform().getScaleX(), currentAf.getScaleY());

      if (currentAf.getTranslateX() != 0 || currentAf.getTranslateY() != 0) {
          af.translate(r.nextDouble() * currentAf.getTranslateX(), r.nextDouble() * currentAf.getTranslateY());
      }

      if (currentAf.getShearX() != 0 || currentAf.getShearY() != 0) {
          af.shear(r.nextDouble() * currentAf.getShearX(), r.nextDouble() * currentAf.getShearY());
      }
 
View Full Code Here

      AffineTransform currentAf = properties.getAffineTransform();
      AffineTransform af = new AffineTransform();
      af.scale(properties.getAffineTransform().getScaleX(), currentAf.getScaleY());

      if (currentAf.getTranslateX() != 0 || currentAf.getTranslateY() != 0) {
          af.translate(r.nextDouble() * currentAf.getTranslateX(), r.nextDouble() * currentAf.getTranslateY());
      }

      if (currentAf.getShearX() != 0 || currentAf.getShearY() != 0) {
          af.shear(r.nextDouble() * currentAf.getShearX(), r.nextDouble() * currentAf.getShearY());
      }
 
View Full Code Here

      if (currentAf.getTranslateX() != 0 || currentAf.getTranslateY() != 0) {
          af.translate(r.nextDouble() * currentAf.getTranslateX(), r.nextDouble() * currentAf.getTranslateY());
      }

      if (currentAf.getShearX() != 0 || currentAf.getShearY() != 0) {
          af.shear(r.nextDouble() * currentAf.getShearX(), r.nextDouble() * currentAf.getShearY());
      }

      if (properties.getMaxRotationAngle() != 0) {
          af.rotate(r.nextDouble() / 360);
      }
View Full Code Here

      if (currentAf.getTranslateX() != 0 || currentAf.getTranslateY() != 0) {
          af.translate(r.nextDouble() * currentAf.getTranslateX(), r.nextDouble() * currentAf.getTranslateY());
      }

      if (currentAf.getShearX() != 0 || currentAf.getShearY() != 0) {
          af.shear(r.nextDouble() * currentAf.getShearX(), r.nextDouble() * currentAf.getShearY());
      }

      if (properties.getMaxRotationAngle() != 0) {
          af.rotate(r.nextDouble() / 360);
      }
View Full Code Here

      if (currentAf.getShearX() != 0 || currentAf.getShearY() != 0) {
          af.shear(r.nextDouble() * currentAf.getShearX(), r.nextDouble() * currentAf.getShearY());
      }

      if (properties.getMaxRotationAngle() != 0) {
          af.rotate(r.nextDouble() / 360);
      }

      AffineTransformOp op = new AffineTransformOp(af, AffineTransformOp.TYPE_BILINEAR);
      BufferedImage dest = new BufferedImage((int) (i.getWidth() / af.getScaleX()), (int) (i.getHeight() / af.getScaleY()), BufferedImage.TYPE_3BYTE_BGR);
      op.filter(i, dest);
View Full Code Here

      int count = 0;
      while (idx < orig.length) {
        orig[idx] = rand.nextFloat();
        count++;
        idx += 1;
        while (rand.nextDouble() > density) {
          idx++;
        }
      }
      assertTrue("count was bad: " + count, count > 100 && count < orig.length / 2);
      System.out.println("float array with " + count + " out of " + orig.length
View Full Code Here

        rnm2 = svd_ddot(n, wptr[0], 1, wptr[0], 1);
        Random random = new Random(918273L + step); // irand = 918273 + step;
        r = wptr[0];
        for (id = 0; id < 3; id++) {
            if (id > 0 || step > 0 || rnm2 == 0)
                for (i = 0; i < n; i++) r[i] = random.nextDouble(); // svd_random2(&irand);
            svd_dcopy(n, wptr[0], 1, wptr[3], 1);

            /* apply operator to put r in range (essential if m singular) */
            svd_opb(A, wptr[3], wptr[0], OPBTemp);
            svd_dcopy(n, wptr[0], 1, wptr[3], 1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.