Detailed Description
structures and methods for pseudo random number generation
Functions | |
SCIP_EXPORT int | SCIPgetRandomInt (int minrandval, int maxrandval, unsigned int *seedp) |
SCIP_EXPORT int | SCIPrandomGetInt (SCIP_RANDNUMGEN *randgen, int minrandval, int maxrandval) |
SCIP_EXPORT SCIP_RETCODE | SCIPrandomGetSubset (SCIP_RANDNUMGEN *randgen, void **set, int nelems, void **subset, int nsubelems) |
SCIP_EXPORT SCIP_Real | SCIPrandomGetReal (SCIP_RANDNUMGEN *randgen, SCIP_Real minrandval, SCIP_Real maxrandval) |
SCIP_EXPORT SCIP_Real | SCIPgetRandomReal (SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp) |
SCIP_EXPORT SCIP_RETCODE | SCIPgetRandomSubset (void **set, int nelems, void **subset, int nsubelems, unsigned int randseed) |
SCIP_EXPORT SCIP_RETCODE | SCIPcreateRandom (SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed) |
SCIP_EXPORT void | SCIPfreeRandom (SCIP *scip, SCIP_RANDNUMGEN **randnumgen) |
SCIP_EXPORT void | SCIPsetRandomSeed (SCIP *scip, SCIP_RANDNUMGEN *randnumgen, unsigned int seed) |
SCIP_EXPORT unsigned int | SCIPinitializeRandomSeed (SCIP *scip, unsigned int initialseedvalue) |
Function Documentation
◆ SCIPgetRandomInt()
SCIP_EXPORT 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
-
minrandval minimal value to return maxrandval maximal value to return seedp pointer to seed value
Definition at line 9828 of file misc.c.
References getRandomInt().
◆ SCIPrandomGetInt()
SCIP_EXPORT int SCIPrandomGetInt | ( | SCIP_RANDNUMGEN * | randnumgen, |
int | minrandval, | ||
int | maxrandval | ||
) |
returns a random integer between minrandval and maxrandval
- Parameters
-
randnumgen random number generator minrandval minimal value to return maxrandval maximal value to return
Definition at line 9945 of file misc.c.
References randomGetRand(), SCIP_Longint, and SCIP_Real.
Referenced by calcPscostQuot(), chooseCoefVar(), chooseDoubleVar(), chooseFracVar(), chooseGuidedVar(), computeDegConsTree(), computeSteinerTree(), DECL_VARFIXINGS(), edgecostmultiplier(), getRandomVariable(), getScore(), getScoreLikeCoefdiving(), optimize(), orderDaRoots(), permuteStartSolution(), reduce_da(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_BRANCHEXECPS(), SCIP_DECL_DIVESETGETSCORE(), SCIP_DECL_HEUREXEC(), SCIPrandomGetSubset(), SCIPrandomPermuteArray(), SCIPrandomPermuteIntArray(), SCIPsolveConcurrent(), SCIPStpHeurRecRun(), SCIPStpHeurTMRun(), SCIPStpHeurTMRunLP(), selectDiving(), selectInitialVariableDecomposition(), selectInitialVariableRandomly(), selectsols(), and selectSolsRandomized().
◆ SCIPrandomGetSubset()
SCIP_EXPORT 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
-
randnumgen random number generator set original set, from which elements should be drawn nelems number of elements in original set subset subset in which drawn elements should be stored nsubelems number of elements that should be drawn and stored
Definition at line 10048 of file misc.c.
References BMScopyMemoryArray, r, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, and SCIPrandomGetInt().
◆ SCIPrandomGetReal()
SCIP_EXPORT SCIP_Real SCIPrandomGetReal | ( | SCIP_RANDNUMGEN * | randnumgen, |
SCIP_Real | minrandval, | ||
SCIP_Real | maxrandval | ||
) |
returns a random real between minrandval and maxrandval
- Parameters
-
randnumgen random number generator minrandval minimal value to return maxrandval maximal value to return
Definition at line 9967 of file misc.c.
References randomGetRand(), and SCIP_Real.
Referenced by alnsFixMoreVariables(), alnsUnfixVariables(), applyNlobbt(), computeFixingOrder(), computeScores(), createSubscip(), dataReset(), execRelpscost(), generateGaussianNoise(), getScore(), getScoreLikeCoefdiving(), handleCycle(), performRandRounding(), reduce_da(), sampleRandomPoints(), sampleWeighted(), SCIP_DECL_BANDITRESET(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_NLPISOLVE(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAEXECLP(), SCIPapplyLockFixings(), SCIPexprgraphSimplify(), SCIPexprtreeSimplify(), SCIPselectCuts(), SCIPsetModifiedDefaultSettingsIpopt(), SCIPStpHeurTMRun(), SCIPStpHeurTMRunLP(), selectBranchVar(), selectDiving(), setupProblem(), setupStart(), sortVariables(), and updateBestCandidate().
◆ SCIPgetRandomReal()
SCIP_EXPORT 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
-
minrandval minimal value to return maxrandval maximal value to return seedp pointer to seed value
Definition at line 9841 of file misc.c.
References getRandomReal().
◆ SCIPgetRandomSubset()
SCIP_EXPORT 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
-
set original set, from which elements should be drawn nelems number of elements in original set subset subset in which drawn elements should be stored nsubelems number of elements that should be drawn and stored randseed seed value for random generator
Definition at line 10302 of file misc.c.
References BMScopyMemoryArray, getRandomInt(), r, SCIP_INVALIDDATA, SCIP_OKAY, and SCIPerrorMessage.
◆ SCIPcreateRandom()
SCIP_EXPORT 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
-
scip SCIP data structure randnumgen random number generator initialseed initial random seed useglobalseed should the supplied seed be initialized by SCIP's global seed shift?
Definition at line 47 of file scip_randnumgen.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPinitializeRandomSeed(), and SCIPrandomCreate().
Referenced by DECL_NHINIT(), probdataCreate(), redLoopMw(), redLoopPc(), redLoopStp(), reduceNw(), reduceSap(), runCircle(), runCyckerlin(), SCIP_DECL_BRANCHINIT(), SCIP_DECL_HEURINIT(), SCIP_DECL_PRICERINIT(), SCIP_DECL_PROPINITSOL(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAINIT(), SCIP_DECL_SEPAINITSOL(), SCIPincludeBranchrulePscost(), SCIPincludeHeurAdaptivediving(), SCIPpermuteProb(), SCIPsolveConcurrent(), SCIPStpIncludeHeurRec(), and SCIPStpIncludeHeurTM().
◆ SCIPfreeRandom()
SCIP_EXPORT void SCIPfreeRandom | ( | SCIP * | scip, |
SCIP_RANDNUMGEN ** | randnumgen | ||
) |
frees a random number generator
- Parameters
-
scip SCIP data structure randnumgen random number generator
Definition at line 70 of file scip_randnumgen.c.
References NULL, SCIPblkmem(), and SCIPrandomFree().
Referenced by DECL_NHEXIT(), DECL_NHINIT(), probdataFree(), redLoopMw(), redLoopPc(), redLoopStp(), reduceNw(), reduceSap(), runCircle(), runCyckerlin(), SCIP_DECL_BRANCHEXIT(), SCIP_DECL_BRANCHFREE(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEURFREE(), SCIP_DECL_PRICEREXIT(), SCIP_DECL_PROPEXITSOL(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXITSOL(), SCIPpermuteProb(), and SCIPsolveConcurrent().
◆ SCIPsetRandomSeed()
SCIP_EXPORT 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
-
scip SCIP data structure randnumgen random number generator seed new random seed
Definition at line 85 of file scip_randnumgen.c.
References NULL, SCIPinitializeRandomSeed(), and SCIPrandomSetSeed().
Referenced by SCIP_DECL_BRANCHINIT().
◆ SCIPinitializeRandomSeed()
SCIP_EXPORT unsigned int SCIPinitializeRandomSeed | ( | SCIP * | scip, |
unsigned int | initialseedvalue | ||
) |
modifies an initial seed value with the global shift of random seeds
- Parameters
-
scip SCIP data structure initialseedvalue initial seed value to be modified
Definition at line 102 of file scip_randnumgen.c.
References NULL, SCIPsetInitializeRandomSeed(), and Scip::set.
Referenced by SCIPcreateBanditEpsgreedy(), SCIPcreateBanditExp3(), SCIPcreateBanditUcb(), SCIPcreateRandom(), SCIPincludePresolMILP(), SCIPresetBandit(), SCIPsetRandomSeed(), and setupAndSolveSubscipCrossover().