Package ar.edu.unlp.yaqc4j.generators

Examples of ar.edu.unlp.yaqc4j.generators.PositiveIntegerGen


   * @{inheritDoc
   */
  public BigInteger arbitrary(final Distribution random, final long minsize,
      final long maxsize) {
    ByteGen gen = new ByteGen();
    byte[] bytes = new byte[new PositiveIntegerGen().arbitrary(random,
        minsize, Math.min(maxsize, 2000))]; // FIXME: arbitrary length of this array to avoid OutOfMemoryError
    for (int i = 0; i < bytes.length; i++) {
      bytes[i] = gen.arbitrary(random, minsize, maxsize);
    }
    return new BigInteger(new PositiveIntegerGen().arbitrary(random,
        minsize, maxsize) > 0 ? 1 : -1, bytes);
  }
View Full Code Here

TOP

Related Classes of ar.edu.unlp.yaqc4j.generators.PositiveIntegerGen

Copyright © 2018 www.massapicom. 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.