Scippy

SCIP

Solving Constraint Integer Programs

Permutations Shuffling

Detailed Description

Functions

void SCIPswapInts (int *value1, int *value2)
 
void SCIPswapPointers (void **pointer1, void **pointer2)
 
void SCIPpermuteIntArray (int *array, int begin, int end, unsigned int *randseed)
 
void SCIPpermuteArray (void **array, int begin, int end, unsigned int *randseed)
 
SCIP_RETCODE SCIPgetRandomSubset (void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
 

Function Documentation

void SCIPswapInts ( int *  value1,
int *  value2 
)

swaps two ints

Parameters
value1pointer to first integer
value2pointer ti second integer

Definition at line 7829 of file misc.c.

Referenced by analyzeConflictOverload(), checkOverloadViaThetaTree(), and isConnectedSOS1().

void SCIPswapPointers ( void **  pointer1,
void **  pointer2 
)

swaps the addresses of two pointers

Parameters
pointer1first pointer
pointer2second pointer

Definition at line 7842 of file misc.c.

Referenced by applyProbing(), CREATE_CONSTRAINT(), getNextToken(), parseQuadratic(), pushToken(), removeRedundantConss(), SCIProwGetDiscreteScalarProduct(), SCIProwGetScalarProduct(), and tightenVarsBoundsSOS1().

void SCIPpermuteIntArray ( int *  array,
int  begin,
int  end,
unsigned int *  randseed 
)

randomly shuffles parts of an integer array using the Fisher-Yates algorithm

Parameters
arrayarray to be shuffled
beginfirst index that should be subject to shuffling (0 for whole array)
endlast index that should be subject to shuffling (array size for whole array)
randseedseed value for the random generator

Definition at line 7855 of file misc.c.

References SCIPgetRandomInt().

Referenced by SCIP_DECL_HEUREXEC().

void SCIPpermuteArray ( void **  array,
int  begin,
int  end,
unsigned int *  randseed 
)

randomly shuffles parts of an array using the Fisher-Yates algorithm

Parameters
arrayarray to be shuffled
beginfirst index that should be subject to shuffling (0 for whole array)
endlast index that should be subject to shuffling (array size for whole array)
randseedseed value for the random generator

Definition at line 7884 of file misc.c.

References SCIPgetRandomInt().

Referenced by performRandRounding(), preprocessCliques(), and SCIPpermuteProb().

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

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 7914 of file misc.c.

References BMScopyMemoryArray, SCIP_INVALIDDATA, SCIP_OKAY, SCIPerrorMessage, and SCIPgetRandomInt().