Tabnine Logo
DoubleUniform
Code IndexAdd Tabnine to your IDE (free)

How to use
DoubleUniform
in
cern.jet.random.tdouble

Best Java code snippets using cern.jet.random.tdouble.DoubleUniform (Showing top 20 results out of 315)

origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Constructs a mean-squared BreitWigner distribution.
 * 
 * @param cut
 *            </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
 */
public BreitWignerMeanSquare(double mean, double gamma, double cut, DoubleRandomEngine randomGenerator) {
  super(mean, gamma, cut, randomGenerator);
  this.uniform = new DoubleUniform(randomGenerator);
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random <tt>boolean</tt>.
 */
public static boolean staticNextBoolean() {
  synchronized (shared) {
    return shared.nextBoolean();
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random number in the open interval
 * <tt>(0,1)</tt> (excluding <tt>0</tt> and <tt>1</tt>).
 */
public static double staticNextDouble() {
  synchronized (shared) {
    return shared.nextDouble();
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Constructs a uniform distribution with the given minimum and maximum.
 */
public DoubleUniform(double min, double max, DoubleRandomEngine randomGenerator) {
  setRandomGenerator(randomGenerator);
  setState(min, max);
}
origin: net.sourceforge.parallelcolt/parallelcolt

  return from + (long) (nextDoubleFromTo(0.0, to - from + 1));
  return from + (long) (nextDoubleFromTo(0.0, diff));
  if (to == Long.MAX_VALUE) {
    int i1 = nextIntFromTo(Integer.MIN_VALUE, Integer.MAX_VALUE);
    int i2 = nextIntFromTo(Integer.MIN_VALUE, Integer.MAX_VALUE);
    return ((i1 & 0xFFFFFFFFL) << 32) | (i2 & 0xFFFFFFFFL);
  random = Math.round(nextDoubleFromTo(from, to + 1));
  if (random > to)
    random = from;
} else {
  random = Math.round(nextDoubleFromTo(from - 1, to));
  if (random < from)
    random = to;
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Randomly permutes the part of the receiver between <code>from</code>
 * (inclusive) and <code>to</code> (inclusive).
 * 
 * @param from
 *            the index of the first element (inclusive) to be permuted.
 * @param to
 *            the index of the last element (inclusive) to be permuted.
 * @exception IndexOutOfBoundsException
 *                index is out of range (
 *                <tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>
 *                ).
 */
public void shuffleFromTo(int from, int to) {
  if (size == 0)
    return;
  checkRangeFromTo(from, to, size);
  cern.jet.random.tdouble.DoubleUniform gen = new cern.jet.random.tdouble.DoubleUniform(
      new cern.jet.random.tdouble.engine.DRand(new java.util.Date()));
  Object tmpElement;
  Object[] theElements = elements;
  int random;
  for (int i = from; i < to; i++) {
    random = gen.nextIntFromTo(i, to);
    // swap(i, random)
    tmpElement = theElements[random];
    theElements[random] = theElements[i];
    theElements[i] = tmpElement;
  }
}
origin: rwl/ParallelColt

/**
 * Returns a uniformly distributed random number in the closed interval
 * <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public static int staticNextIntFromTo(int from, int to) {
  synchronized (shared) {
    return shared.nextIntFromTo(from, to);
  }
}
origin: rwl/ParallelColt

/**
 * Returns a uniformly distributed random number in the open interval
 * <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public static double staticNextDoubleFromTo(double from, double to) {
  synchronized (shared) {
    return shared.nextDoubleFromTo(from, to);
  }
}
origin: rwl/ParallelColt

/**
 * Sets the internal state.
 */
public void setState(double min, double max) {
  if (max < min) {
    setState(max, min);
    return;
  }
  this.min = min;
  this.max = max;
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a deep copy of the receiver.
 */
public Object clone() {
  WeightedDoubleRandomSampler copy = (WeightedDoubleRandomSampler) super.clone();
  copy.generator = (DoubleUniform) this.generator.clone();
  return copy;
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random number in the open interval
 * <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public static float staticNextFloatFromTo(float from, float to) {
  synchronized (shared) {
    return shared.nextFloatFromTo(from, to);
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random number in the closed interval
 * <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public static long staticNextLongFromTo(long from, long to) {
  synchronized (shared) {
    return shared.nextLongFromTo(from, to);
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Sets the uniform random number generation engine shared by all
 * <b>static</b> methods.
 * 
 * @param randomGenerator
 *            the new uniform random number generation engine to be shared.
 */
public static void staticSetRandomEngine(DoubleRandomEngine randomGenerator) {
  synchronized (shared) {
    shared.setRandomGenerator(randomGenerator);
  }
}
origin: rwl/ParallelColt

cern.jet.random.tdouble.DoubleUniform gen = new cern.jet.random.tdouble.DoubleUniform(
    new cern.jet.random.tdouble.engine.DRand(new java.util.Date()));
char tmpElement;
int random;
for (int i = from; i < to; i++) {
  random = gen.nextIntFromTo(i, to);
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random number in the closed interval
 * <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public static int staticNextIntFromTo(int from, int to) {
  synchronized (shared) {
    return shared.nextIntFromTo(from, to);
  }
}
origin: rwl/ParallelColt

/**
 * Constructs a uniform distribution with the given minimum and maximum.
 */
public DoubleUniform(double min, double max, DoubleRandomEngine randomGenerator) {
  setRandomGenerator(randomGenerator);
  setState(min, max);
}
origin: rwl/ParallelColt

  return from + (long) (nextDoubleFromTo(0.0, to - from + 1));
  return from + (long) (nextDoubleFromTo(0.0, diff));
  if (to == Long.MAX_VALUE) {
    int i1 = nextIntFromTo(Integer.MIN_VALUE, Integer.MAX_VALUE);
    int i2 = nextIntFromTo(Integer.MIN_VALUE, Integer.MAX_VALUE);
    return ((i1 & 0xFFFFFFFFL) << 32) | (i2 & 0xFFFFFFFFL);
  random = Math.round(nextDoubleFromTo(from, to + 1));
  if (random > to)
    random = from;
} else {
  random = Math.round(nextDoubleFromTo(from - 1, to));
  if (random < from)
    random = to;
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a uniformly distributed random number in the open interval
 * <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>). Pre
 * conditions: <tt>from &lt;= to</tt>.
 */
public float nextFloatFromTo(float from, float to) {
  return (float) nextDoubleFromTo(from, to);
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Sets the internal state.
 */
public void setState(double min, double max) {
  if (max < min) {
    setState(max, min);
    return;
  }
  this.min = min;
  this.max = max;
}
origin: rwl/ParallelColt

/**
 * Returns a deep copy of the receiver.
 */
public Object clone() {
  WeightedDoubleRandomSampler copy = (WeightedDoubleRandomSampler) super.clone();
  copy.generator = (DoubleUniform) this.generator.clone();
  return copy;
}
cern.jet.random.tdoubleDoubleUniform

Javadoc

Uniform distribution; Math definition and animated definition.

Instance methods operate on a user supplied uniform random number generator; they are unsynchronized. Static methods operate on a default uniform random number generator; they are synchronized.

Most used methods

  • <init>
    Constructs a uniform distribution with min=0.0 andmax=1.0.
  • clone
  • nextBoolean
    Returns a uniformly distributed random boolean.
  • nextDouble
    Returns a uniformly distributed random number in the open interval(min,max) (excluding min and max)
  • nextDoubleFromTo
    Returns a uniformly distributed random number in the open interval(from,to) (excluding from and to)
  • nextFloatFromTo
    Returns a uniformly distributed random number in the open interval(from,to) (excluding from and to)
  • nextIntFromTo
    Returns a uniformly distributed random number in the closed interval[from,to] (including from and t
  • nextLongFromTo
    Returns a uniformly distributed random number in the closed interval[from,to] (including from and t
  • setRandomGenerator
  • setState
    Sets the internal state.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • getSystemService (Context)
  • setContentView (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JButton (javax.swing)
  • Top 12 Jupyter Notebook extensions
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