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

- File List
- File Members

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

Go to the documentation of this file.

    00001 /* $Id: ClpPrimalColumnSteepest.hpp 1458 2009-11-05 12:34:07Z forrest $ */
    00002 // Copyright (C) 2002, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004 #ifndef ClpPrimalColumnSteepest_H
    00005 #define ClpPrimalColumnSteepest_H
    00006
    00007 #include "ClpPrimalColumnPivot.hpp"
    00008 #include <bitset>
    00009
    00010 //#############################################################################
    00011 class CoinIndexedVector;
    00012
    00013
    00021 class ClpPrimalColumnSteepest : public ClpPrimalColumnPivot {
    00022
    00023 public:
    00024
    00026
    00027
    00035   virtual int pivotColumn(CoinIndexedVector * updates,
    00036                           CoinIndexedVector * spareRow1,
    00037                           CoinIndexedVector * spareRow2,
    00038                           CoinIndexedVector * spareColumn1,
    00039                           CoinIndexedVector * spareColumn2);
    00041   int pivotColumnOldMethod(CoinIndexedVector * updates,
    00042                           CoinIndexedVector * spareRow1,
    00043                           CoinIndexedVector * spareRow2,
    00044                           CoinIndexedVector * spareColumn1,
    00045                           CoinIndexedVector * spareColumn2);
    00047   void justDjs(CoinIndexedVector * updates,
    00048                CoinIndexedVector * spareRow2,
    00049                CoinIndexedVector * spareColumn1,
    00050                CoinIndexedVector * spareColumn2);
    00052   int partialPricing(CoinIndexedVector * updates,
    00053                      CoinIndexedVector * spareRow2,
    00054                      int numberWanted,
    00055                      int numberLook);
    00057   void djsAndDevex(CoinIndexedVector * updates,
    00058                CoinIndexedVector * spareRow2,
    00059                CoinIndexedVector * spareColumn1,
    00060                CoinIndexedVector * spareColumn2);
    00062   void djsAndSteepest(CoinIndexedVector * updates,
    00063                CoinIndexedVector * spareRow2,
    00064                CoinIndexedVector * spareColumn1,
    00065                CoinIndexedVector * spareColumn2);
    00067   void djsAndDevex2(CoinIndexedVector * updates,
    00068                CoinIndexedVector * spareRow2,
    00069                CoinIndexedVector * spareColumn1,
    00070                CoinIndexedVector * spareColumn2);
    00072   void djsAndSteepest2(CoinIndexedVector * updates,
    00073                CoinIndexedVector * spareRow2,
    00074                CoinIndexedVector * spareColumn1,
    00075                CoinIndexedVector * spareColumn2);
    00077   void justDevex(CoinIndexedVector * updates,
    00078                CoinIndexedVector * spareRow2,
    00079                CoinIndexedVector * spareColumn1,
    00080                CoinIndexedVector * spareColumn2);
    00082   void justSteepest(CoinIndexedVector * updates,
    00083                CoinIndexedVector * spareRow2,
    00084                CoinIndexedVector * spareColumn1,
    00085                CoinIndexedVector * spareColumn2);
    00087   void transposeTimes2(const CoinIndexedVector * pi1, CoinIndexedVector * dj1,
    00088                        const CoinIndexedVector * pi2, CoinIndexedVector * dj2,
    00089                        CoinIndexedVector * spare,double scaleFactor);
    00090
    00092   virtual void updateWeights(CoinIndexedVector * input);
    00093
    00095   void checkAccuracy(int sequence,double relativeTolerance,
    00096                      CoinIndexedVector * rowArray1,
    00097                      CoinIndexedVector * rowArray2);
    00098
    00100   void initializeWeights();
    00101
    00110   virtual void saveWeights(ClpSimplex * model,int mode);
    00112   virtual void unrollWeights();
    00114   virtual void clearArrays();
    00116   virtual bool looksOptimal() const;
    00118   virtual void maximumPivotsChanged();
    00120
    00123
    00124   inline int mode() const
    00125     { return mode_;}
    00129   virtual int numberSprintColumns(int & numberIterations) const;
    00131   virtual void switchOffSprint();
    00132
    00134
    00137   enum Persistence {
    00138     normal = 0x00, // create (if necessary) and destroy
    00139     keep = 0x01 // create (if necessary) and leave
    00140   };
    00141
    00143
    00144
    00152   ClpPrimalColumnSteepest(int mode=3);
    00153
    00155   ClpPrimalColumnSteepest(const ClpPrimalColumnSteepest & rhs);
    00156
    00158   ClpPrimalColumnSteepest & operator=(const ClpPrimalColumnSteepest& rhs);
    00159
    00161   virtual ~ClpPrimalColumnSteepest ();
    00162
    00164   virtual ClpPrimalColumnPivot * clone(bool copyData = true) const;
    00165
    00167
    00169
    00172   inline bool reference(int i) const {
    00173     return ((reference_[i>>5]>>(i&31))&1)!=0;
    00174   }
    00175   inline void setReference(int i,bool trueFalse) {
    00176     unsigned int & value = reference_[i>>5];
    00177     int bit = i&31;
    00178     if (trueFalse)
    00179       value |= (1<<bit);
    00180     else
    00181       value &= ~(1<<bit);
    00182   }
    00184   inline void setPersistence(Persistence life)
    00185   { persistence_ = life;}
    00186   inline Persistence persistence() const
    00187   { return persistence_ ;}
    00188
    00190   //---------------------------------------------------------------------------
    00191
    00192 private:
    00194   // Update weight
    00195   double devex_;
    00197   double * weights_;
    00199   CoinIndexedVector * infeasible_;
    00201   CoinIndexedVector * alternateWeights_;
    00203   double * savedWeights_;
    00204   // Array for exact devex to say what is in reference framework
    00205   unsigned int * reference_;
    00211   int state_;
    00224   int mode_;
    00226   Persistence persistence_;
    00228   int numberSwitched_;
    00229   // This is pivot row (or pivot sequence round re-factorization)
    00230   int pivotSequence_;
    00231   // This is saved pivot sequence
    00232   int savedPivotSequence_;
    00233   // This is saved outgoing variable
    00234   int savedSequenceOut_;
    00235   // Iteration when last rectified
    00236   int lastRectified_;
    00237   // Size of factorization at invert (used to decide algorithm)
    00238   int sizeFactorization_;
    00240 };
    00241
    00242 #endif