Changeset 246


Ignore:
Timestamp:
Feb 8, 2006 3:30:08 PM (14 years ago)
Author:
forrest
Message:

for HAS vs USE

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcHeuristic.cpp

    r232 r246  
    99#include <cfloat>
    1010
     11#ifdef COIN_USE_CLP
    1112#include "OsiClpSolverInterface.hpp"
     13#endif
    1214#include "CbcModel.hpp"
    1315#include "CbcMessage.hpp"
     
    5355                                  double cutoff, std::string name) const
    5456{
     57#ifdef COIN_USE_CLP
    5558  OsiClpSolverInterface * osiclp = dynamic_cast< OsiClpSolverInterface*> (solver);
    5659  if (osiclp) {
     
    6568    osiclp->setSpecialOptions(osiclp->specialOptions()|(128+64));
    6669  }
     70#endif
    6771  // Reduce printout
    6872  solver->setHintParam(OsiDoReducePrint,true,OsiHintTry);
  • trunk/CbcModel.cpp

    r238 r246  
    1212#include <cmath>
    1313#include <cfloat>
    14 #define COIN_USE_CLP
    1514#ifdef COIN_USE_CLP
    1615// include Presolve from Clp
     
    417416  }
    418417  eventHappened_=false;
     418#ifdef COIN_USE_CLP
    419419  ClpEventHandler * eventHandler=NULL;
    420 #ifdef COIN_USE_CLP
    421420 {
    422421   OsiClpSolverInterface * clpSolver
     
    923922        }
    924923      }
     924#ifdef COIN_USE_CLP
    925925      if (eventHandler) {
    926926        if (!eventHandler->event(ClpEventHandler::solution)) {
     
    928928        }
    929929      }
     930#endif
    930931      // Do from deepest
    931932      tree_->cleanTree(this, newCutoff,bestPossibleObjective_) ;
     
    970971        << numberNodes_<< nNodes<< bestObjective_<< bestPossibleObjective_
    971972        << CoinMessageEol ;
     973#ifdef COIN_USE_CLP
    972974      if (eventHandler) {
    973975        if (!eventHandler->event(ClpEventHandler::treeStatus)) {
     
    975977        }
    976978      }
     979#endif
    977980    }
    978981    // If no solution but many nodes - signal change in strategy
     
    12741277        Clearly I need to look more carefully.
    12751278*/
     1279#ifdef COIN_USE_CLP
    12761280        if (eventHandler) {
    12771281          if (!eventHandler->event(ClpEventHandler::node)) {
     
    12791283          }
    12801284        }
     1285#endif
    12811286        assert (!newNode || newNode->objectiveValue() <= getCutoff()) ;
    12821287        if (statistics_) {
     
    17171722  }
    17181723  eventHappened_=false;
     1724#ifdef COIN_USE_CLP
    17191725  ClpEventHandler * eventHandler=NULL;
    1720 #ifdef COIN_USE_CLP
    17211726 {
    17221727   OsiClpSolverInterface * clpSolver
     
    21892194        }
    21902195      }
     2196#ifdef COIN_USE_CLP
    21912197      if (eventHandler) {
    21922198        if (!eventHandler->event(ClpEventHandler::solution)) {
     
    21942200        }
    21952201      }
     2202#endif
    21962203      // Do from deepest
    21972204      tree_->cleanTree(this, newCutoff,bestPossibleObjective_) ;
     
    22282235        << numberNodes_<< nNodes<< bestObjective_<< bestPossibleObjective_
    22292236        << CoinMessageEol ;
     2237#ifdef COIN_USE_CLP
    22302238      if (eventHandler) {
    22312239        if (!eventHandler->event(ClpEventHandler::treeStatus)) {
     
    22332241        }
    22342242      }
     2243#endif
    22352244    }
    22362245    // If no solution but many nodes - signal change in strategy
     
    29552964                 
    29562965                */
     2966#ifdef COIN_USE_CLP
    29572967                if (eventHandler()) {
    29582968                  if (!eventHandler()->event(ClpEventHandler::node)) {
     
    29602970                  }
    29612971                }
     2972#endif
    29622973                assert (!newNode2 || newNode2->objectiveValue() <= getCutoff()) ;
    29632974                if (statistics_) {
     
    31263137       
    31273138      */
     3139#ifdef COIN_USE_CLP
    31283140      if (eventHandler()) {
    31293141        if (!eventHandler()->event(ClpEventHandler::node)) {
     
    31313143        }
    31323144      }
     3145#endif
    31333146      assert (!newNode || newNode->objectiveValue() <= getCutoff()) ;
    31343147      if (statistics_) {
  • trunk/CbcStrategy.cpp

    r222 r246  
    1010
    1111#include "OsiSolverInterface.hpp"
    12 #define COIN_USE_CLP
    1312#ifdef COIN_USE_CLP
    1413#include "OsiClpSolverInterface.hpp"
  • trunk/Makefile.Cbc

    r214 r246  
    4848#   CXXFLAGS += -lefence
    4949endif
     50ifneq (,$(filter COIN_HAS_OSICLP, $(Define)))
     51#  add in USE
     52CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
     53endif
    5054
    5155export ExtraIncDir  := ${CoinIncDir} ${zlibIncDir} ${bzlibIncDir}
  • trunk/Makefile.lightweight

    r106 r246  
    99include ${MakefileDir}/Makefile.coin
    1010include ${MakefileDir}/Makefile.location
     11ifneq (,$(filter COIN_HAS_OSICLP, $(Define)))
     12#  add in USE
     13CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
     14endif
    1115
    1216###############################################################################
  • trunk/Test/CbcMain.cpp

    r228 r246  
    4949#ifdef COIN_USE_DYLP
    5050#include "OsiDylpSolverInterface.hpp"
     51#endif
     52#ifdef COIN_USE_OSL
     53#include "OsiOslSolverInterface.hpp"
    5154#endif
    5255
     
    596599#   else
    597600      solvers["dylp"] = 0 ;
     601#   endif
     602#   ifdef COIN_USE_OSL
     603#     ifndef CBC_DEFAULT_SOLVER
     604#       define CBC_DEFAULT_SOLVER "osl"
     605#     endif
     606      solvers["osl"] = new OsiOslSolverInterface  ;
     607#   else
     608      solvers["osl"] = 0 ;
    598609#   endif
    599610/*
  • trunk/Test/Makefile.solve

    r240 r246  
    5353
    5454#use clp
     55ifneq (,$(filter COIN_HAS_OSICLP, $(Define)))
     56#  add in USE
    5557CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
     58else
     59  $(error COIN_HAS_CLP is not defined in Makefiles/Makefile.location. Probably the line 'CoinLibsDefined += COIN_libClp' is commented out.)
     60endif
    5661
    5762#tell parameter handling to allow for CbcModel and OsiSolverInterface
  • trunk/Test/Makefile.test

    r107 r246  
    2727IncDir += ${OsiClpIncDir} ${ClpIncDir}
    2828#IncDir += ${OsiDylpIncDir} ${DylpIncDir}
     29IncDir += ${OsiOslIncDir} ${OslIncDir}
    2930IncDir += ${OsiIncDir} ${CoinIncDir}
    3031IncDir += ${bzlibIncDir} ${zlibIncDir} $(lapackIncDir)
     
    3435LibDir += ${OsiClpLibDir} ${ClpLibDir}
    3536#LibDir += ${OsiDylpLibDir} ${DylpLibDir}
     37LibDir += ${OsiOslLibDir} ${OslLibDir}
    3638LibDir += ${OsiLibDir} ${CoinLibDir}
    3739LibDir += ${bzlibLibDir} ${zlibLibDir} $(lapackLibDir)
     
    4446endif
    4547#LibName += ${OsiDylpLibName} ${DylpLibName}
     48LibName += ${OsiOslLibName} ${OslLibName}
    4649LibName += ${OsiLibName} ${CoinLibName}
    4750LibName += ${bzlibLibName} ${zlibLibName} $(lapackLibName) $(readlineLibName)
     
    5154Define += ${OsiClpDefine} ${ClpDefine}
    5255#Define += ${OsiDylpDefine} ${DylpDefine}
     56Define += ${OsiOslDefine} ${OslDefine}
    5357Define += ${OsiDefine} ${CoinDefine}
    5458Define += ${bzlibDefine} ${zlibDefine} $(lapackDefine)
     
    6569
    6670#use clp
     71ifneq (,$(filter COIN_HAS_OSICLP, $(Define)))
     72#  add in USE
    6773CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
     74endif
    6875
    6976#use dylp
    7077#CXXFLAGS += $(addprefix -D,COIN_USE_DYLP)
    7178#CXXFLAGS += $(addprefix -D,CBC_DEFAULT_SOLVER=\"dylp\")
     79
     80#use osl
     81ifneq (,$(filter COIN_HAS_OSIOSL, $(CXXFLAGS)))
     82CXXFLAGS += $(addprefix -D,COIN_USE_OSL)
     83endif
     84#CXXFLAGS += $(addprefix -D,CBC_DEFAULT_SOLVER=\"osl\")
    7285
    7386#tell parameter handling to allow for CbcModel and OsiSolverInterface
  • trunk/include/CbcModel.hpp

    r231 r246  
    33#ifndef CbcModel_H
    44#define CbcModel_H
    5 #ifndef COIN_USE_CLP
    6 #define COIN_USE_CLP
    7 #endif
    8 
    95#include <string>
    106#include <vector>
     
    1612#include "CbcCompareBase.hpp"
    1713#include "CbcMessage.hpp"
     14#ifdef COIN_USE_CLP
    1815#include "ClpEventHandler.hpp"
     16#endif
    1917
    2018//class OsiSolverInterface;
     
    12481246  inline int logLevel() const
    12491247  { return handler_->logLevel();};
     1248#ifdef COIN_USE_CLP
    12501249   /// Pass in Event handler (cloned and deleted at end)
    12511250   void passInEventHandler(const ClpEventHandler * eventHandler);
    12521251   /// Event handler
    12531252  ClpEventHandler * eventHandler() const;
     1253#endif
    12541254  //@}
    12551255  //---------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.