- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Alps-1.3.0/Clp/src/OsiClp/OsiClpSolverInterface.hpp

Go to the documentation of this file.

    00001 // $Id$
    00002 // Copyright (C) 2000, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
    00005
    00006
    00007 #ifndef OsiClpSolverInterface_H
    00008 #define OsiClpSolverInterface_H
    00009
    00010 #include <string>
    00011 #include <cfloat>
    00012 #include <map>
    00013
    00014 #include "ClpSimplex.hpp"
    00015 #include "ClpLinearObjective.hpp"
    00016 #include "CoinPackedMatrix.hpp"
    00017 #include "OsiSolverInterface.hpp"
    00018 #include "CoinWarmStartBasis.hpp"
    00019 #include "ClpEventHandler.hpp"
    00020 #include "ClpNode.hpp"
    00021 #include "CoinIndexedVector.hpp"
    00022 #include "CoinFinite.hpp"
    00023
    00024 class OsiRowCut;
    00025 class OsiClpUserSolver;
    00026 class OsiClpDisasterHandler;
    00027 class CoinSet;
    00028 static const double OsiClpInfinity = COIN_DBL_MAX;
    00029
    00030 //#############################################################################
    00031
    00038 class OsiClpSolverInterface :
    00039   virtual public OsiSolverInterface {
    00040   friend void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
    00041
    00042 public:
    00043   //---------------------------------------------------------------------------
    00046
    00047   virtual void initialSolve();
    00048
    00050   virtual void resolve();
    00051
    00053   virtual void resolveGub(int needed);
    00054
    00056   virtual void branchAndBound();
    00057
    00065   void crossover(int options,int basis);
    00067
    00083   virtual int canDoSimplexInterface() const;
    00084
    00093   virtual void enableFactorization() const;
    00094
    00096   virtual void disableFactorization() const;
    00097
    00102   virtual bool basisIsAvailable() const;
    00103
    00119   virtual void getBasisStatus(int* cstat, int* rstat) const;
    00120
    00131   virtual int setBasisStatus(const int* cstat, const int* rstat);
    00132
    00134   virtual void getReducedGradient(double* columnReducedCosts,
    00135                                   double * duals,
    00136                                   const double * c) const ;
    00137
    00139   virtual void getBInvARow(int row, double* z, double * slack=NULL) const;
    00140
    00145   virtual void getBInvARow(int row, CoinIndexedVector * z, CoinIndexedVector * slack=NULL,
    00146                            bool keepScaled=false) const;
    00147
    00149   virtual void getBInvRow(int row, double* z) const;
    00150
    00152   virtual void getBInvACol(int col, double* vec) const ;
    00153
    00155   virtual void getBInvACol(int col, CoinIndexedVector * vec) const ;
    00156
    00161   virtual void getBInvACol(CoinIndexedVector * vec) const ;
    00162
    00164   virtual void getBInvCol(int col, double* vec) const ;
    00165
    00170   virtual void getBasics(int* index) const;
    00171
    00178   virtual void enableSimplexInterface(bool doingPrimal);
    00179
    00181   virtual void disableSimplexInterface();
    00182
    00190   virtual int pivot(int colIn, int colOut, int outStatus);
    00191
    00203   virtual int primalPivotResult(int colIn, int sign,
    00204                                 int& colOut, int& outStatus,
    00205                                 double& t, CoinPackedVector* dx);
    00206
    00213   virtual int dualPivotResult(int& colIn, int& sign,
    00214                               int colOut, int outStatus,
    00215                               double& t, CoinPackedVector* dx);
    00216
    00217
    00219   //---------------------------------------------------------------------------
    00235   // Set an integer parameter
    00236   bool setIntParam(OsiIntParam key, int value);
    00237   // Set an double parameter
    00238   bool setDblParam(OsiDblParam key, double value);
    00239   // Set a string parameter
    00240   bool setStrParam(OsiStrParam key, const std::string & value);
    00241   // Get an integer parameter
    00242   bool getIntParam(OsiIntParam key, int& value) const;
    00243   // Get an double parameter
    00244   bool getDblParam(OsiDblParam key, double& value) const;
    00245   // Get a string parameter
    00246   bool getStrParam(OsiStrParam key, std::string& value) const;
    00247   // Set a hint parameter - overrides OsiSolverInterface
    00248   virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
    00249                             OsiHintStrength strength=OsiHintTry,
    00250                             void * otherInformation=NULL);
    00252
    00253   //---------------------------------------------------------------------------
    00255
    00256
    00257   virtual bool isAbandoned() const;
    00259   virtual bool isProvenOptimal() const;
    00261   virtual bool isProvenPrimalInfeasible() const;
    00263   virtual bool isProvenDualInfeasible() const;
    00265   virtual bool isPrimalObjectiveLimitReached() const;
    00267   virtual bool isDualObjectiveLimitReached() const;
    00269   virtual bool isIterationLimitReached() const;
    00271
    00272   //---------------------------------------------------------------------------
    00275
    00283   virtual CoinWarmStart *getEmptyWarmStart () const;
    00284
    00286   virtual CoinWarmStart* getWarmStart() const;
    00288   inline CoinWarmStartBasis* getPointerToWarmStart()
    00289   { return &basis_;}
    00291   inline const CoinWarmStartBasis* getConstPointerToWarmStart() const
    00292   { return &basis_;}
    00295   virtual bool setWarmStart(const CoinWarmStart* warmstart);
    00305   virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ;
    00306
    00308
    00309   //---------------------------------------------------------------------------
    00316
    00317   virtual void markHotStart();
    00319   virtual void solveFromHotStart();
    00321   virtual void unmarkHotStart();
    00330   int startFastDual(int options);
    00332   void stopFastDual();
    00334   void setStuff(double tolerance,double increment);
    00336
    00337   //---------------------------------------------------------------------------
    00352
    00353   virtual int getNumCols() const {
    00354     return modelPtr_->numberColumns(); }
    00355
    00357   virtual int getNumRows() const {
    00358     return modelPtr_->numberRows(); }
    00359
    00361   virtual int getNumElements() const {
    00362     int retVal = 0;
    00363     const CoinPackedMatrix * matrix =modelPtr_->matrix();
    00364     if ( matrix != NULL ) retVal=matrix->getNumElements();
    00365     return retVal; }
    00366
    00369     virtual std::string getRowName(int rowIndex,
    00370                                    unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
    00371
    00374     virtual std::string getColName(int colIndex,
    00375                                    unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
    00376
    00377
    00379   virtual const double * getColLower() const { return modelPtr_->columnLower(); }
    00380
    00382   virtual const double * getColUpper() const { return modelPtr_->columnUpper(); }
    00383
    00393   virtual const char * getRowSense() const;
    00394
    00403   virtual const double * getRightHandSide() const ;
    00404
    00413   virtual const double * getRowRange() const ;
    00414
    00416   virtual const double * getRowLower() const { return modelPtr_->rowLower(); }
    00417
    00419   virtual const double * getRowUpper() const { return modelPtr_->rowUpper(); }
    00420
    00422   virtual const double * getObjCoefficients() const
    00423   { if (fakeMinInSimplex_)
    00424       return linearObjective_ ;
    00425     else
    00426       return modelPtr_->objective(); }
    00427
    00429   virtual double getObjSense() const
    00430   { return ((fakeMinInSimplex_)?-modelPtr_->optimizationDirection():
    00431                                  modelPtr_->optimizationDirection()); }
    00432
    00434   virtual bool isContinuous(int colNumber) const;
    00436   virtual bool isBinary(int colIndex) const;
    00437
    00442   virtual bool isInteger(int colIndex) const;
    00443
    00445   virtual bool isIntegerNonBinary(int colIndex) const;
    00446
    00448   virtual bool isFreeBinary(int colIndex) const;
    00454   virtual const char * getColType(bool refresh=false) const;
    00455
    00461   bool isOptionalInteger(int colIndex) const;
    00463   void setOptionalInteger(int index);
    00464
    00466   virtual const CoinPackedMatrix * getMatrixByRow() const;
    00467
    00469   virtual const CoinPackedMatrix * getMatrixByCol() const;
    00470
    00472   virtual CoinPackedMatrix * getMutableMatrixByCol() const;
    00473
    00475   virtual double getInfinity() const { return OsiClpInfinity; }
    00477
    00480
    00481   virtual const double * getColSolution() const;
    00482
    00484   virtual const double * getRowPrice() const;
    00485
    00487   virtual const double * getReducedCost() const;
    00488
    00491   virtual const double * getRowActivity() const;
    00492
    00494   virtual double getObjValue() const;
    00495
    00498   virtual int getIterationCount() const
    00499   { return modelPtr_->numberIterations(); }
    00500
    00518   virtual std::vector<double*> getDualRays(int maxNumRays,
    00519                                            bool fullRay = false) const;
    00531   virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
    00532
    00534
    00535
    00536   //---------------------------------------------------------------------------
    00537
    00540   //-------------------------------------------------------------------------
    00544   virtual void setObjCoeff( int elementIndex, double elementValue );
    00545
    00548   virtual void setColLower( int elementIndex, double elementValue );
    00549
    00552   virtual void setColUpper( int elementIndex, double elementValue );
    00553
    00555   virtual void setColBounds( int elementIndex,
    00556                              double lower, double upper );
    00557
    00566   virtual void setColSetBounds(const int* indexFirst,
    00567                                const int* indexLast,
    00568                                const double* boundList);
    00569
    00572   virtual void setRowLower( int elementIndex, double elementValue );
    00573
    00576   virtual void setRowUpper( int elementIndex, double elementValue ) ;
    00577
    00579   virtual void setRowBounds( int elementIndex,
    00580                              double lower, double upper ) ;
    00581
    00583   virtual void setRowType(int index, char sense, double rightHandSide,
    00584                           double range);
    00585
    00594   virtual void setRowSetBounds(const int* indexFirst,
    00595                                const int* indexLast,
    00596                                const double* boundList);
    00597
    00608   virtual void setRowSetTypes(const int* indexFirst,
    00609                               const int* indexLast,
    00610                               const char* senseList,
    00611                               const double* rhsList,
    00612                               const double* rangeList);
    00617     virtual void setObjective(const double * array);
    00618
    00623     virtual void setColLower(const double * array);
    00624
    00629     virtual void setColUpper(const double * array);
    00630
    00631 //    using OsiSolverInterface::setRowName ;
    00633 //    virtual void setRowName(int rowIndex, std::string & name) ;
    00634     virtual void setRowName(int rowIndex, std::string  name) ;
    00635
    00636 //    using OsiSolverInterface::setColName ;
    00638 //    virtual void setColName(int colIndex, std::string & name) ;
    00639     virtual void setColName(int colIndex, std::string  name) ;
    00640
    00642
    00643   //-------------------------------------------------------------------------
    00647   virtual void setContinuous(int index);
    00649   virtual void setInteger(int index);
    00652   virtual void setContinuous(const int* indices, int len);
    00655   virtual void setInteger(const int* indices, int len);
    00657   inline int numberSOS() const
    00658   { return numberSOS_;}
    00660   inline const CoinSet * setInfo() const
    00661   { return setInfo_;}
    00671   virtual int findIntegersAndSOS(bool justCount);
    00673
    00674   //-------------------------------------------------------------------------
    00676   virtual void setObjSense(double s )
    00677   { modelPtr_->setOptimizationDirection( s < 0 ? -1 : 1); }
    00678
    00689   virtual void setColSolution(const double * colsol);
    00690
    00701   virtual void setRowPrice(const double * rowprice);
    00702
    00703   //-------------------------------------------------------------------------
    00708
    00709   //using OsiSolverInterface::addCol ;
    00711   virtual void addCol(const CoinPackedVectorBase& vec,
    00712                       const double collb, const double colub,
    00713                       const double obj);
    00716   virtual void addCol(const CoinPackedVectorBase& vec,
    00717                       const double collb, const double colub,
    00718                       const double obj, std::string name) ;
    00720   virtual void addCol(int numberElements, const int * rows, const double * elements,
    00721                       const double collb, const double colub,
    00722                       const double obj) ;
    00725   virtual void addCol(int numberElements,
    00726                       const int* rows, const double* elements,
    00727                       const double collb, const double colub,
    00728                       const double obj, std::string name) ;
    00730   virtual void addCols(const int numcols,
    00731                        const CoinPackedVectorBase * const * cols,
    00732                        const double* collb, const double* colub,
    00733                        const double* obj);
    00735   virtual void addCols(const int numcols,
    00736                        const int * columnStarts, const int * rows, const double * elements,
    00737                        const double* collb, const double* colub,
    00738                        const double* obj);
    00740   virtual void deleteCols(const int num, const int * colIndices);
    00741
    00743   virtual void addRow(const CoinPackedVectorBase& vec,
    00744                       const double rowlb, const double rowub);
    00751     virtual void addRow(const CoinPackedVectorBase& vec,
    00752                         const double rowlb, const double rowub,
    00753                         std::string name) ;
    00754   virtual void addRow(const CoinPackedVectorBase& vec,
    00755                       const char rowsen, const double rowrhs,
    00756                       const double rowrng);
    00758   virtual void addRow(int numberElements, const int * columns, const double * element,
    00759                       const double rowlb, const double rowub) ;
    00762     virtual void addRow(const CoinPackedVectorBase& vec,
    00763                         const char rowsen, const double rowrhs,
    00764                         const double rowrng, std::string name) ;
    00766   virtual void addRows(const int numrows,
    00767                        const CoinPackedVectorBase * const * rows,
    00768                        const double* rowlb, const double* rowub);
    00770   virtual void addRows(const int numrows,
    00771                        const CoinPackedVectorBase * const * rows,
    00772                        const char* rowsen, const double* rowrhs,
    00773                        const double* rowrng);
    00774
    00776   virtual void addRows(const int numrows,
    00777                        const int * rowStarts, const int * columns, const double * element,
    00778                        const double* rowlb, const double* rowub);
    00780   void modifyCoefficient(int row, int column, double newElement,
    00781                         bool keepZero=false)
    00782         {modelPtr_->modifyCoefficient(row,column,newElement, keepZero);}
    00783
    00785   virtual void deleteRows(const int num, const int * rowIndices);
    00788   virtual void saveBaseModel() ;
    00792   virtual void restoreBaseModel(int numberRows);
    00793
    00794   //-----------------------------------------------------------------------
    00798   virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
    00803   virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
    00826     virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
    00827                                           double effectivenessLb = 0.0);
    00828
    00830
    00831
    00832   //---------------------------------------------------------------------------
    00833
    00834 public:
    00835
    00849   virtual void loadProblem(const CoinPackedMatrix& matrix,
    00850                            const double* collb, const double* colub,
    00851                            const double* obj,
    00852                            const double* rowlb, const double* rowub);
    00853
    00861   virtual void assignProblem(CoinPackedMatrix*& matrix,
    00862                              double*& collb, double*& colub, double*& obj,
    00863                              double*& rowlb, double*& rowub);
    00864
    00877   virtual void loadProblem(const CoinPackedMatrix& matrix,
    00878                            const double* collb, const double* colub,
    00879                            const double* obj,
    00880                            const char* rowsen, const double* rowrhs,
    00881                            const double* rowrng);
    00882
    00890   virtual void assignProblem(CoinPackedMatrix*& matrix,
    00891                              double*& collb, double*& colub, double*& obj,
    00892                              char*& rowsen, double*& rowrhs,
    00893                              double*& rowrng);
    00894
    00897   virtual void loadProblem(const int numcols, const int numrows,
    00898                            const CoinBigIndex * start, const int* index,
    00899                            const double* value,
    00900                            const double* collb, const double* colub,
    00901                            const double* obj,
    00902                            const double* rowlb, const double* rowub);
    00903
    00906   virtual void loadProblem(const int numcols, const int numrows,
    00907                            const CoinBigIndex * start, const int* index,
    00908                            const double* value,
    00909                            const double* collb, const double* colub,
    00910                            const double* obj,
    00911                            const char* rowsen, const double* rowrhs,
    00912                            const double* rowrng);
    00914   virtual int loadFromCoinModel (  CoinModel & modelObject, bool keepSolution=false);
    00915
    00916   using OsiSolverInterface::readMps ;
    00919   virtual int readMps(const char *filename,
    00920                       const char *extension = "mps") ;
    00923   int readMps(const char *filename,bool keepNames,bool allowErrors);
    00925   virtual int readMps (const char *filename, const char*extension,
    00926                         int & numberSets, CoinSet ** & sets);
    00927
    00932   virtual void writeMps(const char *filename,
    00933                         const char *extension = "mps",
    00934                         double objSense=0.0) const;
    00943   virtual int writeMpsNative(const char *filename,
    00944                              const char ** rowNames, const char ** columnNames,
    00945                              int formatType=0,int numberAcross=2,
    00946                              double objSense=0.0) const ;
    00948   virtual int readLp(const char *filename, const double epsilon = 1e-5);
    00954   virtual void writeLp(const char *filename,
    00955                        const char *extension = "lp",
    00956                        double epsilon = 1e-5,
    00957                        int numberAcross = 10,
    00958                        int decimals = 5,
    00959                        double objSense = 0.0,
    00960                        bool useRowNames = true) const;
    00965   virtual void writeLp(FILE *fp,
    00966                double epsilon = 1e-5,
    00967                int numberAcross = 10,
    00968                int decimals = 5,
    00969                double objSense = 0.0,
    00970                bool useRowNames = true) const;
    00976   virtual void replaceMatrixOptional(const CoinPackedMatrix & matrix);
    00978   virtual void replaceMatrix(const CoinPackedMatrix & matrix) ;
    00980
    00991   virtual void passInMessageHandler(CoinMessageHandler * handler);
    00993   void newLanguage(CoinMessages::Language language);
    00994   void setLanguage(CoinMessages::Language language)
    00995   {newLanguage(language);}
    00997   void setLogLevel(int value);
    00999   void generateCpp( FILE * fp);
    01001   //---------------------------------------------------------------------------
    01002
    01005
    01006   ClpSimplex * getModelPtr() const ;
    01008   inline ClpSimplex * swapModelPtr(ClpSimplex * newModel)
    01009   { ClpSimplex * model = modelPtr_; modelPtr_=newModel;return model;}
    01011   inline unsigned int specialOptions() const
    01012   { return specialOptions_;}
    01013   void setSpecialOptions(unsigned int value);
    01015   inline int lastAlgorithm() const
    01016   { return lastAlgorithm_;}
    01018   inline void setLastAlgorithm(int value)
    01019   { lastAlgorithm_ = value;}
    01021   inline int cleanupScaling() const
    01022   { return cleanupScaling_;}
    01035   inline void setCleanupScaling(int value)
    01036   { cleanupScaling_=value;}
    01039   inline double smallestElementInCut() const
    01040   { return smallestElementInCut_;}
    01043   inline void setSmallestElementInCut(double value)
    01044   { smallestElementInCut_=value;}
    01051   inline double smallestChangeInCut() const
    01052   { return smallestChangeInCut_;}
    01059   inline void setSmallestChangeInCut(double value)
    01060   { smallestChangeInCut_=value;}
    01062   inline void setSolveOptions(const ClpSolve & options)
    01063   { solveOptions_ = options;}
    01067   virtual int tightenBounds(int lightweight=0);
    01069   virtual CoinBigIndex getSizeL() const;
    01071   virtual CoinBigIndex getSizeU() const;
    01073   const OsiClpDisasterHandler * disasterHandler() const
    01074   { return disasterHandler_;}
    01076   void passInDisasterHandler(OsiClpDisasterHandler * handler);
    01078   ClpLinearObjective * fakeObjective() const
    01079   { return fakeObjective_;}
    01081   void setFakeObjective(ClpLinearObjective * fakeObjective);
    01083   void setFakeObjective(double * fakeObjective);
    01103   void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0);
    01105   virtual void synchronizeModel();
    01110   void setSpecialOptionsMutable(unsigned int value) const;
    01111
    01113
    01114   //---------------------------------------------------------------------------
    01115
    01118
    01119   OsiClpSolverInterface ();
    01120
    01122   virtual OsiSolverInterface * clone(bool copyData = true) const;
    01123
    01125   OsiClpSolverInterface (const OsiClpSolverInterface &);
    01126
    01128   OsiClpSolverInterface (ClpSimplex * rhs, bool reallyOwn=false);
    01129
    01131   void releaseClp();
    01132
    01134   OsiClpSolverInterface & operator=(const OsiClpSolverInterface& rhs);
    01135
    01137   virtual ~OsiClpSolverInterface ();
    01138
    01140   virtual void reset();
    01142
    01143   //---------------------------------------------------------------------------
    01144
    01145 protected:
    01147
    01148
    01149   virtual void applyRowCut(const OsiRowCut& rc);
    01150
    01152   virtual void applyColCut(const OsiColCut& cc);
    01154
    01155   //---------------------------------------------------------------------------
    01156
    01157 protected:
    01160
    01161   void gutsOfDestructor();
    01162
    01164   void freeCachedResults() const;
    01165
    01167   void freeCachedResults0() const;
    01168
    01170   void freeCachedResults1() const;
    01171
    01173   void extractSenseRhsRange() const;
    01174
    01176   void fillParamMaps();
    01185   CoinWarmStartBasis getBasis(ClpSimplex * model) const;
    01194   void setBasis( const CoinWarmStartBasis & basis, ClpSimplex * model);
    01196   void crunch();
    01198   void redoScaleFactors(int numberRows,const CoinBigIndex * starts,
    01199                         const int * indices, const double * elements);
    01200 public:
    01203   void setBasis( const CoinWarmStartBasis & basis);
    01205   inline void setBasis( )
    01206   { setBasis(basis_,modelPtr_);}
    01208   CoinWarmStartDiff * getBasisDiff(const unsigned char * statusArray) const ;
    01210   CoinWarmStartBasis * getBasis(const unsigned char * statusArray) const ;
    01212   void deleteScaleFactors();
    01214   inline const double * upRange() const
    01215   { return rowActivity_;}
    01216   inline const double * downRange() const
    01217   { return columnActivity_;}
    01219   inline void passInRanges(int * array)
    01220   { whichRange_=array;}
    01222   void setSOSData(int numberSOS,const char * type,
    01223                   const int * start,const int * indices, const double * weights=NULL);
    01225   void computeLargestAway();
    01227   inline double largestAway() const
    01228   { return largestAway_;}
    01230   inline void setLargestAway(double value)
    01231   { largestAway_ = value;}
    01233   void lexSolve();
    01235
    01236 protected:
    01239
    01240   mutable ClpSimplex * modelPtr_;
    01242
    01244
    01245   mutable char    *rowsense_;
    01246
    01248   mutable double  *rhs_;
    01249
    01253   mutable double  *rowrange_;
    01254
    01257   mutable CoinWarmStartBasis* ws_;
    01260   mutable double * rowActivity_;
    01261   mutable double * columnActivity_;
    01263   ClpNodeStuff stuff_;
    01265   int numberSOS_;
    01267   CoinSet * setInfo_;
    01269   ClpSimplex * smallModel_;
    01271   ClpFactorization * factorization_;
    01274   double smallestElementInCut_;
    01278   double smallestChangeInCut_;
    01280   double largestAway_;
    01282   char * spareArrays_;
    01284   CoinWarmStartBasis basis_;
    01286   int itlimOrig_;
    01287
    01298   mutable int lastAlgorithm_;
    01299
    01301   bool notOwned_;
    01302
    01304   mutable CoinPackedMatrix *matrixByRow_;
    01305
    01307   CoinPackedMatrix *matrixByRowAtContinuous_;
    01308
    01310   char * integerInformation_;
    01311
    01316   int * whichRange_;
    01317
    01318   //std::map<OsiIntParam, ClpIntParam> intParamMap_;
    01319   //std::map<OsiDblParam, ClpDblParam> dblParamMap_;
    01320   //std::map<OsiStrParam, ClpStrParam> strParamMap_;
    01321
    01323   mutable bool fakeMinInSimplex_ ;
    01330   mutable double *linearObjective_;
    01331
    01333   mutable ClpDataSave saveData_;
    01335   ClpSolve solveOptions_;
    01348   int cleanupScaling_;
    01376   mutable unsigned int specialOptions_;
    01378   ClpSimplex * baseModel_;
    01380   int lastNumberRows_;
    01382   ClpSimplex * continuousModel_;
    01384   OsiClpDisasterHandler * disasterHandler_ ;
    01386   ClpLinearObjective * fakeObjective_;
    01388   CoinDoubleArrayWithLength rowScale_;
    01390   CoinDoubleArrayWithLength columnScale_;
    01392 };
    01393
    01394 class OsiClpDisasterHandler : public ClpDisasterHandler {
    01395 public:
    01399
    01400   virtual void intoSimplex();
    01402   virtual bool check() const ;
    01404   virtual void saveInfo();
    01406   virtual int typeOfDisaster();
    01408
    01409
    01414   OsiClpDisasterHandler(OsiClpSolverInterface * model = NULL);
    01416   virtual ~OsiClpDisasterHandler();
    01417   // Copy
    01418   OsiClpDisasterHandler(const OsiClpDisasterHandler&);
    01419   // Assignment
    01420   OsiClpDisasterHandler& operator=(const OsiClpDisasterHandler&);
    01422   virtual ClpDisasterHandler * clone() const;
    01423
    01425
    01430   void setOsiModel(OsiClpSolverInterface * model);
    01432   inline OsiClpSolverInterface * osiModel() const
    01433   { return osiModel_;}
    01435   inline void setWhereFrom(int value)
    01436   { whereFrom_=value;}
    01438   inline int whereFrom() const
    01439   { return whereFrom_;}
    01441   inline void setPhase(int value)
    01442   { phase_=value;}
    01444   inline int phase() const
    01445   { return phase_;}
    01447   inline bool inTrouble() const
    01448   { return inTrouble_;}
    01449
    01451
    01452
    01453 protected:
    01457
    01458   OsiClpSolverInterface * osiModel_;
    01466   int whereFrom_;
    01474   int phase_;
    01476   bool inTrouble_;
    01478 };
    01479 // So unit test can find out if NDEBUG set
    01480 bool OsiClpHasNDEBUG();
    01481 //#############################################################################
    01483 void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
    01484 #endif