Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for nextDouble (0.16 sec)

  1. guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java

        for (int i = 0; i < 0x1000; i++) {
          double setSize = rng.nextDouble();
          if (setSize < emptySetProportion) {
            sets[i] = ImmutableSet.of();
          } else if (setSize < emptySetProportion + singletonSetProportion) {
            sets[i] = ImmutableSet.of(PRESENT);
          } else {
            sets[i] = ImmutableSet.of(PRESENT, new Object());
          }
    
          if (rng.nextDouble() < hitRate) {
            queries[i] = PRESENT;
          } else {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 22 20:09:59 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/hash/Hashing.java

        int candidate = 0;
        int next;
    
        // Jump from bucket to bucket until we go out of range
        while (true) {
          next = (int) ((candidate + 1) / generator.nextDouble());
          if (next >= 0 && next < buckets) {
            candidate = next;
          } else {
            return candidate;
          }
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jul 19 16:02:36 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/hash/BloomFilterTest.java

          }
        }
    
        // some random values
        Random random = new Random(0);
        for (int repeats = 0; repeats < 10000; repeats++) {
          assertTrue(BloomFilter.optimalNumOfBits(random.nextInt(1 << 16), random.nextDouble()) >= 0);
        }
    
        // and some crazy values (this used to be capped to Integer.MAX_VALUE, now it can go bigger
        assertEquals(3327428144502L, BloomFilter.optimalNumOfBits(Integer.MAX_VALUE, Double.MIN_VALUE));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/HashTestUtils.java

              sink.putFloat(value);
            }
          }
        },
        PUT_DOUBLE() {
          @Override
          void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) {
            double value = random.nextDouble();
            for (PrimitiveSink sink : sinks) {
              sink.putDouble(value);
            }
          }
        },
        PUT_BYTES() {
          @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Streams.java

                    @Override
                    public boolean tryAdvance(Consumer<? super R> action) {
                      if (fromIterator.hasNext()) {
                        action.accept(function.apply(fromIterator.nextDouble(), index++));
                        return true;
                      }
                      return false;
                    }
                  },
                  isParallel)
              .onClose(stream::close);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 37.4K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/Streams.java

                    @Override
                    public boolean tryAdvance(Consumer<? super R> action) {
                      if (fromIterator.hasNext()) {
                        action.accept(function.apply(fromIterator.nextDouble(), index++));
                        return true;
                      }
                      return false;
                    }
                  },
                  isParallel)
              .onClose(stream::close);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 36.8K bytes
    - Viewed (0)
Back to top