31 #define SCIP_RAND_MAX 32767 41 assert(seedp !=
NULL);
43 nextseed = (*seedp) * 1103515245 + 12345;
44 *seedp = (
unsigned int)nextseed;
51 #define SCIP_RAND_MAX RAND_MAX 72 return minrandval + (int) ((maxrandval - minrandval + 1)*(double)
getRand(seedp)/(
SCIP_RAND_MAX+1.0));
75 int main(
int argc,
char** argv)
86 printf(
"usage: %s <filename> <n> <d>.\n", argv[0]);
97 file = fopen(argv[1],
"w");
100 printf(
"Could not open file %s.\n", argv[1]);
105 fprintf(file,
"Randomly generated LOP instance.\n");
106 fprintf(file,
"%d\n", n);
107 for (i = 0; i < n; ++i)
109 for (j = 0; j < n; ++j)
114 printf(
"Wrote random LOP instance to %s\n", argv[1]);
115 printf(
"Size: %d\n", n);
116 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)