Tabnine Logo
MersenneTwister.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
smile.math.random.MersenneTwister
constructor

Best Java code snippets using smile.math.random.MersenneTwister.<init> (Showing top 4 results out of 315)

origin: com.github.haifengl/smile-math

/**
 * Initialize with default random number generator engine.
 */
public Random() {
  real = new UniversalGenerator();
  twister = new MersenneTwister();
}
origin: com.github.haifengl/smile-math

/**
 * Initialize with given seed for default random number generator engine.
 */
public Random(long seed) {
  real = new UniversalGenerator(seed);
  twister = new MersenneTwister(seed);
}
origin: org.apache.hivemall/hivemall-core

@Nonnull
public static PRNG createPRNG(@Nonnull PRNGType type) {
  final PRNG rng;
  switch (type) {
    case java:
      rng = new JavaRandom();
      break;
    case secure:
      rng = new JavaRandom(new SecureRandom());
      break;
    case smile:
      rng = new SmileRandom();
      break;
    case smileMT:
      rng = new SmileRandom(new smile.math.random.MersenneTwister());
      break;
    case smileMT64:
      rng = new SmileRandom(new smile.math.random.MersenneTwister64());
      break;
    case commonsMath3MT:
      rng = new CommonsMathRandom(new org.apache.commons.math3.random.MersenneTwister());
      break;
    default:
      throw new IllegalStateException("Unexpected type: " + type);
  }
  return rng;
}
origin: org.apache.hivemall/hivemall-core

@Nonnull
public static PRNG createPRNG(@Nonnull PRNGType type, long seed) {
  final PRNG rng;
  switch (type) {
    case java:
      rng = new JavaRandom(seed);
      break;
    case secure:
      rng = new JavaRandom(new SecureRandom(Primitives.toBytes(seed)));
      break;
    case smile:
      rng = new SmileRandom(seed);
      break;
    case smileMT:
      rng = new SmileRandom(
        new smile.math.random.MersenneTwister(Primitives.hashCode(seed)));
      break;
    case smileMT64:
      rng = new SmileRandom(new smile.math.random.MersenneTwister64(seed));
      break;
    case commonsMath3MT:
      rng = new CommonsMathRandom(
        new org.apache.commons.math3.random.MersenneTwister(seed));
      break;
    default:
      throw new IllegalStateException("Unexpected type: " + type);
  }
  return rng;
}
smile.math.randomMersenneTwister<init>

Javadoc

Constructor.

Popular methods of MersenneTwister

  • next
  • nextDouble
  • nextInt
  • nextLong
  • setSeed

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now