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

- File List
- File Members

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

Go to the documentation of this file.

    00001 // Copyright (C) 2000, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003
    00004 #ifndef OsiClpSolverInterface_H
    00005 #define OsiClpSolverInterface_H
    00006
    00007 #include <string>
    00008 #include <cfloat>
    00009 #include <map>
    00010
    00011 #include "ClpSimplex.hpp"
    00012 #include "ClpLinearObjective.hpp"
    00013 #include "CoinPackedMatrix.hpp"
    00014 #include "OsiSolverInterface.hpp"
    00015 #include "CoinWarmStartBasis.hpp"
    00016 #include "ClpEventHandler.hpp"
    00017 #include "ClpNode.hpp"
    00018 #include "CoinIndexedVector.hpp"
    00019
    00020 class OsiRowCut;
    00021 class OsiClpUserSolver;
    00022 class OsiClpDisasterHandler;
    00023 class CoinSet;
    00024 #ifndef COIN_DBL_MAX
    00025 static const double OsiClpInfinity = DBL_MAX;
    00026 #else
    00027 static const double OsiClpInfinity = COIN_DBL_MAX;
    00028 #endif
    00029
    00030 //#############################################################################
    00031
    00038 class OsiClpSolverInterface :
    00039   virtual public OsiSolverInterface {
    00040   friend int 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 branchAndBound();
    00054
    00062   void crossover(int options,int basis);
    00064
    00080   virtual int canDoSimplexInterface() const;
    00081
    00090   virtual void enableFactorization() const;
    00091
    00093   virtual void disableFactorization() const;
    00094
    00099   virtual bool basisIsAvailable() const;
    00100
    00116   virtual void getBasisStatus(int* cstat, int* rstat) const;
    00117
    00128   virtual int setBasisStatus(const int* cstat, const int* rstat);
    00129
    00131   virtual void getReducedGradient(double* columnReducedCosts,
    00132                                   double * duals,
    00133                                   const double * c) const ;
    00134
    00136   virtual void getBInvARow(int row, double* z, double * slack=NULL) const;
    00137
    00142   virtual void getBInvARow(int row, CoinIndexedVector * z, CoinIndexedVector * slack=NULL,
    00143                            bool keepScaled=false) const;
    00144
    00146   virtual void getBInvRow(int row, double* z) const;
    00147
    00149   virtual void getBInvACol(int col, double* vec) const ;
    00150
    00152   virtual void getBInvACol(int col, CoinIndexedVector * vec) const ;
    00153
    00158   virtual void getBInvACol(CoinIndexedVector * vec) const ;
    00159
    00161   virtual void getBInvCol(int col, double* vec) const ;
    00162
    00167   virtual void getBasics(int* index) const;
    00168
    00175   virtual void enableSimplexInterface(bool doingPrimal);
    00176
    00178   virtual void disableSimplexInterface();
    00179
    00187   virtual int pivot(int colIn, int colOut, int outStatus);
    00188
    00200   virtual int primalPivotResult(int colIn, int sign,
    00201                                 int& colOut, int& outStatus,
    00202                                 double& t, CoinPackedVector* dx);
    00203
    00210   virtual int dualPivotResult(int& colIn, int& sign,
    00211                               int colOut, int outStatus,
    00212                               double& t, CoinPackedVector* dx);
    00213
    00214
    00216   //---------------------------------------------------------------------------
    00232   // Set an integer parameter
    00233   bool setIntParam(OsiIntParam key, int value);
    00234   // Set an double parameter
    00235   bool setDblParam(OsiDblParam key, double value);
    00236   // Set a string parameter
    00237   bool setStrParam(OsiStrParam key, const std::string & value);
    00238   // Get an integer parameter
    00239   bool getIntParam(OsiIntParam key, int& value) const;
    00240   // Get an double parameter
    00241   bool getDblParam(OsiDblParam key, double& value) const;
    00242   // Get a string parameter
    00243   bool getStrParam(OsiStrParam key, std::string& value) const;
    00244   // Set a hint parameter - overrides OsiSolverInterface
    00245   virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
    00246                             OsiHintStrength strength=OsiHintTry,
    00247                             void * otherInformation=NULL);
    00249
    00250   //---------------------------------------------------------------------------
    00252
    00253
    00254   virtual bool isAbandoned() const;
    00256   virtual bool isProvenOptimal() const;
    00258   virtual bool isProvenPrimalInfeasible() const;
    00260   virtual bool isProvenDualInfeasible() const;
    00262   virtual bool isPrimalObjectiveLimitReached() const;
    00264   virtual bool isDualObjectiveLimitReached() const;
    00266   virtual bool isIterationLimitReached() const;
    00268
    00269   //---------------------------------------------------------------------------
    00272
    00280   virtual CoinWarmStart *getEmptyWarmStart () const;
    00281
    00283   virtual CoinWarmStart* getWarmStart() const;
    00285   inline CoinWarmStartBasis* getPointerToWarmStart()
    00286   { return &basis_;}
    00288   inline const CoinWarmStartBasis* getConstPointerToWarmStart() const
    00289   { return &basis_;}
    00292   virtual bool setWarmStart(const CoinWarmStart* warmstart);
    00302   virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ;
    00303
    00305
    00306   //---------------------------------------------------------------------------
    00313
    00314   virtual void markHotStart();
    00316   virtual void solveFromHotStart();
    00318   virtual void unmarkHotStart();
    00327   int startFastDual(int options);
    00329   void stopFastDual();
    00331   void setStuff(double tolerance,double increment);
    00333
    00334   //---------------------------------------------------------------------------
    00349
    00350   virtual int getNumCols() const {
    00351     return modelPtr_->numberColumns(); }
    00352
    00354   virtual int getNumRows() const {
    00355     return modelPtr_->numberRows(); }
    00356
    00358   virtual int getNumElements() const {
    00359     int retVal = 0;
    00360     const CoinPackedMatrix * matrix =modelPtr_->matrix();
    00361     if ( matrix != NULL ) retVal=matrix->getNumElements();
    00362     return retVal; }
    00363
    00366     virtual std::string getRowName(int rowIndex,
    00367                                    unsigned maxLen = std::string::npos) const;
    00368
    00371     virtual std::string getColName(int colIndex,
    00372                                    unsigned maxLen = std::string::npos) const;
    00373
    00374
    00376   virtual const double * getColLower() const { return modelPtr_->columnLower(); }
    00377
    00379   virtual const double * getColUpper() const { return modelPtr_->columnUpper(); }
    00380
    00390   virtual const char * getRowSense() const;
    00391
    00400   virtual const double * getRightHandSide() const ;
    00401
    00410   virtual const double * getRowRange() const ;
    00411
    00413   virtual const double * getRowLower() const { return modelPtr_->rowLower(); }
    00414
    00416   virtual const double * getRowUpper() const { return modelPtr_->rowUpper(); }
    00417
    00419   virtual const double * getObjCoefficients() const
    00420   { if (fakeMinInSimplex_)
    00421       return linearObjective_ ;
    00422     else
    00423       return modelPtr_->objective(); }
    00424
    00426   virtual double getObjSense() const
    00427   { return ((fakeMinInSimplex_)?-modelPtr_->optimizationDirection():
    00428                                  modelPtr_->optimizationDirection()); }
    00429
    00431   virtual bool isContinuous(int colNumber) const;
    00433   virtual bool isBinary(int colIndex) const;
    00434
    00439   virtual bool isInteger(int colIndex) const;
    00440
    00442   virtual bool isIntegerNonBinary(int colIndex) const;
    00443
    00445   virtual bool isFreeBinary(int colIndex) const;
    00451   virtual const char * getColType(bool refresh=false) const;
    00452
    00458   bool isOptionalInteger(int colIndex) const;
    00460   void setOptionalInteger(int index);
    00461
    00463   virtual const CoinPackedMatrix * getMatrixByRow() const;
    00464
    00466   virtual const CoinPackedMatrix * getMatrixByCol() const;
    00467
    00469   virtual CoinPackedMatrix * getMutableMatrixByCol() const;
    00470
    00472   virtual double getInfinity() const { return OsiClpInfinity; }
    00474
    00477
    00478   virtual const double * getColSolution() const;
    00479
    00481   virtual const double * getRowPrice() const;
    00482
    00484   virtual const double * getReducedCost() const;
    00485
    00488   virtual const double * getRowActivity() const;
    00489
    00491   virtual double getObjValue() const;
    00492
    00495   virtual int getIterationCount() const
    00496   { return modelPtr_->numberIterations(); }
    00497
    00515   virtual std::vector<double*> getDualRays(int maxNumRays,
    00516                                            bool fullRay = false) const;
    00528   virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
    00529
    00531
    00532
    00533   //---------------------------------------------------------------------------
    00534
    00537   //-------------------------------------------------------------------------
    00541   virtual void setObjCoeff( int elementIndex, double elementValue );
    00542
    00545   virtual void setColLower( int elementIndex, double elementValue );
    00546
    00549   virtual void setColUpper( int elementIndex, double elementValue );
    00550
    00552   virtual void setColBounds( int elementIndex,
    00553                              double lower, double upper );
    00554
    00563   virtual void setColSetBounds(const int* indexFirst,
    00564                                const int* indexLast,
    00565                                const double* boundList);
    00566
    00569   virtual void setRowLower( int elementIndex, double elementValue );
    00570
    00573   virtual void setRowUpper( int elementIndex, double elementValue ) ;
    00574
    00576   virtual void setRowBounds( int elementIndex,
    00577                              double lower, double upper ) ;
    00578
    00580   virtual void setRowType(int index, char sense, double rightHandSide,
    00581                           double range);
    00582
    00591   virtual void setRowSetBounds(const int* indexFirst,
    00592                                const int* indexLast,
    00593                                const double* boundList);
    00594
    00605   virtual void setRowSetTypes(const int* indexFirst,
    00606                               const int* indexLast,
    00607                               const char* senseList,
    00608                               const double* rhsList,
    00609                               const double* rangeList);
    00614     virtual void setObjective(const double * array);
    00615
    00620     virtual void setColLower(const double * array);
    00621
    00626     virtual void setColUpper(const double * array);
    00627
    00628 //    using OsiSolverInterface::setRowName ;
    00630 //    virtual void setRowName(int rowIndex, std::string & name) ;
    00631     virtual void setRowName(int rowIndex, std::string  name) ;
    00632
    00633 //    using OsiSolverInterface::setColName ;
    00635 //    virtual void setColName(int colIndex, std::string & name) ;
    00636     virtual void setColName(int colIndex, std::string  name) ;
    00637
    00639
    00640   //-------------------------------------------------------------------------
    00644   virtual void setContinuous(int index);
    00646   virtual void setInteger(int index);
    00649   virtual void setContinuous(const int* indices, int len);
    00652   virtual void setInteger(const int* indices, int len);
    00654   inline int numberSOS() const
    00655   { return numberSOS_;}
    00657   inline const CoinSet * setInfo() const
    00658   { return setInfo_;}
    00668   virtual int findIntegersAndSOS(bool justCount);
    00670
    00671   //-------------------------------------------------------------------------
    00673   virtual void setObjSense(double s )
    00674   { modelPtr_->setOptimizationDirection( s < 0 ? -1 : 1); }
    00675
    00686   virtual void setColSolution(const double * colsol);
    00687
    00698   virtual void setRowPrice(const double * rowprice);
    00699
    00700   //-------------------------------------------------------------------------
    00705
    00706   //using OsiSolverInterface::addCol ;
    00708   virtual void addCol(const CoinPackedVectorBase& vec,
    00709                       const double collb, const double colub,
    00710                       const double obj);
    00713   virtual void addCol(const CoinPackedVectorBase& vec,
    00714                       const double collb, const double colub,
    00715                       const double obj, std::string name) ;
    00717   virtual void addCol(int numberElements, const int * rows, const double * elements,
    00718                       const double collb, const double colub,
    00719                       const double obj) ;
    00722   virtual void addCol(int numberElements,
    00723                       const int* rows, const double* elements,
    00724                       const double collb, const double colub,
    00725                       const double obj, std::string name) ;
    00727   virtual void addCols(const int numcols,
    00728                        const CoinPackedVectorBase * const * cols,
    00729                        const double* collb, const double* colub,
    00730                        const double* obj);
    00732   virtual void addCols(const int numcols,
    00733                        const int * columnStarts, const int * rows, const double * elements,
    00734                        const double* collb, const double* colub,
    00735                        const double* obj);
    00737   virtual void deleteCols(const int num, const int * colIndices);
    00738
    00740   virtual void addRow(const CoinPackedVectorBase& vec,
    00741                       const double rowlb, const double rowub);
    00748     virtual void addRow(const CoinPackedVectorBase& vec,
    00749                         const double rowlb, const double rowub,
    00750                         std::string name) ;
    00751   virtual void addRow(const CoinPackedVectorBase& vec,
    00752                       const char rowsen, const double rowrhs,
    00753                       const double rowrng);
    00755   virtual void addRow(int numberElements, const int * columns, const double * element,
    00756                       const double rowlb, const double rowub) ;
    00759     virtual void addRow(const CoinPackedVectorBase& vec,
    00760                         const char rowsen, const double rowrhs,
    00761                         const double rowrng, std::string name) ;
    00763   virtual void addRows(const int numrows,
    00764                        const CoinPackedVectorBase * const * rows,
    00765                        const double* rowlb, const double* rowub);
    00767   virtual void addRows(const int numrows,
    00768                        const CoinPackedVectorBase * const * rows,
    00769                        const char* rowsen, const double* rowrhs,
    00770                        const double* rowrng);
    00771
    00773   virtual void addRows(const int numrows,
    00774                        const int * rowStarts, const int * columns, const double * element,
    00775                        const double* rowlb, const double* rowub);
    00777   void modifyCoefficient(int row, int column, double newElement,
    00778                         bool keepZero=false)
    00779         {modelPtr_->modifyCoefficient(row,column,newElement, keepZero);}
    00780
    00782   virtual void deleteRows(const int num, const int * rowIndices);
    00785   virtual void saveBaseModel() ;
    00789   virtual void restoreBaseModel(int numberRows);
    00790
    00791   //-----------------------------------------------------------------------
    00795   virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
    00800   virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
    00823     virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
    00824                                           double effectivenessLb = 0.0);
    00825
    00827
    00828
    00829   //---------------------------------------------------------------------------
    00830
    00831 public:
    00832
    00846   virtual void loadProblem(const CoinPackedMatrix& matrix,
    00847                            const double* collb, const double* colub,
    00848                            const double* obj,
    00849                            const double* rowlb, const double* rowub);
    00850
    00858   virtual void assignProblem(CoinPackedMatrix*& matrix,
    00859                              double*& collb, double*& colub, double*& obj,
    00860                              double*& rowlb, double*& rowub);
    00861
    00874   virtual void loadProblem(const CoinPackedMatrix& matrix,
    00875                            const double* collb, const double* colub,
    00876                            const double* obj,
    00877                            const char* rowsen, const double* rowrhs,
    00878                            const double* rowrng);
    00879
    00887   virtual void assignProblem(CoinPackedMatrix*& matrix,
    00888                              double*& collb, double*& colub, double*& obj,
    00889                              char*& rowsen, double*& rowrhs,
    00890                              double*& rowrng);
    00891
    00894   virtual void loadProblem(const int numcols, const int numrows,
    00895                            const CoinBigIndex * start, const int* index,
    00896                            const double* value,
    00897                            const double* collb, const double* colub,
    00898                            const double* obj,
    00899                            const double* rowlb, const double* rowub);
    00900
    00903   virtual void loadProblem(const int numcols, const int numrows,
    00904                            const CoinBigIndex * start, const int* index,
    00905                            const double* value,
    00906                            const double* collb, const double* colub,
    00907                            const double* obj,
    00908                            const char* rowsen, const double* rowrhs,
    00909                            const double* rowrng);
    00911   virtual int loadFromCoinModel (  CoinModel & modelObject, bool keepSolution=false);
    00912
    00913   using OsiSolverInterface::readMps ;
    00916   virtual int readMps(const char *filename,
    00917                       const char *extension = "mps") ;
    00920   int readMps(const char *filename,bool keepNames,bool allowErrors);
    00922   virtual int readMps (const char *filename, const char*extension,
    00923                         int & numberSets, CoinSet ** & sets);
    00924
    00929   virtual void writeMps(const char *filename,
    00930                         const char *extension = "mps",
    00931                         double objSense=0.0) const;
    00940   virtual int writeMpsNative(const char *filename,
    00941                              const char ** rowNames, const char ** columnNames,
    00942                              int formatType=0,int numberAcross=2,
    00943                              double objSense=0.0) const ;
    00945   virtual int readLp(const char *filename, const double epsilon = 1e-5);
    00951   virtual void writeLp(const char *filename,
    00952                        const char *extension = "lp",
    00953                        double epsilon = 1e-5,
    00954                        int numberAcross = 10,
    00955                        int decimals = 5,
    00956                        double objSense = 0.0,
    00957                        bool useRowNames = true) const;
    00962   virtual void writeLp(FILE *fp,
    00963                double epsilon = 1e-5,
    00964                int numberAcross = 10,
    00965                int decimals = 5,
    00966                double objSense = 0.0,
    00967                bool useRowNames = true) const;
    00973   virtual void replaceMatrixOptional(const CoinPackedMatrix & matrix);
    00975   virtual void replaceMatrix(const CoinPackedMatrix & matrix) ;
    00977
    00988   virtual void passInMessageHandler(CoinMessageHandler * handler);
    00990   void newLanguage(CoinMessages::Language language);
    00991   void setLanguage(CoinMessages::Language language)
    00992   {newLanguage(language);}
    00994   void setLogLevel(int value);
    00996   void generateCpp( FILE * fp);
    00998   //---------------------------------------------------------------------------
    00999
    01002
    01003   ClpSimplex * getModelPtr() const ;
    01005   inline ClpSimplex * swapModelPtr(ClpSimplex * newModel)
    01006   { ClpSimplex * model = modelPtr_; modelPtr_=newModel;return model;}
    01008   inline unsigned int specialOptions() const
    01009   { return specialOptions_;}
    01010   void setSpecialOptions(unsigned int value);
    01012   inline int lastAlgorithm() const
    01013   { return lastAlgorithm_;}
    01015   inline int cleanupScaling() const
    01016   { return cleanupScaling_;}
    01029   inline void setCleanupScaling(int value)
    01030   { cleanupScaling_=value;}
    01033   inline double smallestElementInCut() const
    01034   { return smallestElementInCut_;}
    01037   inline void setSmallestElementInCut(double value)
    01038   { smallestElementInCut_=value;}
    01045   inline double smallestChangeInCut() const
    01046   { return smallestChangeInCut_;}
    01053   inline void setSmallestChangeInCut(double value)
    01054   { smallestChangeInCut_=value;}
    01056   inline void setSolveOptions(const ClpSolve & options)
    01057   { solveOptions_ = options;}
    01061   virtual int tightenBounds(int lightweight=0);
    01063   virtual CoinBigIndex getSizeL() const;
    01065   virtual CoinBigIndex getSizeU() const;
    01067   const OsiClpDisasterHandler * disasterHandler() const
    01068   { return disasterHandler_;}
    01070   void passInDisasterHandler(OsiClpDisasterHandler * handler);
    01072   ClpLinearObjective * fakeObjective() const
    01073   { return fakeObjective_;}
    01075   void setFakeObjective(ClpLinearObjective * fakeObjective);
    01077   void setFakeObjective(double * fakeObjective);
    01097   void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0);
    01099   virtual void synchronizeModel();
    01104   void setSpecialOptionsMutable(unsigned int value) const;
    01105
    01107
    01108   //---------------------------------------------------------------------------
    01109
    01112
    01113   OsiClpSolverInterface ();
    01114
    01116   virtual OsiSolverInterface * clone(bool copyData = true) const;
    01117
    01119   OsiClpSolverInterface (const OsiClpSolverInterface &);
    01120
    01122   OsiClpSolverInterface (ClpSimplex * rhs, bool reallyOwn=false);
    01123
    01125   void releaseClp();
    01126
    01128   OsiClpSolverInterface & operator=(const OsiClpSolverInterface& rhs);
    01129
    01131   virtual ~OsiClpSolverInterface ();
    01132
    01134   virtual void reset();
    01136
    01137   //---------------------------------------------------------------------------
    01138
    01139 protected:
    01141
    01142
    01143   virtual void applyRowCut(const OsiRowCut& rc);
    01144
    01146   virtual void applyColCut(const OsiColCut& cc);
    01148
    01149   //---------------------------------------------------------------------------
    01150
    01151 protected:
    01154
    01155   void gutsOfDestructor();
    01156
    01158   void freeCachedResults() const;
    01159
    01161   void freeCachedResults0() const;
    01162
    01164   void freeCachedResults1() const;
    01165
    01167   void extractSenseRhsRange() const;
    01168
    01170   void fillParamMaps();
    01179   CoinWarmStartBasis getBasis(ClpSimplex * model) const;
    01188   void setBasis( const CoinWarmStartBasis & basis, ClpSimplex * model);
    01190   void crunch();
    01192   void redoScaleFactors(int numberRows,const CoinBigIndex * starts,
    01193                         const int * indices, const double * elements);
    01194 public:
    01197   void setBasis( const CoinWarmStartBasis & basis);
    01199   inline void setBasis( )
    01200   { setBasis(basis_,modelPtr_);}
    01202   CoinWarmStartDiff * getBasisDiff(const unsigned char * statusArray) const ;
    01204   CoinWarmStartBasis * getBasis(const unsigned char * statusArray) const ;
    01206   void deleteScaleFactors();
    01208   inline const double * upRange() const
    01209   { return rowActivity_;}
    01210   inline const double * downRange() const
    01211   { return columnActivity_;}
    01213   inline void passInRanges(int * array)
    01214   { whichRange_=array;}
    01216   void setSOSData(int numberSOS,const char * type,
    01217                   const int * start,const int * indices, const double * weights=NULL);
    01219   void computeLargestAway();
    01221   inline double largestAway() const
    01222   { return largestAway_;}
    01224   inline void setLargestAway(double value)
    01225   { largestAway_ = value;}
    01227   void lexSolve();
    01229
    01230 protected:
    01233
    01234   mutable ClpSimplex * modelPtr_;
    01236
    01238
    01239   mutable char    *rowsense_;
    01240
    01242   mutable double  *rhs_;
    01243
    01247   mutable double  *rowrange_;
    01248
    01251   mutable CoinWarmStartBasis* ws_;
    01254   mutable double * rowActivity_;
    01255   mutable double * columnActivity_;
    01257   ClpNodeStuff stuff_;
    01259   int numberSOS_;
    01261   CoinSet * setInfo_;
    01263   ClpSimplex * smallModel_;
    01265   ClpFactorization * factorization_;
    01268   double smallestElementInCut_;
    01272   double smallestChangeInCut_;
    01274   double largestAway_;
    01276   char * spareArrays_;
    01278   CoinWarmStartBasis basis_;
    01280   int itlimOrig_;
    01281
    01292   mutable int lastAlgorithm_;
    01293
    01295   bool notOwned_;
    01296
    01298   mutable CoinPackedMatrix *matrixByRow_;
    01299
    01301   CoinPackedMatrix *matrixByRowAtContinuous_;
    01302
    01304   char * integerInformation_;
    01305
    01310   int * whichRange_;
    01311
    01312   //std::map<OsiIntParam, ClpIntParam> intParamMap_;
    01313   //std::map<OsiDblParam, ClpDblParam> dblParamMap_;
    01314   //std::map<OsiStrParam, ClpStrParam> strParamMap_;
    01315
    01317   mutable bool fakeMinInSimplex_ ;
    01324   mutable double *linearObjective_;
    01325
    01327   mutable ClpDataSave saveData_;
    01329   ClpSolve solveOptions_;
    01342   int cleanupScaling_;
    01369   mutable unsigned int specialOptions_;
    01371   ClpSimplex * baseModel_;
    01373   int lastNumberRows_;
    01375   ClpSimplex * continuousModel_;
    01377   OsiClpDisasterHandler * disasterHandler_ ;
    01379   ClpLinearObjective * fakeObjective_;
    01381   CoinDoubleArrayWithLength rowScale_;
    01383   CoinDoubleArrayWithLength columnScale_;
    01385 };
    01386
    01387 class OsiClpDisasterHandler : public ClpDisasterHandler {
    01388 public:
    01392
    01393   virtual void intoSimplex();
    01395   virtual bool check() const ;
    01397   virtual void saveInfo();
    01399   virtual int typeOfDisaster();
    01401
    01402
    01407   OsiClpDisasterHandler(OsiClpSolverInterface * model = NULL);
    01409   virtual ~OsiClpDisasterHandler();
    01410   // Copy
    01411   OsiClpDisasterHandler(const OsiClpDisasterHandler&);
    01412   // Assignment
    01413   OsiClpDisasterHandler& operator=(const OsiClpDisasterHandler&);
    01415   virtual ClpDisasterHandler * clone() const;
    01416
    01418
    01423   void setOsiModel(OsiClpSolverInterface * model);
    01425   inline OsiClpSolverInterface * osiModel() const
    01426   { return osiModel_;}
    01428   inline void setWhereFrom(int value)
    01429   { whereFrom_=value;}
    01431   inline int whereFrom() const
    01432   { return whereFrom_;}
    01434   inline void setPhase(int value)
    01435   { phase_=value;}
    01437   inline int phase() const
    01438   { return phase_;}
    01440   inline bool inTrouble() const
    01441   { return inTrouble_;}
    01442
    01444
    01445
    01446 protected:
    01450
    01451   OsiClpSolverInterface * osiModel_;
    01459   int whereFrom_;
    01467   int phase_;
    01469   bool inTrouble_;
    01471 };
    01472 // So unit test can find out if NDEBUG set
    01473 bool OsiClpHasNDEBUG();
    01474 //#############################################################################
    01482 int
    01483 OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
    01484 #endif