40#define SCIP_RAND_MAX 32767
50 assert(seedp !=
NULL);
52 nextseed = (*seedp) * 1103515245 + 12345;
53 *seedp = (
unsigned int)nextseed;
60#define SCIP_RAND_MAX RAND_MAX
81 return minrandval + (int) ((maxrandval - minrandval + 1)*(double)
getRand(seedp)/(
SCIP_RAND_MAX+1.0));
84int main(
int argc,
char** argv)
95 printf(
"usage: %s <filename> <n> <d>.\n", argv[0]);
106 file = fopen(argv[1],
"w");
109 printf(
"Could not open file %s.\n", argv[1]);
114 fprintf(file,
"Randomly generated LOP instance.\n");
115 fprintf(file,
"%d\n", n);
116 for (i = 0; i < n; ++i)
118 for (j = 0; j < n; ++j)
123 printf(
"Wrote random LOP instance to %s\n", argv[1]);
124 printf(
"Size: %d\n", n);
125 printf(
"Entries: {0, ..., %d}\n", d);
int main(int argc, char **argv)
static int getRand(unsigned int *seedp)
static int getRandomInt(int minrandval, int maxrandval, unsigned int *seedp)