Examples of nextFloat()


Examples of it.unimi.dsi.fastutil.floats.FloatIterator.nextFloat()

        // return a dictionary only if we actually used it
        PlainValuesWriter dictionaryEncoder = new PlainValuesWriter(lastUsedDictionaryByteSize);
        FloatIterator floatIterator = floatDictionaryContent.keySet().iterator();
        // write only the part of the dict that we used
        for (int i = 0; i < lastUsedDictionarySize; i++) {
          dictionaryEncoder.writeFloat(floatIterator.nextFloat());
        }
        return new DictionaryPage(dictionaryEncoder.getBytes(), lastUsedDictionarySize, PLAIN_DICTIONARY);
      }
      return plainValuesWriter.createDictionaryPage();
    }
View Full Code Here

Examples of java.security.SecureRandom.nextFloat()

  */
  private static String generateRandomString() {
    final StringBuffer res = new StringBuffer();
    final Random rnd = new SecureRandom();
    for (int i = 0; i < 32; i++) {
      int pos = (int) (rnd.nextFloat() * CHARS.length());
      res.append(CHARS.charAt(pos));
    }
 
    return res.toString();
  }
View Full Code Here

Examples of java.util.Random.nextFloat()

        s.myBool = new Boolean(rand.nextBoolean());
        s.myByte = new Byte((byte) rand.nextInt(Byte.MAX_VALUE));
        s.myShort = new Short((short) rand.nextInt(Short.MAX_VALUE));
        s.myInteger = new Integer(rand.nextInt());
        s.myLong = new Long(rand.nextLong());
        s.myFloat = new Float(rand.nextFloat());
        s.myDouble = new Double(rand.nextDouble());
        s.myBigDecimal = new BigDecimal(rand.nextDouble());
        s.myString = Long.toHexString(rand.nextLong());
        s.myUtilDate = new java.util.Date(rand.nextLong());
        s.mySqlDate = new java.sql.Date(rand.nextLong());
View Full Code Here

Examples of java.util.Random.nextFloat()

    System.out.println("Clearing the framebuffer a gazillion times...");

    Random rand = new Random(System.currentTimeMillis());
    for ( int i = 0; i < clears; i++ ) {
      glClearColor(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0f);
      glClear(GL_COLOR_BUFFER_BIT);
    }

    GLSync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
View Full Code Here

Examples of java.util.Random.nextFloat()

    System.out.println("Clearing the framebuffer a gazillion times...");

    Random rand = new Random(System.currentTimeMillis());
    for ( int i = 0; i < clears; i++ ) {
      glClearColor(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0f);
      glClear(GL_COLOR_BUFFER_BIT);
    }

    GLSync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
View Full Code Here

Examples of java.util.Random.nextFloat()

    System.out.println("Clearing the framebuffer a gazillion times...");

    Random rand = new Random(System.currentTimeMillis());
    for ( int i = 0; i < clears; i++ ) {
      glClearColor(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0f);
      glClear(GL_COLOR_BUFFER_BIT);
    }

    GLSync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
View Full Code Here

Examples of java.util.Random.nextFloat()

     
      float[] orig = new float[1024];
      MutableSparseFloatArray fromEmpty = new MutableSparseFloatArray(new float[1024]);
      float density = 0.2f;
      int idx = 0;
      while (rand.nextFloat() > density) {
        idx++;
      }
      int count = 0;
      while (idx < orig.length) {
        float val = rand.nextFloat();
View Full Code Here

Examples of java.util.Random.nextFloat()

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

Examples of java.util.Random.nextFloat()

      MutableSparseFloatArray fromPartial = new MutableSparseFloatArray(copy);
     
      // do 128 modifications
      int mods = 128;
      for (int i = 0; i < mods; i++) {
        float val = rand.nextFloat();
        idx = rand.nextInt(orig.length);
        orig[idx] = val;
        fromEmpty.set(idx, val);
        fromPartial.set(idx, val);       
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

      for (int i = 0; i < 32*1024; i++) {
        int idx = r.nextInt(orig.length);
        if (r.nextBoolean()) {
          assertTrue("orig "+orig[idx]+" not the same as arr "+arr.get(idx)+" at idx="+idx, orig[idx] == arr.get(idx));
        } else {
          float val = r.nextFloat();
          orig[idx] = val;
          arr.set(idx, val);
        }
      }
     
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.