-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeninstances.sh
60 lines (51 loc) · 1.2 KB
/
geninstances.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
if [ "$1" = "" ]; then
echo "run with any command line to generate a whole lot of instances"
exit 1
fi
#M="basispursuit diet maxflow quantreg"
#M="maxflow"
M="uniform"
basispursuitm="0500 1000 1500 2000 2500"
basispursuitn="3000"
dietm="0500 1000 1500 2000 2500"
dietn="400"
maxflowm="0502 1002 1502 2002 2502"
maxflown="100" # dummy
quantregm="0500 1000 1500 2000 2500"
quantregn="200"
uniformm="500 1000 1500 2000 2500"
uniformn="500" # add to m
for s in $M ; do
echo "generating $s instances"
if [ "$s" == "basispursuit" ]; then
# m and n are swapped in basispursuit cmd line
mlist="$basispursuitn"
nlist="$basispursuitm"
elif [ "$s" == "diet" ]; then
mlist="$dietm"
nlist="$dietn"
elif [ "$s" == "maxflow" ]; then
mlist="$maxflowm"
nlist="$maxflown"
elif [ "$s" == "quantreg" ]; then
mlist="$quantregm"
nlist="$quantregn"
elif [ "$s" == "uniform" ]; then
mlist="$uniformm"
nlist="$uniformn"
fi
for m in $mlist ; do
for n in $nlist ; do
if [ "$s" == "uniform" ]; then
nn=$(( $m + $n ))
echo "./${s}gen.py $m $nn"
./${s}gen.py $m $nn
else
echo "./${s}gen.py $m $n"
./${s}gen.py $m $n
done
done
done
gzip *.dat
mv *.dat.gz dat/