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_RETCODE | SCIPrandomCreate (SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed) |
void | SCIPrandomFree (SCIP_RANDNUMGEN **randnumgen) |
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) |
int SCIPgetRandomInt | ( | int | minrandval, |
int | maxrandval, | ||
unsigned int * | seedp | ||
) |
returns a random integer between minrandval and maxrandval
returns a random integer between minrandval and maxrandval
minrandval | minimal value to return |
maxrandval | maximal value to return |
seedp | pointer to seed value |
Definition at line 8605 of file misc.c.
References getRandomInt().
int SCIPrandomGetInt | ( | SCIP_RANDNUMGEN * | randnumgen, |
int | minrandval, | ||
int | maxrandval | ||
) |
returns a random integer between minrandval and maxrandval
randnumgen | random number generator |
minrandval | minimal value to return |
maxrandval | maximal value to return |
Definition at line 8723 of file misc.c.
References randomGetRand(), SCIP_Longint, and SCIP_Real.
Referenced by calcPscostQuot(), chooseCoefVar(), chooseDoubleVar(), chooseFracVar(), chooseGuidedVar(), getRandomVariable(), handle1Cycle(), handleCycle(), optimize(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_BRANCHEXECPS(), SCIP_DECL_DIVESETGETSCORE(), SCIP_DECL_HEUREXEC(), SCIPrandomGetSubset(), SCIPrandomPermuteArray(), SCIPrandomPermuteIntArray(), SCIPsolveParallel(), selectInitialVariable(), and selectSolsRandomized().
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
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 8826 of file misc.c.
References BMScopyMemoryArray, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, and SCIPrandomGetInt().
SCIP_Real SCIPrandomGetReal | ( | SCIP_RANDNUMGEN * | randnumgen, |
SCIP_Real | minrandval, | ||
SCIP_Real | maxrandval | ||
) |
returns a random real between minrandval and maxrandval
randnumgen | random number generator |
minrandval | minimal value to return |
maxrandval | maximal value to return |
Definition at line 8745 of file misc.c.
References randomGetRand(), and SCIP_Real.
Referenced by applyNlobbt(), computeFixingOrder(), createSubscip(), execRelpscost(), handleCycle(), performRandRounding(), sampleRandomPoints(), SCIPexprgraphSimplify(), SCIPexprtreeSimplify(), SCIPsetModifiedDefaultSettingsIpopt(), selectBranchVar(), setupProblem(), sortVariables(), and updateBestCandidate().
SCIP_RETCODE SCIPrandomCreate | ( | SCIP_RANDNUMGEN ** | randnumgen, |
BMS_BLKMEM * | blkmem, | ||
unsigned int | initialseed | ||
) |
creates and initializes a random number generator
randnumgen | random number generator |
blkmem | block memory |
initialseed | initial random seed |
Definition at line 8693 of file misc.c.
References BMSallocBlockMemory, NULL, randomInitialize(), SCIP_ALLOC, and SCIP_OKAY.
Referenced by runCircle(), SCIP_DECL_BRANCHINIT(), SCIP_DECL_HEURINIT(), SCIP_DECL_PROPINITSOL(), SCIP_DECL_SEPAINIT(), SCIP_NlpiProblem::SCIP_NlpiProblem(), SCIPdivesetReset(), SCIPexprgraphSimplify(), SCIPexprtreeSimplify(), SCIPpermuteProb(), SCIPreoptCreate(), and SCIPsolveParallel().
void SCIPrandomFree | ( | SCIP_RANDNUMGEN ** | randnumgen | ) |
frees a random number generator
randnumgen | random number generator |
Definition at line 8710 of file misc.c.
References BMSfreeBlockMemory, and NULL.
Referenced by divesetFree(), runCircle(), SCIP_DECL_BRANCHEXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_PROPEXITSOL(), SCIP_DECL_SEPAEXIT(), SCIP_NlpiProblem::SCIP_NlpiProblem(), SCIPdivesetReset(), SCIPexprgraphSimplify(), SCIPexprtreeSimplify(), SCIPpermuteProb(), SCIPreoptFree(), and SCIPsolveParallel().
returns a random real between minrandval and maxrandval
returns a random real between minrandval and maxrandval
minrandval | minimal value to return |
maxrandval | maximal value to return |
seedp | pointer to seed value |
Definition at line 8618 of file misc.c.
References getRandomReal().
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
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
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 9080 of file misc.c.
References BMScopyMemoryArray, getRandomInt(), SCIP_INVALIDDATA, SCIP_OKAY, and SCIPerrorMessage.