Package jsl.utilities.random.rng
Class RNStreamFactoryDepracated
- java.lang.Object
-
- jsl.utilities.Identity
-
- jsl.utilities.random.rng.RNStreamFactoryDepracated
-
- All Implemented Interfaces:
GetNameIfc
,IdentityIfc
@Deprecated public class RNStreamFactoryDepracated extends Identity
Deprecated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RNStreamFactoryDepracated.RNStream
Deprecated.A concrete implementation of a random number stream (RngIfc)
-
Constructor Summary
Constructors Constructor Description RNStreamFactoryDepracated()
Deprecated.Creates a factory with no nameRNStreamFactoryDepracated(java.lang.String name)
Deprecated.Creates a factory with the provided name
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
advanceSeeds(int n)
Deprecated.Advances the seeds n times.static RNStreamFactoryDepracated
getDefaultFactory()
Deprecated.Returns a reference to a "global" stream factorylong[]
getDefaultInitialFactorySeed()
Deprecated.Gets the default initial package seed: seed = {12345, 12345, 12345, 12345, 12345, 12345};static RNStreamIfc
getDefaultStream()
Deprecated.Returns a global default stream from the default factorylong[]
getFactorySeed()
Deprecated.Returns the current package seedRNStreamIfc
getStream()
Deprecated.Tells the factory to make and return a RNStreamRNStreamIfc
getStream(java.lang.String name)
Deprecated.Tells the provider to make and return a RNStream with the provided nameRNStreamFactoryDepracated
newInstance()
Deprecated.Returns a clone of the factory that will produce exactly the same streamsRNStreamFactoryDepracated
newInstance(java.lang.String name)
Deprecated.Returns a new instance of the factory that will produce exactly the same streamsvoid
resetFactorySeed()
Deprecated.Resets the package seed to the default initial package seed: seed = {12345, 12345, 12345, 12345, 12345, 12345};static void
setDefaultFactory(RNStreamFactoryDepracated f)
Deprecated.Sets the default factory to the supplied factoryboolean
setFactorySeed(long[] seed)
Deprecated.Sets the initial seed to the six integers in the vector seed[0..5].java.lang.String
toString()
Deprecated.
-
-
-
Constructor Detail
-
RNStreamFactoryDepracated
public RNStreamFactoryDepracated()
Deprecated.Creates a factory with no name
-
RNStreamFactoryDepracated
public RNStreamFactoryDepracated(java.lang.String name)
Deprecated.Creates a factory with the provided name- Parameters:
name
- a name for the factory, may be null
-
-
Method Detail
-
newInstance
public RNStreamFactoryDepracated newInstance()
Deprecated.Returns a clone of the factory that will produce exactly the same streams- Returns:
- new instance of the factory
-
newInstance
public RNStreamFactoryDepracated newInstance(java.lang.String name)
Deprecated.Returns a new instance of the factory that will produce exactly the same streams- Parameters:
name
- the name for the factory, may be null- Returns:
- the new instance of the factory
-
getDefaultFactory
public static RNStreamFactoryDepracated getDefaultFactory()
Deprecated.Returns a reference to a "global" stream factory- Returns:
- a reference to a "global" stream factory
-
setDefaultFactory
public static void setDefaultFactory(RNStreamFactoryDepracated f)
Deprecated.Sets the default factory to the supplied factory- Parameters:
f
- must not be null
-
getDefaultStream
public static RNStreamIfc getDefaultStream()
Deprecated.Returns a global default stream from the default factory- Returns:
- the default stream
-
getStream
public final RNStreamIfc getStream(java.lang.String name)
Deprecated.Tells the provider to make and return a RNStream with the provided name- Parameters:
name
- can be null- Returns:
- the made stream
-
getStream
public final RNStreamIfc getStream()
Deprecated.Tells the factory to make and return a RNStream- Returns:
- the made stream
-
advanceSeeds
public final void advanceSeeds(int n)
Deprecated.Advances the seeds n times. Acts as if n streams were created, without actually creating the streams- Parameters:
n
- the number of times to advance
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
getDefaultInitialFactorySeed
public final long[] getDefaultInitialFactorySeed()
Deprecated.Gets the default initial package seed: seed = {12345, 12345, 12345, 12345, 12345, 12345};- Returns:
- an array holding the initial seed values
-
getFactorySeed
public final long[] getFactorySeed()
Deprecated.Returns the current package seed- Returns:
- the array of seed values for the current state
-
resetFactorySeed
public final void resetFactorySeed()
Deprecated.Resets the package seed to the default initial package seed: seed = {12345, 12345, 12345, 12345, 12345, 12345};
-
setFactorySeed
public final boolean setFactorySeed(long[] seed)
Deprecated.Sets the initial seed to the six integers in the vector seed[0..5]. This will be the seed (initial state) of the first stream. By default, this seed is (12345, 12345, 12345, 12345, 12345, 12345).If it is called, the first 3 values of the seed must all be less than m1 = 4294967087, and not all 0; and the last 3 values must all be less than m2 = 4294944443, and not all 0. Returns false for invalid seeds, and true otherwise.
- Parameters:
seed
- the seeds- Returns:
- true if the seeds are set after validation
-
-