aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/cplex/ilp_solver
blob: 1e70a6522177ae94b7776502a7f921b6994fac68 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
tmp=$2.tmp
rm -f $tmp $2
if cplex -c "read $1" "optimize" "write $tmp sol";
then
  grep '<variable name="' $tmp | sed -e 's@ *<variable name="@@' -e 's@" index=.* value="@ @' -e 's@"/>@@' > $2
  rm -f $tmp
else
  exit $?
fi