meplib / 00model / prepareForPipES.sh @ master
Historique | Voir | Annoter | Télécharger (2,57 ko)
1 |
#! /bin/sh |
---|---|
2 |
# |
3 |
# Prepare data for PIP |
4 |
# |
5 |
# Uses a evenly separated list of points built using the data from the |
6 |
# first line of the config file: |
7 |
# -the lower bound; |
8 |
# -the upper bound; |
9 |
# -the number of points. |
10 |
# |
11 |
CONFIG_FILE=config.txt |
12 |
DIGITS_FILE=digits.txt |
13 |
PREPARE_POINTS_FILE=extractedPointsList.txt |
14 |
INV_FILE=inv.txt |
15 |
W_FILE=w.txt |
16 |
MKLOOPS_FILE=mkloops.txt |
17 |
BOUNDS_FILE=mkloops-bounds.txt |
18 |
BIN_DIR=./bin |
19 |
W_GENERATOR=$BIN_DIR/generate-w-vector-01 |
20 |
MKLOOPS_GENERATOR=$BIN_DIR/mkloops-with-w |
21 |
ARGS_FOR_VANDERMONDE=`argsForVandermonde.sh` |
22 |
ARGS_FOR_POINTS_LIST=`argsForPointsList.sh` |
23 |
MAX_ERROR=`awk '{if(FNR==1) print $2}' < $CONFIG_FILE` |
24 |
CREATE_VANDERMONDE=$BIN_DIR/createVandermonde.pl |
25 |
INV_VANDERMONDE=$BIN_DIR/invVandermonde.pl |
26 |
PRINT_GENERATOR_VECTOR=$BIN_DIR/printGeneratorVector.pl |
27 |
PRINT_POINTS_LIST=$BIN_DIR/printESPointsList.pl |
28 |
ADD_BOUNDS_TO_MKLOOPS=$BIN_DIR/addBoundsToMkloops-01.pl |
29 |
COMPUTE_BOUNDS_FOR_MKLOOPS=$BIN_DIR/computeBoundsForMkloops-01.pl |
30 |
CREATE_DIGITS_FILE=createDigitsFile.sh |
31 |
# |
32 |
# |
33 |
# |
34 |
$CREATE_DIGITS_FILE $CONFIG_FILE $DIGITS_FILE |
35 |
if [ $? != 0 ] |
36 |
then |
37 |
echo |
38 |
echo |
39 |
echo The creation of the digits file failed. |
40 |
echo Aborting the program! |
41 |
echo |
42 |
exit 1 |
43 |
fi |
44 |
$CREATE_VANDERMONDE $ARGS_FOR_VANDERMONDE | $INV_VANDERMONDE > $INV_FILE |
45 |
if [ $? != 0 ] |
46 |
then |
47 |
echo |
48 |
echo |
49 |
echo The creation and the inversion of the Vandermonde matrix failed. |
50 |
echo Aborting the program! |
51 |
echo |
52 |
exit 1 |
53 |
fi |
54 |
|
55 |
ARGS=`$PRINT_GENERATOR_VECTOR $ARGS_FOR_VANDERMONDE` |
56 |
if [ $? != 0 ] |
57 |
then |
58 |
echo |
59 |
echo |
60 |
echo Could not create the generator for the offset vector. |
61 |
echo Aborting the program! |
62 |
echo |
63 |
exit 1 |
64 |
fi |
65 |
ARGS="$INV_FILE $DIGITS_FILE $MAX_ERROR $ARGS" |
66 |
$W_GENERATOR $ARGS > $W_FILE |
67 |
if [ $? != 0 ] |
68 |
then |
69 |
echo |
70 |
echo |
71 |
echo Could not compute the offset vector. |
72 |
echo Aborting the program! |
73 |
echo |
74 |
exit 1 |
75 |
fi |
76 |
$PRINT_POINTS_LIST $ARGS_FOR_POINTS_LIST > $PREPARE_POINTS_FILE |
77 |
if [ $? != 0 ] |
78 |
then |
79 |
echo |
80 |
echo |
81 |
echo Could not get the points list. |
82 |
echo Aborting the program! |
83 |
echo |
84 |
exit 1 |
85 |
fi |
86 |
ARGS=`cat $PREPARE_POINTS_FILE` |
87 |
ARGS="$W_FILE $DIGITS_FILE $MAX_ERROR $ARGS" |
88 |
$MKLOOPS_GENERATOR $ARGS > $MKLOOPS_FILE |
89 |
if [ $? != 0 ] |
90 |
then |
91 |
echo |
92 |
echo |
93 |
echo Could not generate the data for PIP. |
94 |
echo Aborting the program! |
95 |
echo |
96 |
exit 1 |
97 |
fi |
98 |
$ADD_BOUNDS_TO_MKLOOPS $MKLOOPS_FILE |
99 |
if [ $? != 0 ] |
100 |
then |
101 |
echo |
102 |
echo |
103 |
echo Could not add the bounds to data for PIP. |
104 |
echo Aborting the program! |
105 |
echo |
106 |
exit 1 |
107 |
fi |
108 |
$COMPUTE_BOUNDS_FOR_MKLOOPS $MKLOOPS_FILE |
109 |
if [ $? != 0 ] |
110 |
then |
111 |
echo |
112 |
echo |
113 |
echo Could not compute valid loops. |
114 |
echo Aborting the program! |
115 |
echo |
116 |
cat $BOUNDS_FILE |
117 |
exit 1 |
118 |
fi |
119 |
|