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