/* -*- mode: C++; indent-tabs-mode: nil; -*- * * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #include "test_tools.h" #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_CPLEX #include #endif #ifdef HAVE_GLPK #include #endif #ifdef HAVE_CBC #include #endif using namespace lemon; void solveAndCheck(MipSolver& mip, MipSolver::ProblemType stat, double exp_opt) { using std::string; mip.solve(); //int decimal,sign; std::ostringstream buf; buf << "Type should be: " << int(stat)<<" and it is "< void cloneTest() { MIP* mip = new MIP(); MIP* mipnew = mip->newSolver(); MIP* mipclone = mip->cloneSolver(); delete mip; delete mipnew; delete mipclone; } int main() { #ifdef HAVE_GLPK { GlpkMip mip1; aTest(mip1); cloneTest(); } #endif #ifdef HAVE_CPLEX try { CplexMip mip2; aTest(mip2); cloneTest(); } catch (CplexEnv::LicenseError& error) { check(false, error.what()); } #endif #ifdef HAVE_CBC { CbcMip mip1; aTest(mip1); cloneTest(); } #endif return 0; }