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

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.55.0/Clp/src/ClpSimplex.hpp

Go to the documentation of this file.

    00001 /* $Id: ClpSimplex.hpp 1461 2009-11-06 19:06:43Z stefan $ */
    00002 // Copyright (C) 2002, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004
    00005 /*
    00006    Authors
    00007
    00008    John Forrest
    00009
    00010  */
    00011 #ifndef ClpSimplex_H
    00012 #define ClpSimplex_H
    00013
    00014 #include <iostream>
    00015 #include <cfloat>
    00016 #include "ClpModel.hpp"
    00017 #include "ClpMatrixBase.hpp"
    00018 #include "ClpSolve.hpp"
    00019 class ClpDualRowPivot;
    00020 class ClpPrimalColumnPivot;
    00021 class ClpFactorization;
    00022 class CoinIndexedVector;
    00023 class ClpNonLinearCost;
    00024 class ClpNodeStuff;
    00025 class CoinStructuredModel;
    00026 class OsiClpSolverInterface;
    00027 class CoinWarmStartBasis;
    00028 class ClpDisasterHandler;
    00029 class ClpConstraint;
    00030
    00049 class ClpSimplex : public ClpModel {
    00050   friend void ClpSimplexUnitTest(const std::string & mpsDir);
    00051
    00052 public:
    00057   enum Status {
    00058     isFree = 0x00,
    00059     basic = 0x01,
    00060     atUpperBound = 0x02,
    00061     atLowerBound = 0x03,
    00062     superBasic = 0x04,
    00063     isFixed = 0x05
    00064   };
    00065   // For Dual
    00066   enum FakeBound {
    00067     noFake = 0x00,
    00068     lowerFake = 0x01,
    00069     upperFake = 0x02,
    00070     bothFake = 0x03
    00071   };
    00072
    00075
    00076     ClpSimplex (bool emptyMessages = false  );
    00077
    00082   ClpSimplex(const ClpSimplex & rhs, int scalingMode =-1);
    00087   ClpSimplex(const ClpModel & rhs, int scalingMode=-1);
    00094   ClpSimplex (const ClpModel * wholeModel,
    00095               int numberRows, const int * whichRows,
    00096               int numberColumns, const int * whichColumns,
    00097               bool dropNames=true, bool dropIntegers=true,
    00098               bool fixOthers=false);
    00105   ClpSimplex (const ClpSimplex * wholeModel,
    00106               int numberRows, const int * whichRows,
    00107               int numberColumns, const int * whichColumns,
    00108               bool dropNames=true, bool dropIntegers=true,
    00109               bool fixOthers=false);
    00113   ClpSimplex (ClpSimplex * wholeModel,
    00114               int numberColumns, const int * whichColumns);
    00117   void originalModel(ClpSimplex * miniModel);
    00123   void setPersistenceFlag(int value);
    00125   void makeBaseModel();
    00127   void deleteBaseModel();
    00129   inline ClpSimplex *  baseModel() const
    00130   { return baseModel_;}
    00134   void setToBaseModel(ClpSimplex * model=NULL);
    00136     ClpSimplex & operator=(const ClpSimplex & rhs);
    00138    ~ClpSimplex (  );
    00139   // Ones below are just ClpModel with some changes
    00151   void loadProblem (  const ClpMatrixBase& matrix,
    00152                      const double* collb, const double* colub,
    00153                      const double* obj,
    00154                      const double* rowlb, const double* rowub,
    00155                       const double * rowObjective=NULL);
    00156   void loadProblem (  const CoinPackedMatrix& matrix,
    00157                      const double* collb, const double* colub,
    00158                      const double* obj,
    00159                      const double* rowlb, const double* rowub,
    00160                       const double * rowObjective=NULL);
    00161
    00164   void loadProblem (  const int numcols, const int numrows,
    00165                      const CoinBigIndex* start, const int* index,
    00166                      const double* value,
    00167                      const double* collb, const double* colub,
    00168                      const double* obj,
    00169                       const double* rowlb, const double* rowub,
    00170                       const double * rowObjective=NULL);
    00172   void loadProblem (  const int numcols, const int numrows,
    00173                      const CoinBigIndex* start, const int* index,
    00174                       const double* value,const int * length,
    00175                      const double* collb, const double* colub,
    00176                      const double* obj,
    00177                       const double* rowlb, const double* rowub,
    00178                       const double * rowObjective=NULL);
    00183   int loadProblem (  CoinModel & modelObject,bool keepSolution=false);
    00185   int readMps(const char *filename,
    00186               bool keepNames=false,
    00187               bool ignoreErrors = false);
    00189   int readGMPL(const char *filename,const char * dataName,
    00190                bool keepNames=false);
    00193   int readLp(const char *filename, const double epsilon = 1e-5);
    00198   void borrowModel(ClpModel & otherModel);
    00199   void borrowModel(ClpSimplex & otherModel);
    00201    void passInEventHandler(const ClpEventHandler * eventHandler);
    00203   void getbackSolution(const ClpSimplex & smallModel,const int * whichRow, const int * whichColumn);
    00212   int loadNonLinear(void * info, int & numberConstraints,
    00213                     ClpConstraint ** & constraints);
    00215
    00221   int initialSolve(ClpSolve & options);
    00223   int initialSolve();
    00225   int initialDualSolve();
    00227   int initialPrimalSolve();
    00229   int initialBarrierSolve();
    00231   int initialBarrierNoCrossSolve();
    00242   int dual(int ifValuesPass=0, int startFinishOptions=0);
    00243   // If using Debug
    00244   int dualDebug(int ifValuesPass=0, int startFinishOptions=0);
    00255   int primal(int ifValuesPass=0, int startFinishOptions=0);
    00261   int nonlinearSLP(int numberPasses,double deltaTolerance);
    00267   int nonlinearSLP(int numberConstraints, ClpConstraint ** constraints,
    00268                    int numberPasses,double deltaTolerance);
    00271   int barrier(bool crossover=true);
    00274   int reducedGradient(int phase=0);
    00276   int solve(CoinStructuredModel * model);
    00283   int loadProblem (  CoinStructuredModel & modelObject,
    00284                      bool originalOrder=true,bool keepSolution=false);
    00299   int cleanup(int cleanupScaling);
    00320   int dualRanging(int numberCheck,const int * which,
    00321                   double * costIncrease, int * sequenceIncrease,
    00322                   double * costDecrease, int * sequenceDecrease,
    00323                   double * valueIncrease=NULL, double * valueDecrease=NULL);
    00338   int primalRanging(int numberCheck,const int * which,
    00339                   double * valueIncrease, int * sequenceIncrease,
    00340                   double * valueDecrease, int * sequenceDecrease);
    00355   int writeBasis(const char *filename,
    00356                  bool writeValues=false,
    00357                  int formatType=0) const;
    00360   int readBasis(const char *filename);
    00362   CoinWarmStartBasis * getBasis() const;
    00364   void setFactorization( ClpFactorization & factorization);
    00365   // Swaps factorization
    00366   ClpFactorization * swapFactorization( ClpFactorization * factorization);
    00368   void copyFactorization( ClpFactorization & factorization);
    00378   int tightenPrimalBounds(double factor=0.0,int doTight=0,bool tightIntegers=false);
    00395   int crash(double gap,int pivot);
    00397   void setDualRowPivotAlgorithm(ClpDualRowPivot & choice);
    00399   void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot & choice);
    00408   int strongBranching(int numberVariables,const int * variables,
    00409                       double * newLower, double * newUpper,
    00410                       double ** outputSolution,
    00411                       int * outputStatus, int * outputIterations,
    00412                       bool stopOnFirstInfeasible=true,
    00413                       bool alwaysFinish=false,
    00414                       int startFinishOptions=0);
    00416   int fathom(void * stuff);
    00422   int fathomMany(void * stuff);
    00424   double doubleCheck();
    00426   int startFastDual2(ClpNodeStuff * stuff);
    00428   int fastDual2(ClpNodeStuff * stuff);
    00430   void stopFastDual2(ClpNodeStuff * stuff);
    00437   ClpSimplex * fastCrunch(ClpNodeStuff * stuff, int mode);
    00439
    00447   int pivot();
    00448
    00454   int primalPivotResult();
    00455
    00462   int dualPivotResult();
    00463
    00475   int startup(int ifValuesPass,int startFinishOptions=0);
    00476   void finish(int startFinishOptions=0);
    00477
    00479   bool statusOfProblem(bool initial=false);
    00481   void defaultFactorizationFrequency();
    00483
    00486
    00487   inline bool primalFeasible() const
    00488          { return (numberPrimalInfeasibilities_==0);}
    00490   inline bool dualFeasible() const
    00491          { return (numberDualInfeasibilities_==0);}
    00493   inline ClpFactorization * factorization() const
    00494           { return factorization_;}
    00496   bool sparseFactorization() const;
    00497   void setSparseFactorization(bool value);
    00499   int factorizationFrequency() const;
    00500   void setFactorizationFrequency(int value);
    00502   inline double dualBound() const
    00503           { return dualBound_;}
    00504   void setDualBound(double value);
    00506   inline double infeasibilityCost() const
    00507           { return infeasibilityCost_;}
    00508   void setInfeasibilityCost(double value);
    00525   inline int perturbation() const
    00526     { return perturbation_;}
    00527   void setPerturbation(int value);
    00529   inline int algorithm() const
    00530   {return algorithm_; }
    00532   inline void setAlgorithm(int value)
    00533   {algorithm_=value; }
    00535   bool isObjectiveLimitTestValid() const ;
    00537   inline double sumDualInfeasibilities() const
    00538           { return sumDualInfeasibilities_;}
    00539   inline void setSumDualInfeasibilities(double value)
    00540           { sumDualInfeasibilities_=value;}
    00542   inline double sumOfRelaxedDualInfeasibilities() const
    00543           { return sumOfRelaxedDualInfeasibilities_;}
    00544   inline void setSumOfRelaxedDualInfeasibilities(double value)
    00545           { sumOfRelaxedDualInfeasibilities_=value;}
    00547   inline int numberDualInfeasibilities() const
    00548           { return numberDualInfeasibilities_;}
    00549   inline void setNumberDualInfeasibilities(int value)
    00550           { numberDualInfeasibilities_=value;}
    00552   inline int numberDualInfeasibilitiesWithoutFree() const
    00553           { return numberDualInfeasibilitiesWithoutFree_;}
    00555   inline double sumPrimalInfeasibilities() const
    00556           { return sumPrimalInfeasibilities_;}
    00557   inline void setSumPrimalInfeasibilities(double value)
    00558           { sumPrimalInfeasibilities_=value;}
    00560   inline double sumOfRelaxedPrimalInfeasibilities() const
    00561           { return sumOfRelaxedPrimalInfeasibilities_;}
    00562   inline void setSumOfRelaxedPrimalInfeasibilities(double value)
    00563           { sumOfRelaxedPrimalInfeasibilities_=value;}
    00565   inline int numberPrimalInfeasibilities() const
    00566           { return numberPrimalInfeasibilities_;}
    00567   inline void setNumberPrimalInfeasibilities(int value)
    00568           { numberPrimalInfeasibilities_=value;}
    00575   int saveModel(const char * fileName);
    00578   int restoreModel(const char * fileName);
    00579
    00587   void checkSolution(int setToBounds=0);
    00590   void checkSolutionInternal();
    00592   inline CoinIndexedVector * rowArray(int index) const
    00593   { return rowArray_[index];}
    00595   inline CoinIndexedVector * columnArray(int index) const
    00596   { return columnArray_[index];}
    00598
    00599   /******************** End of most useful part **************/
    00605   int getSolution (  const double * rowActivities,
    00606                      const double * columnActivities);
    00610   int getSolution ();
    00617   int createPiecewiseLinearCosts(const int * starts,
    00618                    const double * lower, const double * gradient);
    00620   ClpDualRowPivot * dualRowPivot() const
    00621   { return dualRowPivot_;}
    00623   inline bool goodAccuracy() const
    00624   { return (largestPrimalError_<1.0e-7&&largestDualError_<1.0e-7);}
    00626   void returnModel(ClpSimplex & otherModel);
    00634   int internalFactorize(int solveType);
    00636   ClpDataSave saveData() ;
    00638   void restoreData(ClpDataSave saved);
    00640   void cleanStatus();
    00642   int factorize();
    00645   void computeDuals(double * givenDjs);
    00647   void computePrimals (  const double * rowActivities,
    00648                      const double * columnActivities);
    00650   void add(double * array,
    00651                    int column, double multiplier) const;
    00657   void unpack(CoinIndexedVector * rowArray) const ;
    00663   void unpack(CoinIndexedVector * rowArray,int sequence) const;
    00670   void unpackPacked(CoinIndexedVector * rowArray) ;
    00677   void unpackPacked(CoinIndexedVector * rowArray,int sequence);
    00678 protected:
    00683   int housekeeping(double objectiveChange);
    00686   void checkPrimalSolution(const double * rowActivities=NULL,
    00687                            const double * columnActivies=NULL);
    00690   void checkDualSolution();
    00692   void checkBothSolutions();
    00697   double scaleObjective(double value);
    00699   int solveDW(CoinStructuredModel * model);
    00701   int solveBenders(CoinStructuredModel * model);
    00702 public:
    00713   void setValuesPassAction(double incomingInfeasibility,
    00714                            double allowedInfeasibility);
    00716
    00718 public:
    00720   inline double alphaAccuracy() const
    00721           { return alphaAccuracy_;}
    00722   inline void setAlphaAccuracy(double value)
    00723           { alphaAccuracy_ = value;}
    00724 public:
    00726    //inline double objectiveValue() const {
    00727   //return (objectiveValue_-bestPossibleImprovement_)*optimizationDirection_ - dblParam_[ClpObjOffset];
    00728   //}
    00730   inline void setDisasterHandler(ClpDisasterHandler * handler)
    00731   { disasterArea_= handler;}
    00733   inline ClpDisasterHandler * disasterHandler() const
    00734   { return disasterArea_;}
    00736   inline double largeValue() const
    00737           { return largeValue_;}
    00738   void setLargeValue( double value) ;
    00740   inline double largestPrimalError() const
    00741           { return largestPrimalError_;}
    00743   inline double largestDualError() const
    00744           { return largestDualError_;}
    00746   inline void setLargestPrimalError(double value)
    00747           { largestPrimalError_=value;}
    00749   inline void setLargestDualError(double value)
    00750           { largestDualError_=value;}
    00752   inline double zeroTolerance() const
    00753   { return zeroTolerance_;/*factorization_->zeroTolerance();*/}
    00755   inline void setZeroTolerance( double value)
    00756   { zeroTolerance_ = value;}
    00758   inline int * pivotVariable() const
    00759           { return pivotVariable_;}
    00761   inline bool automaticScaling() const
    00762   { return automaticScale_!=0;}
    00763   inline void setAutomaticScaling(bool onOff)
    00764   { automaticScale_ = onOff ? 1: 0;}
    00766   inline double currentDualTolerance() const
    00767           { return dualTolerance_;}
    00768   inline void setCurrentDualTolerance(double value)
    00769           { dualTolerance_ = value;}
    00771   inline double currentPrimalTolerance() const
    00772           { return primalTolerance_;}
    00773   inline void setCurrentPrimalTolerance(double value)
    00774           { primalTolerance_ = value;}
    00776   inline int numberRefinements() const
    00777           { return numberRefinements_;}
    00778   void setNumberRefinements( int value) ;
    00780   inline double alpha() const { return alpha_;}
    00781   inline void setAlpha(double value) { alpha_ = value;}
    00783   inline double dualIn() const { return dualIn_;}
    00785   inline int pivotRow() const{ return pivotRow_;}
    00786   inline void setPivotRow(int value) { pivotRow_=value;}
    00788   double valueIncomingDual() const;
    00790
    00791   protected:
    00797   int gutsOfSolution ( double * givenDuals,
    00798                        const double * givenPrimals,
    00799                        bool valuesPass=false);
    00801   void gutsOfDelete(int type);
    00803   void gutsOfCopy(const ClpSimplex & rhs);
    00815   bool createRim(int what,bool makeRowCopy=false,int startFinishOptions=0);
    00817   void createRim1(bool initial);
    00819   void createRim4(bool initial);
    00821   void createRim5(bool initial);
    00826   void deleteRim(int getRidOfFactorizationData=2);
    00828   bool sanityCheck();
    00830   public:
    00835   inline double * solutionRegion(int section) const
    00836   { if (!section) return rowActivityWork_; else return columnActivityWork_;}
    00837   inline double * djRegion(int section) const
    00838   { if (!section) return rowReducedCost_; else return reducedCostWork_;}
    00839   inline double * lowerRegion(int section) const
    00840   { if (!section) return rowLowerWork_; else return columnLowerWork_;}
    00841   inline double * upperRegion(int section) const
    00842   { if (!section) return rowUpperWork_; else return columnUpperWork_;}
    00843   inline double * costRegion(int section) const
    00844   { if (!section) return rowObjectiveWork_; else return objectiveWork_;}
    00846   inline double * solutionRegion() const
    00847   { return solution_;}
    00848   inline double * djRegion() const
    00849   { return dj_;}
    00850   inline double * lowerRegion() const
    00851   { return lower_;}
    00852   inline double * upperRegion() const
    00853   { return upper_;}
    00854   inline double * costRegion() const
    00855   { return cost_;}
    00856   inline Status getStatus(int sequence) const
    00857   {return static_cast<Status> (status_[sequence]&7);}
    00858   inline void setStatus(int sequence, Status newstatus)
    00859   {
    00860     unsigned char & st_byte = status_[sequence];
    00861     st_byte = static_cast<unsigned char>(st_byte & ~7);
    00862     st_byte = static_cast<unsigned char>(st_byte | newstatus);
    00863   }
    00865   bool startPermanentArrays();
    00870   void setInitialDenseFactorization(bool onOff);
    00871   bool  initialDenseFactorization() const;
    00873   inline int sequenceIn() const
    00874   {return sequenceIn_;}
    00875   inline int sequenceOut() const
    00876   {return sequenceOut_;}
    00878   inline void  setSequenceIn(int sequence)
    00879   { sequenceIn_=sequence;}
    00880   inline void  setSequenceOut(int sequence)
    00881   { sequenceOut_=sequence;}
    00883   inline int directionIn() const
    00884   {return directionIn_;}
    00885   inline int directionOut() const
    00886   {return directionOut_;}
    00888   inline void  setDirectionIn(int direction)
    00889   { directionIn_=direction;}
    00890   inline void  setDirectionOut(int direction)
    00891   { directionOut_=direction;}
    00893   inline double valueOut() const
    00894   { return valueOut_;}
    00896   inline int isColumn(int sequence) const
    00897   { return sequence<numberColumns_ ? 1 : 0;}
    00899   inline int sequenceWithin(int sequence) const
    00900   { return sequence<numberColumns_ ? sequence : sequence-numberColumns_;}
    00902   inline double solution(int sequence)
    00903   { return solution_[sequence];}
    00905   inline double & solutionAddress(int sequence)
    00906   { return solution_[sequence];}
    00907   inline double reducedCost(int sequence)
    00908    { return dj_[sequence];}
    00909   inline double & reducedCostAddress(int sequence)
    00910    { return dj_[sequence];}
    00911   inline double lower(int sequence)
    00912   { return lower_[sequence];}
    00914   inline double & lowerAddress(int sequence)
    00915   { return lower_[sequence];}
    00916   inline double upper(int sequence)
    00917   { return upper_[sequence];}
    00919   inline double & upperAddress(int sequence)
    00920   { return upper_[sequence];}
    00921   inline double cost(int sequence)
    00922   { return cost_[sequence];}
    00924   inline double & costAddress(int sequence)
    00925   { return cost_[sequence];}
    00927   inline double originalLower(int iSequence) const
    00928   { if (iSequence<numberColumns_) return columnLower_[iSequence]; else
    00929     return rowLower_[iSequence-numberColumns_];}
    00931   inline double originalUpper(int iSequence) const
    00932   { if (iSequence<numberColumns_) return columnUpper_[iSequence]; else
    00933     return rowUpper_[iSequence-numberColumns_];}
    00935   inline double theta() const
    00936   { return theta_;}
    00939   inline double bestPossibleImprovement() const
    00940   { return bestPossibleImprovement_;}
    00942   inline ClpNonLinearCost * nonLinearCost() const
    00943   { return nonLinearCost_;}
    00955   inline int moreSpecialOptions() const
    00956   { return moreSpecialOptions_;}
    00968   inline void setMoreSpecialOptions(int value)
    00969   { moreSpecialOptions_ = value;}
    00971
    00973   inline void setFakeBound(int sequence, FakeBound fakeBound)
    00974   {
    00975     unsigned char & st_byte = status_[sequence];
    00976     st_byte = static_cast<unsigned char>(st_byte & ~24);
    00977     st_byte = static_cast<unsigned char>(st_byte | (fakeBound<<3));
    00978   }
    00979   inline FakeBound getFakeBound(int sequence) const
    00980   {return static_cast<FakeBound> ((status_[sequence]>>3)&3);}
    00981   inline void setRowStatus(int sequence, Status newstatus)
    00982   {
    00983     unsigned char & st_byte = status_[sequence+numberColumns_];
    00984     st_byte = static_cast<unsigned char>(st_byte & ~7);
    00985     st_byte = static_cast<unsigned char>(st_byte | newstatus);
    00986   }
    00987   inline Status getRowStatus(int sequence) const
    00988   {return static_cast<Status> (status_[sequence+numberColumns_]&7);}
    00989   inline void setColumnStatus(int sequence, Status newstatus)
    00990   {
    00991     unsigned char & st_byte = status_[sequence];
    00992     st_byte = static_cast<unsigned char>(st_byte & ~7);
    00993     st_byte = static_cast<unsigned char>(st_byte | newstatus);
    00994   }
    00995   inline Status getColumnStatus(int sequence) const
    00996   {return static_cast<Status> (status_[sequence]&7);}
    00997   inline void setPivoted( int sequence)
    00998   { status_[sequence] = static_cast<unsigned char>(status_[sequence] | 32);}
    00999   inline void clearPivoted( int sequence)
    01000   { status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~32);}
    01001   inline bool pivoted(int sequence) const
    01002   {return (((status_[sequence]>>5)&1)!=0);}
    01004   void setFlagged( int sequence);
    01005   inline void clearFlagged( int sequence)
    01006   {
    01007     status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
    01008   }
    01009   inline bool flagged(int sequence) const
    01010   {return ((status_[sequence]&64)!=0);}
    01012   inline void setActive( int iRow)
    01013   {
    01014     status_[iRow] = static_cast<unsigned char>(status_[iRow] | 128);
    01015   }
    01016   inline void clearActive( int iRow)
    01017   {
    01018     status_[iRow] = static_cast<unsigned char>(status_[iRow] & ~128);
    01019   }
    01020   inline bool active(int iRow) const
    01021   {return ((status_[iRow]&128)!=0);}
    01024   void createStatus() ;
    01027   void allSlackBasis(bool resetSolution=false);
    01028
    01030   inline int lastBadIteration() const
    01031   {return lastBadIteration_;}
    01033   inline int progressFlag() const
    01034   {return (progressFlag_&3);}
    01036   inline void forceFactorization(int value)
    01037   { forceFactorization_ = value;}
    01039   inline double rawObjectiveValue() const
    01040   { return objectiveValue_;}
    01042   void computeObjectiveValue(bool useWorkingSolution=false);
    01044   double computeInternalObjectiveValue();
    01048   inline int numberExtraRows() const
    01049   { return numberExtraRows_;}
    01052   inline int maximumBasic() const
    01053   { return maximumBasic_;}
    01055   inline int baseIteration() const
    01056   { return baseIteration_;}
    01058   void generateCpp( FILE * fp,bool defaultFactor=false);
    01060   ClpFactorization * getEmptyFactorization();
    01062   void setEmptyFactorization();
    01064   void moveInfo(const ClpSimplex & rhs, bool justStatus=false);
    01066
    01068   // These are only to be used using startFinishOptions (ClpSimplexDual, ClpSimplexPrimal)
    01069   // *** At present only without scaling
    01070   // *** Slacks havve -1.0 element (so == row activity) - take care
    01072   void getBInvARow(int row, double* z, double * slack=NULL);
    01073
    01075   void getBInvRow(int row, double* z);
    01076
    01078   void getBInvACol(int col, double* vec);
    01079
    01081   void getBInvCol(int col, double* vec);
    01082
    01087   void getBasics(int* index);
    01088
    01090     //-------------------------------------------------------------------------
    01094        void setObjectiveCoefficient( int elementIndex, double elementValue );
    01096        inline void setObjCoeff( int elementIndex, double elementValue )
    01097        { setObjectiveCoefficient( elementIndex, elementValue);}
    01098
    01101        void setColumnLower( int elementIndex, double elementValue );
    01102
    01105        void setColumnUpper( int elementIndex, double elementValue );
    01106
    01108       void setColumnBounds( int elementIndex,
    01109         double lower, double upper );
    01110
    01119       void setColumnSetBounds(const int* indexFirst,
    01120                                    const int* indexLast,
    01121                                    const double* boundList);
    01122
    01125        inline void setColLower( int elementIndex, double elementValue )
    01126        { setColumnLower(elementIndex, elementValue);}
    01129        inline void setColUpper( int elementIndex, double elementValue )
    01130        { setColumnUpper(elementIndex, elementValue);}
    01131
    01133       inline void setColBounds( int elementIndex,
    01134         double newlower, double newupper )
    01135        { setColumnBounds(elementIndex, newlower, newupper);}
    01136
    01143       inline void setColSetBounds(const int* indexFirst,
    01144                                    const int* indexLast,
    01145                                    const double* boundList)
    01146       { setColumnSetBounds(indexFirst, indexLast, boundList);}
    01147
    01150       void setRowLower( int elementIndex, double elementValue );
    01151
    01154       void setRowUpper( int elementIndex, double elementValue ) ;
    01155
    01157       void setRowBounds( int elementIndex,
    01158                                  double lower, double upper ) ;
    01159
    01166       void setRowSetBounds(const int* indexFirst,
    01167                                    const int* indexLast,
    01168                                    const double* boundList);
    01170   void resize (int newNumberRows, int newNumberColumns);
    01171
    01173
    01175 protected:
    01176
    01185   double bestPossibleImprovement_;
    01187   double zeroTolerance_;
    01189   int columnPrimalSequence_;
    01191   int rowPrimalSequence_;
    01193   double bestObjectiveValue_;
    01195   int moreSpecialOptions_;
    01197   int baseIteration_;
    01199   double primalToleranceToGetOptimal_;
    01201   double largeValue_;
    01203   double largestPrimalError_;
    01205   double largestDualError_;
    01207   double alphaAccuracy_;
    01209   double dualBound_;
    01211   double alpha_;
    01213   double theta_;
    01215   double lowerIn_;
    01217   double valueIn_;
    01219   double upperIn_;
    01221   double dualIn_;
    01223   double lowerOut_;
    01225   double valueOut_;
    01227   double upperOut_;
    01229   double dualOut_;
    01231   double dualTolerance_;
    01233   double primalTolerance_;
    01235   double sumDualInfeasibilities_;
    01237   double sumPrimalInfeasibilities_;
    01239   double infeasibilityCost_;
    01241   double sumOfRelaxedDualInfeasibilities_;
    01243   double sumOfRelaxedPrimalInfeasibilities_;
    01245   double acceptablePivot_;
    01247   double * lower_;
    01249   double * rowLowerWork_;
    01251   double * columnLowerWork_;
    01253   double * upper_;
    01255   double * rowUpperWork_;
    01257   double * columnUpperWork_;
    01259   double * cost_;
    01261   double * rowObjectiveWork_;
    01263   double * objectiveWork_;
    01265   CoinIndexedVector * rowArray_[6];
    01267   CoinIndexedVector * columnArray_[6];
    01269   int sequenceIn_;
    01271   int directionIn_;
    01273   int sequenceOut_;
    01275   int directionOut_;
    01277   int pivotRow_;
    01279   int lastGoodIteration_;
    01281   double * dj_;
    01283   double * rowReducedCost_;
    01285   double * reducedCostWork_;
    01287   double * solution_;
    01289   double * rowActivityWork_;
    01291   double * columnActivityWork_;
    01293   int numberDualInfeasibilities_;
    01295   int numberDualInfeasibilitiesWithoutFree_;
    01297   int numberPrimalInfeasibilities_;
    01299   int numberRefinements_;
    01301   ClpDualRowPivot * dualRowPivot_;
    01303   ClpPrimalColumnPivot * primalColumnPivot_;
    01305   int * pivotVariable_;
    01307   ClpFactorization * factorization_;
    01309   double * savedSolution_;
    01311   int numberTimesOptimal_;
    01313   ClpDisasterHandler * disasterArea_;
    01315   int changeMade_;
    01317   int algorithm_;
    01320   int forceFactorization_;
    01328   int perturbation_;
    01330   unsigned char * saveStatus_;
    01335   ClpNonLinearCost * nonLinearCost_;
    01337   int lastBadIteration_;
    01339   int lastFlaggedIteration_;
    01341   int numberFake_;
    01343   int numberChanged_;
    01345   int progressFlag_;
    01347   int firstFree_;
    01351   int numberExtraRows_;
    01354   int maximumBasic_;
    01356   int dontFactorizePivots_;
    01366   double incomingInfeasibility_;
    01367   double allowedInfeasibility_;
    01369   int automaticScale_;
    01371   int maximumPerturbationSize_;
    01373   double * perturbationArray_;
    01375   ClpSimplex * baseModel_;
    01377   ClpSimplexProgress progress_;
    01378 public:
    01380   mutable int spareIntArray_[4];
    01382   mutable double spareDoubleArray_[4];
    01383 protected:
    01385   friend class OsiClpSolverInterface;
    01387 };
    01388 //#############################################################################
    01397 void
    01398 ClpSimplexUnitTest(const std::string & mpsDir);
    01399
    01400 // For Devex stuff
    01401 #define DEVEX_TRY_NORM 1.0e-4
    01402 #define DEVEX_ADD_ONE 1.0
    01403 #endif