COIN-OR::LEMON - Graph Library

Ticket #241: 9d0d7e20f76d.patch

File 9d0d7e20f76d.patch, 5.9 KB (added by Balazs Dezso, 16 years ago)

Fix

  • lemon/cplex.cc

    # HG changeset patch
    # User Balazs Dezso <deba@inf.elte.hu>
    # Date 1237448434 -3600
    # Node ID 9d0d7e20f76d71a7129ffbc9beb7092114587677
    # Parent  20e3acc1a757bc90dd280136e524c2f56a0f42c2
    Fix lp related errors and warnings (#241 and #242)
    
    diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/cplex.cc
    a b  
    22 *
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
    88 *
     
    441441  // CplexLp members
    442442
    443443  CplexLp::CplexLp()
    444     : LpBase(), CplexBase(), LpSolver() {}
     444    : LpBase(), LpSolver(), CplexBase() {}
    445445
    446446  CplexLp::CplexLp(const CplexEnv& env)
    447     : LpBase(), CplexBase(env), LpSolver() {}
     447    : LpBase(), LpSolver(), CplexBase(env) {}
    448448
    449449  CplexLp::CplexLp(const CplexLp& other)
    450     : LpBase(), CplexBase(other), LpSolver() {}
     450    : LpBase(), LpSolver(), CplexBase(other) {}
    451451
    452452  CplexLp::~CplexLp() {}
    453453
     
    798798  // CplexMip members
    799799
    800800  CplexMip::CplexMip()
    801     : LpBase(), CplexBase(), MipSolver() {
     801    : LpBase(), MipSolver(), CplexBase() {
    802802
    803803#if CPX_VERSION < 800
    804804    CPXchgprobtype(cplexEnv(),  _prob, CPXPROB_MIP);
     
    808808  }
    809809
    810810  CplexMip::CplexMip(const CplexEnv& env)
    811     : LpBase(), CplexBase(env), MipSolver() {
     811    : LpBase(), MipSolver(), CplexBase(env) {
    812812
    813813#if CPX_VERSION < 800
    814814    CPXchgprobtype(cplexEnv(),  _prob, CPXPROB_MIP);
     
    819819  }
    820820
    821821  CplexMip::CplexMip(const CplexMip& other)
    822     : LpBase(), CplexBase(other), MipSolver() {}
     822    : LpBase(), MipSolver(), CplexBase(other) {}
    823823
    824824  CplexMip::~CplexMip() {}
    825825
  • lemon/cplex.h

    diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/cplex.h
    a b  
    22 *
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
    88 *
     
    7878  /// \brief Base interface for the CPLEX LP and MIP solver
    7979  ///
    8080  /// This class implements the common interface of the CPLEX LP and
    81   /// MIP solvers. 
     81  /// MIP solvers.
    8282  /// \ingroup lp_group
    8383  class CplexBase : virtual public LpBase {
    8484  protected:
     
    235235    /// \e
    236236    virtual ~CplexMip();
    237237
     238    /// \e
     239    virtual CplexMip* cloneSolver() const;
     240    /// \e
     241    virtual CplexMip* newSolver() const;
     242
    238243  protected:
    239244
    240     virtual CplexMip* _cloneSolver() const;
    241     virtual CplexMip* _newSolver() const;
    242245
    243246    virtual const char* _solverName() const;
    244247
  • lemon/glpk.cc

    diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/glpk.cc
    a b  
    22 *
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
    88 *
     
    531531  // GlpkLp members
    532532
    533533  GlpkLp::GlpkLp()
    534     : LpBase(), GlpkBase(), LpSolver() {
     534    : LpBase(), LpSolver(), GlpkBase() {
    535535    messageLevel(MESSAGE_NO_OUTPUT);
    536536  }
    537537
    538538  GlpkLp::GlpkLp(const GlpkLp& other)
    539     : LpBase(other), GlpkBase(other), LpSolver(other) {
     539    : LpBase(other), LpSolver(other), GlpkBase(other) {
    540540    messageLevel(MESSAGE_NO_OUTPUT);
    541541  }
    542542
     
    830830  // GlpkMip members
    831831
    832832  GlpkMip::GlpkMip()
    833     : LpBase(), GlpkBase(), MipSolver() {
     833    : LpBase(), MipSolver(), GlpkBase() {
    834834    messageLevel(MESSAGE_NO_OUTPUT);
    835835  }
    836836
    837837  GlpkMip::GlpkMip(const GlpkMip& other)
    838     : LpBase(), GlpkBase(other), MipSolver() {
     838    : LpBase(), MipSolver(), GlpkBase(other) {
    839839    messageLevel(MESSAGE_NO_OUTPUT);
    840840  }
    841841
  • test/lp_test.cc

    diff -r 20e3acc1a757 -r 9d0d7e20f76d test/lp_test.cc
    a b  
    22 *
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
    88 *
     
    365365void cloneTest()
    366366{
    367367  //Test for clone/new
    368  
     368
    369369  LP* lp = new LP();
    370370  LP* lpnew = lp->newSolver();
    371371  LP* lpclone = lp->cloneSolver();
     
    393393    CplexLp lp_cplex1,lp_cplex2;
    394394    lpTest(lp_cplex1);
    395395    aTest(lp_cplex2);
     396    cloneTest<CplexLp>();
    396397  } catch (CplexEnv::LicenseError& error) {
    397398#ifdef LEMON_FORCE_CPLEX_CHECK
    398399    check(false, error.what());
     
    401402    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
    402403#endif
    403404  }
    404     cloneTest<CplexLp>();
    405405#endif
    406406
    407407#ifdef HAVE_SOPLEX
  • test/mip_test.cc

    diff -r 20e3acc1a757 -r 9d0d7e20f76d test/mip_test.cc
    a b  
    22 *
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
    88 *
     
    109109template<class MIP>
    110110void cloneTest()
    111111{
    112  
     112
    113113  MIP* mip = new MIP();
    114114  MIP* mipnew = mip->newSolver();
    115115  MIP* mipclone = mip->cloneSolver();
     
    133133  try {
    134134    CplexMip mip2;
    135135    aTest(mip2);
     136    cloneTest<CplexMip>();
    136137  } catch (CplexEnv::LicenseError& error) {
    137138#ifdef LEMON_FORCE_CPLEX_CHECK
    138139    check(false, error.what());
     
    141142    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
    142143#endif
    143144  }
    144   cloneTest<CplexMip>();
    145145#endif
    146146
    147147  return 0;