view libs/commons-math-2.1/docs/apidocs/org/apache/commons/math/random/MersenneTwister.html @ 32:d7a43156a79b default tip

new tabs
author dwinter
date Mon, 10 Oct 2011 17:52:22 +0200
parents 878723cc40fb
children
line wrap: on
line source

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_17) on Sat Mar 27 22:46:15 EDT 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MersenneTwister (Commons Math 2.1 API)
</TITLE>

<META NAME="date" CONTENT="2010-03-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MersenneTwister (Commons Math 2.1 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MersenneTwister.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math/random/JDKRandomGenerator.html" title="class in org.apache.commons.math.random"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math/random/NormalizedRandomGenerator.html" title="interface in org.apache.commons.math.random"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math/random/MersenneTwister.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MersenneTwister.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math.random</FONT>
<BR>
Class MersenneTwister</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">org.apache.commons.math.random.BitsStreamGenerator</A>
      <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math.random.MersenneTwister</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.80"><B>MersenneTwister</B></A><DT>extends <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A><DT>implements <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL>
</PRE>

<P>
This class implements a powerful pseudo-random number generator
 developed by Makoto Matsumoto and Takuji Nishimura during
 1996-1997.

 <p>This generator features an extremely long period
 (2<sup>19937</sup>-1) and 623-dimensional equidistribution up to 32
 bits accuracy. The home page for this generator is located at <a
 href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html">
 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html</a>.</p>

 <p>This generator is described in a paper by Makoto Matsumoto and
 Takuji Nishimura in 1998: <a
 href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf">Mersenne
 Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random
 Number Generator</a>, ACM Transactions on Modeling and Computer
 Simulation, Vol. 8, No. 1, January 1998, pp 3--30</p>

 <p>This class is mainly a Java port of the 2002-01-26 version of
 the generator written in C by Makoto Matsumoto and Takuji
 Nishimura. Here is their original copyright:</p>

 <table border="0" width="80%" cellpadding="10" align="center" bgcolor="#E0E0E0">
 <tr><td>Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
     All rights reserved.</td></tr>

 <tr><td>Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 <ol>
   <li>Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.</li>
   <li>Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.</li>
   <li>The names of its contributors may not be used to endorse or promote
       products derived from this software without specific prior written
       permission.</li>
 </ol></td></tr>

 <tr><td><strong>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGE.</strong></td></tr>
 </table>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>2.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Revision: 902203 $ $Date: 2010-01-22 13:27:41 -0500 (Fri, 22 Jan 2010) $</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.commons.math.random.MersenneTwister">Serialized Form</A></DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#MersenneTwister()">MersenneTwister</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new random number generator.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#MersenneTwister(int)">MersenneTwister</A></B>(int&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new random number generator using a single int seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#MersenneTwister(int[])">MersenneTwister</A></B>(int[]&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new random number generator using an int array seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#MersenneTwister(long)">MersenneTwister</A></B>(long&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new random number generator using a single long seed.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#next(int)">next</A></B>(int&nbsp;bits)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generate next pseudorandom number.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#setSeed(int)">setSeed</A></B>(int&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reinitialize the generator as if just built with the given int seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#setSeed(int[])">setSeed</A></B>(int[]&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reinitialize the generator as if just built with the given int array seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#setSeed(long)">setSeed</A></B>(long&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reinitialize the generator as if just built with the given long seed.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math.random.BitsStreamGenerator"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math.random.<A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextBoolean()">nextBoolean</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextBytes(byte[])">nextBytes</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextDouble()">nextDouble</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextFloat()">nextFloat</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextGaussian()">nextGaussian</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextInt()">nextInt</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextInt(int)">nextInt</A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextLong()">nextLong</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="MersenneTwister()"><!-- --></A><H3>
MersenneTwister</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.104"><B>MersenneTwister</B></A>()</PRE>
<DL>
<DD>Creates a new random number generator.
 <p>The instance is initialized using the current time as the
 seed.</p>
<P>
</DL>
<HR>

<A NAME="MersenneTwister(int)"><!-- --></A><H3>
MersenneTwister</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.112"><B>MersenneTwister</B></A>(int&nbsp;seed)</PRE>
<DL>
<DD>Creates a new random number generator using a single int seed.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (32 bits integer)</DL>
</DL>
<HR>

<A NAME="MersenneTwister(int[])"><!-- --></A><H3>
MersenneTwister</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.121"><B>MersenneTwister</B></A>(int[]&nbsp;seed)</PRE>
<DL>
<DD>Creates a new random number generator using an int array seed.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (32 bits integers array), if null
 the seed of the generator will be related to the current time</DL>
</DL>
<HR>

<A NAME="MersenneTwister(long)"><!-- --></A><H3>
MersenneTwister</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.129"><B>MersenneTwister</B></A>(long&nbsp;seed)</PRE>
<DL>
<DD>Creates a new random number generator using a single long seed.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (64 bits integer)</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="setSeed(int)"><!-- --></A><H3>
setSeed</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.140"><B>setSeed</B></A>(int&nbsp;seed)</PRE>
<DL>
<DD>Reinitialize the generator as if just built with the given int seed.
 <p>The state of the generator is exactly the same as a new
 generator built with the same seed.</p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html#setSeed(int)">setSeed</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#setSeed(int)">setSeed</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (32 bits integer)</DL>
</DD>
</DL>
<HR>

<A NAME="setSeed(int[])"><!-- --></A><H3>
setSeed</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.159"><B>setSeed</B></A>(int[]&nbsp;seed)</PRE>
<DL>
<DD>Reinitialize the generator as if just built with the given int array seed.
 <p>The state of the generator is exactly the same as a new
 generator built with the same seed.</p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html#setSeed(int[])">setSeed</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#setSeed(int[])">setSeed</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (32 bits integers array), if null
 the seed of the generator will be related to the current time</DL>
</DD>
</DL>
<HR>

<A NAME="setSeed(long)"><!-- --></A><H3>
setSeed</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.207"><B>setSeed</B></A>(long&nbsp;seed)</PRE>
<DL>
<DD>Reinitialize the generator as if just built with the given long seed.
 <p>The state of the generator is exactly the same as a new
 generator built with the same seed.</p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html#setSeed(long)">setSeed</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#setSeed(long)">setSeed</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the initial seed (64 bits integer)</DL>
</DD>
</DL>
<HR>

<A NAME="next(int)"><!-- --></A><H3>
next</H3>
<PRE>
protected int <A HREF="../../../../../src-html/org/apache/commons/math/random/MersenneTwister.html#line.221"><B>next</B></A>(int&nbsp;bits)</PRE>
<DL>
<DD>Generate next pseudorandom number.
 <p>This method is the core generation algorithm. It is used by all the
 public generation methods for the various primitive types <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextBoolean()"><CODE>BitsStreamGenerator.nextBoolean()</CODE></A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextBytes(byte[])"><CODE>BitsStreamGenerator.nextBytes(byte[])</CODE></A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextDouble()"><CODE>BitsStreamGenerator.nextDouble()</CODE></A>,
 <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextFloat()"><CODE>BitsStreamGenerator.nextFloat()</CODE></A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextGaussian()"><CODE>BitsStreamGenerator.nextGaussian()</CODE></A>, <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextInt()"><CODE>BitsStreamGenerator.nextInt()</CODE></A>,
 <A HREF="../../../../../org/apache/commons/math/random/MersenneTwister.html#next(int)"><CODE>next(int)</CODE></A> and <A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#nextLong()"><CODE>BitsStreamGenerator.nextLong()</CODE></A>.</p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html#next(int)">next</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/random/BitsStreamGenerator.html" title="class in org.apache.commons.math.random">BitsStreamGenerator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>bits</CODE> - number of random bits to produce
<DT><B>Returns:</B><DD>random bits generated</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MersenneTwister.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math/random/JDKRandomGenerator.html" title="class in org.apache.commons.math.random"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math/random/NormalizedRandomGenerator.html" title="interface in org.apache.commons.math.random"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math/random/MersenneTwister.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MersenneTwister.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2010 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>