tools/dimacs-solver.cc
branch1.2
changeset 1424 7edc220d6244
parent 1169 774349a16ba0
equal deleted inserted replaced
18:8a52c91f0bad 22:bf5794a2f522
   219     case 2:
   219     case 2:
   220       output.open(ap.files()[1].c_str());
   220       output.open(ap.files()[1].c_str());
   221       if (!output) {
   221       if (!output) {
   222         throw IoError("Cannot open the file for writing", ap.files()[1]);
   222         throw IoError("Cannot open the file for writing", ap.files()[1]);
   223       }
   223       }
       
   224       // fall through
   224     case 1:
   225     case 1:
   225       input.open(ap.files()[0].c_str());
   226       input.open(ap.files()[0].c_str());
   226       if (!input) {
   227       if (!input) {
   227         throw IoError("File cannot be found", ap.files()[0]);
   228         throw IoError("File cannot be found", ap.files()[0]);
   228       }
   229       }
       
   230       // fall through
   229     case 0:
   231     case 0:
   230       break;
   232       break;
   231     default:
   233     default:
   232       std::cerr << ap.commandName() << ": too many arguments\n";
   234       std::cerr << ap.commandName() << ": too many arguments\n";
   233       return 1;
   235       return 1;
   248         case DimacsDescriptor::MAX:
   250         case DimacsDescriptor::MAX:
   249           std::cout << "max";
   251           std::cout << "max";
   250           break;
   252           break;
   251         case DimacsDescriptor::SP:
   253         case DimacsDescriptor::SP:
   252           std::cout << "sp";
   254           std::cout << "sp";
       
   255           break;
   253         case DimacsDescriptor::MAT:
   256         case DimacsDescriptor::MAT:
   254           std::cout << "mat";
   257           std::cout << "mat";
   255           break;
   258           break;
   256         default:
   259         default:
   257           exit(1);
   260           exit(1);