Changeset 47


Ignore:
Timestamp:
Dec 26, 2004 4:20:51 PM (16 years ago)
Author:
jpfasano
Message:

changes so code will work when runtime parameter is not specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Samples/sample2.cpp

    r46 r47  
    110110  // Read in model using argv[1]
    111111  // and assert that it is a clean model
    112   int numMpsReadErrors;
    113   if (argc<2)
    114     numMpsReadErrors =
    115       model.solver()->readMps("../../Mps/Sample/p0033.mps","");
    116   else
    117     numMpsReadErrors = model.solver()->readMps(argv[1],"");
     112  std::string mpsFileName = "../../Mps/Sample/p0033.mps";
     113  if (argc>=2) mpsFileName = argv[1];
     114  int numMpsReadErrors = model.solver()->readMps(mpsFileName.c_str(),"");
    118115  assert(numMpsReadErrors==0);
    119116
     
    237234  }
    238235
    239   std::cout<<argv[1]<<" took "<<cpuTime()-time1<<" seconds, "
     236  std::cout<<mpsFileName<<" took "<<cpuTime()-time1<<" seconds, "
    240237           <<model.getNodeCount()<<" nodes with objective "
    241238           <<model.getObjValue()
Note: See TracChangeset for help on using the changeset viewer.