FRAMES NO FRAMES

Class IlcRandom

Definition file: ilsolver/random.h
Include file: ilsolver/random.h

Objects of this class produce streams of pseudo-random numbers. You can use objects of this class to create a search with a random element. This class will produce the same stream of random numbers in recompute mode as when it was in compute mode.

For more information, see the member function IloSolver::isInRecomputeMode.

For more information, see IloRandom.

See Also:

Constructor Summary
public IlcRandom()
public IlcRandom(IlcRandomI * impl)
public IlcRandom(IloSolver m, IlcInt seed=0)
Method Summary
public voidcopy(IloRandom rnd)
public voidcopy(IlcRandom rnd)
public voidcopyTo(IloRandom rnd)
public IlcFloatgetFloat() const
public IlcRandomI *getImpl() const
public IlcIntgetInt(IlcInt n) const
public const char *getName() const
public IlcAnygetObject() const
public IloSolvergetSolver() const
public IloSolverI *getSolverI() const
public voidoperator=(const IlcRandom & h)
public voidreSeed(IlcInt seed)
public voidsetName(const char * name) const
public voidsetObject(IlcAny object) const
Constructor Detail

IlcRandom

public IlcRandom()
This constructor creates an empty handle. You must initialize it before you use it.

IlcRandom

public IlcRandom(IlcRandomI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IlcRandom

public IlcRandom(IloSolver m, IlcInt seed=0)

This constructor creates a random number generator, initially seeded with the seed seed.


Method Detail

copy

public void copy(IloRandom rnd)

This member function copies the state of a Concert Technology random number generator to the invoking one. After the copy, both generators will produce the same stream of pseudo-random numbers.


copy

public void copy(IlcRandom rnd)

This member function copies the state of another random number generator to the invoking one. After the copy, both generators will produce the same stream of pseudo-random numbers.


copyTo

public void copyTo(IloRandom rnd)

This member function copies the state of the invoking generator to a Concert Technology random number generator. After the copy, both generators will produce the same stream of pseudo-random numbers.


getFloat

public IlcFloat getFloat() const

This member function returns a floating point number drawn uniformly from the range [0..1).


getImpl

public IlcRandomI * getImpl() const
This constructor creates an object by copying another one. This constructor creates an object by copying another one. This member function returns a pointer to the implementation object of the invoking handle.

getInt

public IlcInt getInt(IlcInt n) const

This member function returns a integer number drawn uniformly from the range [0..n).


getName

public const char * getName() const
This member function returns the name of the invoking object.

getObject

public IlcAny getObject() const
This member function returns a pointer to the external object associated with the invoking object, if there is such an association. It returns 0 (zero) otherwise.

getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


getSolverI

public IloSolverI * getSolverI() const

This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.


operator=

public void operator=(const IlcRandom & h)
This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.

reSeed

public void reSeed(IlcInt seed)

This member function reseeds the generator with seed seed.


setName

public void setName(const char * name) const
This member function sets the name of the invoking object to a copy of name. This assignment is a reversible action.

setObject

public void setObject(IlcAny object) const
This member function establishes a link between the invoking object and an external object of which the invoking object might be a data member.