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
void SCIPswapPointers ( void **  pointer1,
void **  pointer2 
)

swaps the addresses of two pointers

Parameters
pointer1first pointer
pointer2second pointer
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
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)
randseedpointer to seed value for the random generator
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