/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the class library */ /* SoPlex --- the Sequential object-oriented simPlex. */ /* */ /* Copyright (c) 1996-2024 Zuse Institute Berlin (ZIB) */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ /* See the License for the specific language governing permissions and */ /* limitations under the License. */ /* */ /* You should have received a copy of the Apache-2.0 license */ /* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include #include "spxlp.h" #include "spxdefines.h" #include "soplex.h" #include "spxsolver.h" #include "array.h" #include "timer.h" #include "spxpricer.h" #include "spxdantzigpr.h" #include "spxparmultpr.h" #include "spxdevexpr.h" #include "spxhybridpr.h" #include "spxsteeppr.h" #include "spxweightpr.h" #include "spxratiotester.h" #include "spxharrisrt.h" #include "spxdefaultrt.h" #include "spxfastrt.h" #include "spxsimplifier.h" #include "spxmainsm.h" #include "spxscaler.h" #include "spxequilisc.h" #include "spxgeometsc.h" #include "spxsumst.h" #include "spxweightst.h" #include "spxvectorst.h" #include "slufactor.h" #include "spxout.h" using namespace soplex; class StatusExceptionCheck { bool checkXSOLVR01(); bool checkXSOLVE01(); bool checkXSOLVE08(); bool checkXSOLVE09(); bool checkXSOLVE10(); bool checkXSOLVE11(); public: bool noProblemCheck(); bool noSolverCheck(); bool noPricerCheck(); bool noRatioTesterCheck(); bool notInitialized(); }; bool StatusExceptionCheck::noProblemCheck() { std::cout<optimize(); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVR01") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::checkXSOLVE01() { SPxSolver* solver = new SPxSolver(); try{ solver->solve(); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVE01") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::checkXSOLVE08() { SPxSolver* solver = new SPxSolver(); Vector* p_primal = 0; try{ solver->getDualSol(*p_primal); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVE08") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::checkXSOLVE09() { SPxSolver* solver = new SPxSolver(); Vector* p_primal = 0; try{ solver->getRedCostSol(*p_primal); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVE09") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::checkXSOLVE10() { SPxSolver* solver = new SPxSolver(); Vector* p_primal = 0; try{ solver->getDualFarkas(*p_primal); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVE10") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::checkXSOLVE11() { SPxSolver* solver = new SPxSolver(); Vector* p_primal = 0; try{ solver->getSlacks(*p_primal); }catch(SPxStatusException& x) { delete solver; if(x.what().find("XSOLVE11") == 0) return true; return false; } delete solver; return false; } bool StatusExceptionCheck::noSolverCheck() { std::cout<readFile(filename, &rownames, &colnames); try{ solver->solve(); }catch(SPxStatusException& x) { delete solver; if(x.what().find(testString) == 0) { std::cout<<"ok"< slu; solver->readFile(filename, &rownames, &colnames); solver->setBasisSolver(&slu); try{ solver->solve(); }catch(SPxStatusException& x) { delete solver; if(x.what().find(testString) == 0) { std::cout<<"ok"< slu; SPxSteepPR pricer; solver->readFile(filename, &rownames, &colnames); solver->setBasisSolver(&slu); solver->setPricer(&pricer); try{ solver->solve(); }catch(SPxStatusException& x) { delete solver; if(x.what().find(testString) == 0) { std::cout<<"ok"< slu; SPxSteepPR pricer; SPxDefaultRT tester; Vector* v; solver->readFile(filename, &rownames, &colnames); solver->setBasisSolver(&slu); solver->setPricer(&pricer); solver->setTester(&tester); try{ solver->getPrimalSol(*v); }catch(SPxStatusException& x) { delete solver; if(x.what().find(testString) == 0) { std::cout<<"ok"<