Changeset 390
- Timestamp:
- Jun 26, 2006 12:11:00 PM (15 years ago)
- Location:
- branches/devel/Cbc/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/devel/Cbc/src/Cbc_ampl.cpp
r356 r390 23 23 THIS SOFTWARE. 24 24 ****************************************************************/ 25 #ifdef CBC_AMPL 25 26 26 #include "getstub.h" 27 27 #include "Cbc_ampl.h" … … 63 63 *blank=' '; 64 64 phrase=blank+1; /* move on */ 65 saveInfo->arguments[saveInfo->numberArguments++]=strdup(phrase); 66 } else { 65 if (strlen(phrase)) 66 saveInfo->arguments[saveInfo->numberArguments++]=strdup(phrase); 67 } else if (strlen(phrase)) { 67 68 saveInfo->arguments=(char **) realloc(saveInfo->arguments,(saveInfo->numberArguments+1)*sizeof(char *)); 68 69 saveInfo->arguments[saveInfo->numberArguments++]=strdup(phrase); … … 554 555 write_sol(buf,info->primalSolution,info->dualSolution,&Oinfo); 555 556 } 556 557 #endif -
branches/devel/Cbc/src/CoinSolve.cpp
r364 r390 2 2 // Corporation and others. All Rights Reserved. 3 3 4 #include "CbcConfig.h" 4 5 #include "CoinPragma.hpp" 5 6 … … 79 80 80 81 #include "OsiClpSolverInterface.hpp" 81 #ifdef C BC_AMPL82 #ifdef COIN_HAS_ASL 82 83 #include "Cbc_ampl.h" 83 84 static bool usingAmpl=false; … … 497 498 double * sosReference = NULL; 498 499 int * sosPriority=NULL; 499 #ifdef C BC_AMPL500 #ifdef COIN_HAS_ASL 500 501 ampl_info info; 501 502 if (argc>2&&!strcmp(argv[2],"-AMPL")) { … … 824 825 verbose &= ~8; 825 826 } 826 #ifdef C BC_AMPL827 #ifdef COIN_HAS_ASL 827 828 if (verbose<4&&usingAmpl) 828 829 verbose +=4; … … 1245 1246 // action 1246 1247 if (type==EXIT) { 1247 #ifdef C BC_AMPL1248 #ifdef COIN_HAS_ASL 1248 1249 if(usingAmpl) { 1249 1250 if (info.numberIntegers||info.numberBinary) { … … 1403 1404 model2=lpSolver; 1404 1405 } 1405 #ifdef C BC_AMPL1406 #ifdef COIN_HAS_ASL 1406 1407 if (usingAmpl) { 1407 1408 double value = model2->getObjValue()*model2->getObjSense(); … … 1711 1712 int translate[]={9999,0,0,-1,2,3}; 1712 1713 process.messageHandler()->setLogLevel(babModel->logLevel()); 1714 #ifdef COIN_HAS_ASL 1715 if (info.numberSos&&doSOS&&usingAmpl) { 1716 // SOS 1717 numberSOS = info.numberSos; 1718 sosStart = info.sosStart; 1719 sosIndices = info.sosIndices; 1720 } 1721 #endif 1722 if (numberSOS&&doSOS) { 1723 // SOS 1724 int numberColumns = saveSolver->getNumCols(); 1725 char * prohibited = new char[numberColumns]; 1726 memset(prohibited,0,numberColumns); 1727 int n=sosStart[numberSOS]; 1728 for (int i=0;i<n;i++) { 1729 int iColumn = sosIndices[i]; 1730 prohibited[iColumn]=1; 1731 } 1732 process.passInProhibited(prohibited,numberColumns); 1733 delete [] prohibited; 1734 } 1713 1735 solver2 = process.preProcessNonDefault(*saveSolver,translate[preProcess],10); 1714 1736 // Tell solver we are not in Branch and Cut … … 1717 1739 solver2->setHintParam(OsiDoInBranchAndCut,false,OsiHintDo) ; 1718 1740 } 1719 #ifdef C BC_AMPL1741 #ifdef COIN_HAS_ASL 1720 1742 if (!solver2&&usingAmpl) { 1721 1743 // infeasible … … 1983 2005 } 1984 2006 if (type==BAB) { 1985 #ifdef C BC_AMPL2007 #ifdef COIN_HAS_ASL 1986 2008 if (usingAmpl) { 1987 2009 priorities=info.priorities; … … 2175 2197 } 2176 2198 int statistics = (printOptions>0) ? printOptions: 0; 2177 #ifdef C BC_AMPL2199 #ifdef COIN_HAS_ASL 2178 2200 if (!usingAmpl) { 2179 2201 #endif … … 2200 2222 free(sosPriority); 2201 2223 sosPriority=NULL; 2202 #ifdef C BC_AMPL2224 #ifdef COIN_HAS_ASL 2203 2225 } 2204 2226 #endif … … 2317 2339 <<babModel->getIterationCount()<< 2318 2340 " iterations - took "<<time2-time1<<" seconds"<<std::endl; 2319 #ifdef C BC_AMPL2341 #ifdef COIN_HAS_ASL 2320 2342 if (usingAmpl) { 2321 2343 double value = babModel->getObjValue()*lpSolver->getObjSense(); … … 2371 2393 #endif 2372 2394 } else { 2373 std::cout<<"Model strengthen d - now has "<<clpSolver->getNumRows()2395 std::cout<<"Model strengthened - now has "<<clpSolver->getNumRows() 2374 2396 <<" rows"<<std::endl; 2375 2397 } … … 2383 2405 case IMPORT: 2384 2406 { 2385 #ifdef C BC_AMPL2407 #ifdef COIN_HAS_ASL 2386 2408 if (!usingAmpl) { 2387 2409 #endif … … 2408 2430 free(sosPriority); 2409 2431 sosPriority=NULL; 2410 #ifdef C BC_AMPL2432 #ifdef COIN_HAS_ASL 2411 2433 } 2412 2434 #endif
Note: See TracChangeset
for help on using the changeset viewer.