SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches

Detailed Description

structures and methods for pseudo random number generation

Functions

int SCIPgetRandomInt (int minrandval, int maxrandval, unsigned int *seedp)
 
int SCIPrandomGetInt (SCIP_RANDNUMGEN *randgen, int minrandval, int maxrandval)
 
SCIP_RETCODE SCIPrandomGetSubset (SCIP_RANDNUMGEN *randgen, void **set, int nelems, void **subset, int nsubelems)
 
SCIP_Real SCIPrandomGetReal (SCIP_RANDNUMGEN *randgen, SCIP_Real minrandval, SCIP_Real maxrandval)
 
SCIP_Real SCIPgetRandomReal (SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
 
SCIP_RETCODE SCIPgetRandomSubset (void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
 
SCIP_RETCODE SCIPcreateRandom (SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
 
void SCIPfreeRandom (SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
 
void SCIPsetRandomSeed (SCIP *scip, SCIP_RANDNUMGEN *randnumgen, unsigned int seed)
 
unsigned int SCIPinitializeRandomSeed (SCIP *scip, unsigned int initialseedvalue)
 

Function Documentation

◆ SCIPgetRandomInt()

int SCIPgetRandomInt ( int minrandval,
int maxrandval,
unsigned int * seedp )

returns a random integer between minrandval and maxrandval

Deprecated
Please use SCIPrandomGetInt() to request a random integer.

returns a random integer between minrandval and maxrandval

Deprecated
Please use SCIPrandomGetInt() to request a random integer.
Parameters
minrandvalminimal value to return
maxrandvalmaximal value to return
seedppointer to seed value

Definition at line 9902 of file misc.c.

References getRandomInt(), and i.

◆ SCIPrandomGetInt()

◆ SCIPrandomGetSubset()

SCIP_RETCODE SCIPrandomGetSubset ( SCIP_RANDNUMGEN * randnumgen,
void ** set,
int nelems,
void ** subset,
int nsubelems )

draws a random subset of disjoint elements from a given set of disjoint elements; this implementation is suited for the case that nsubelems is considerably smaller then nelems

Parameters
randnumgenrandom number generator
setoriginal set, from which elements should be drawn
nelemsnumber of elements in original set
subsetsubset in which drawn elements should be stored
nsubelemsnumber of elements that should be drawn and stored

Definition at line 10122 of file misc.c.

References assert(), BMScopyMemoryArray, i, r, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, and SCIPrandomGetInt().

◆ SCIPrandomGetReal()

◆ SCIPgetRandomReal()

SCIP_Real SCIPgetRandomReal ( SCIP_Real minrandval,
SCIP_Real maxrandval,
unsigned int * seedp )

returns a random real between minrandval and maxrandval

Deprecated
Please use SCIPrandomGetReal() to request a random real.

returns a random real between minrandval and maxrandval

Deprecated
Please use SCIPrandomGetReal() to request a random real.
Parameters
minrandvalminimal value to return
maxrandvalmaximal value to return
seedppointer to seed value

Definition at line 9915 of file misc.c.

References getRandomReal(), and i.

◆ SCIPgetRandomSubset()

SCIP_RETCODE SCIPgetRandomSubset ( void ** set,
int nelems,
void ** subset,
int nsubelems,
unsigned int randseed )

draws a random subset of disjoint elements from a given set of disjoint elements; this implementation is suited for the case that nsubelems is considerably smaller then nelems

Deprecated
Please use SCIPrandomGetSubset()

draws a random subset of disjoint elements from a given set of disjoint elements; this implementation is suited for the case that nsubelems is considerably smaller then nelems

Deprecated
Please use SCIPrandomGetSubset()
Parameters
setoriginal set, from which elements should be drawn
nelemsnumber of elements in original set
subsetsubset in which drawn elements should be stored
nsubelemsnumber of elements that should be drawn and stored
randseedseed value for random generator

Definition at line 10391 of file misc.c.

References assert(), BMScopyMemoryArray, getRandomInt(), i, r, SCIP_INVALIDDATA, SCIP_OKAY, and SCIPerrorMessage.

◆ SCIPcreateRandom()

SCIP_RETCODE SCIPcreateRandom ( SCIP * scip,
SCIP_RANDNUMGEN ** randnumgen,
unsigned int initialseed,
SCIP_Bool useglobalseed )

creates and initializes a random number generator

Note
The initial seed is changed using SCIPinitializeRandomSeed()
Parameters
scipSCIP data structure
randnumgenrandom number generator
initialseedinitial random seed
useglobalseedshould the supplied seed be initialized by SCIP's global seed shift?

Definition at line 56 of file scip_randnumgen.c.

References assert(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPinitializeRandomSeed(), and SCIPrandomCreate().

◆ SCIPfreeRandom()

void SCIPfreeRandom ( SCIP * scip,
SCIP_RANDNUMGEN ** randnumgen )

frees a random number generator

Parameters
scipSCIP data structure
randnumgenrandom number generator

Definition at line 79 of file scip_randnumgen.c.

References assert(), NULL, SCIPblkmem(), and SCIPrandomFree().

◆ SCIPsetRandomSeed()

void SCIPsetRandomSeed ( SCIP * scip,
SCIP_RANDNUMGEN * randnumgen,
unsigned int seed )

initializes a random number generator with a given seed

Note
The seed is changed using SCIPinitializeRandomSeed()

initializes a random number generator with a given start seed

Note
The seed is changed using SCIPinitializeRandomSeed()
Parameters
scipSCIP data structure
randnumgenrandom number generator
seednew random seed

Definition at line 94 of file scip_randnumgen.c.

References assert(), i, NULL, SCIPinitializeRandomSeed(), and SCIPrandomSetSeed().

◆ SCIPinitializeRandomSeed()

unsigned int SCIPinitializeRandomSeed ( SCIP * scip,
unsigned int initialseedvalue )

modifies an initial seed value with the global shift of random seeds

Parameters
scipSCIP data structure
initialseedvalueinitial seed value to be modified

Definition at line 111 of file scip_randnumgen.c.

References assert(), i, NULL, and SCIPsetInitializeRandomSeed().

Referenced by SCIPcreateBanditEpsgreedy(), SCIPcreateBanditExp3(), SCIPcreateBanditUcb(), SCIPcreateRandom(), SCIPresetBandit(), SCIPsetRandomSeed(), and setupAndSolveSubscipCrossover().