test/lp_test.cc
changeset 568 b53a9068e3e4
parent 542 fc6c7aab4b8d
child 575 3cbddc293cf9
equal deleted inserted replaced
8:dc090805385b 9:3af8d60dd3bd
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2008
     5  * Copyright (C) 2003-2009
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   363 
   363 
   364 template<class LP>
   364 template<class LP>
   365 void cloneTest()
   365 void cloneTest()
   366 {
   366 {
   367   //Test for clone/new
   367   //Test for clone/new
   368   
   368 
   369   LP* lp = new LP();
   369   LP* lp = new LP();
   370   LP* lpnew = lp->newSolver();
   370   LP* lpnew = lp->newSolver();
   371   LP* lpclone = lp->cloneSolver();
   371   LP* lpclone = lp->cloneSolver();
   372   delete lp;
   372   delete lp;
   373   delete lpnew;
   373   delete lpnew;
   391 #ifdef HAVE_CPLEX
   391 #ifdef HAVE_CPLEX
   392   try {
   392   try {
   393     CplexLp lp_cplex1,lp_cplex2;
   393     CplexLp lp_cplex1,lp_cplex2;
   394     lpTest(lp_cplex1);
   394     lpTest(lp_cplex1);
   395     aTest(lp_cplex2);
   395     aTest(lp_cplex2);
       
   396     cloneTest<CplexLp>();
   396   } catch (CplexEnv::LicenseError& error) {
   397   } catch (CplexEnv::LicenseError& error) {
   397 #ifdef LEMON_FORCE_CPLEX_CHECK
   398 #ifdef LEMON_FORCE_CPLEX_CHECK
   398     check(false, error.what());
   399     check(false, error.what());
   399 #else
   400 #else
   400     std::cerr << error.what() << std::endl;
   401     std::cerr << error.what() << std::endl;
   401     std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
   402     std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
   402 #endif
   403 #endif
   403   }
   404   }
   404     cloneTest<CplexLp>();
       
   405 #endif
   405 #endif
   406 
   406 
   407 #ifdef HAVE_SOPLEX
   407 #ifdef HAVE_SOPLEX
   408   {
   408   {
   409     SoplexLp lp_soplex1,lp_soplex2;
   409     SoplexLp lp_soplex1,lp_soplex2;