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