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

- File List
- File Members

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

Go to the documentation of this file.

    00001 /* $Id: ClpPrimalColumnSteepest.hpp 1525 2010-02-26 17:27:59Z mjs $ */
    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_;
    00126      }
    00130      virtual int numberSprintColumns(int & numberIterations) const;
    00132      virtual void switchOffSprint();
    00133
    00135
    00138      enum Persistence {
    00139           normal = 0x00, // create (if necessary) and destroy
    00140           keep = 0x01 // create (if necessary) and leave
    00141      };
    00142
    00144
    00145
    00153      ClpPrimalColumnSteepest(int mode = 3);
    00154
    00156      ClpPrimalColumnSteepest(const ClpPrimalColumnSteepest & rhs);
    00157
    00159      ClpPrimalColumnSteepest & operator=(const ClpPrimalColumnSteepest& rhs);
    00160
    00162      virtual ~ClpPrimalColumnSteepest ();
    00163
    00165      virtual ClpPrimalColumnPivot * clone(bool copyData = true) const;
    00166
    00168
    00170
    00173      inline bool reference(int i) const {
    00174           return ((reference_[i>>5] >> (i & 31)) & 1) != 0;
    00175      }
    00176      inline void setReference(int i, bool trueFalse) {
    00177           unsigned int & value = reference_[i>>5];
    00178           int bit = i & 31;
    00179           if (trueFalse)
    00180                value |= (1 << bit);
    00181           else
    00182                value &= ~(1 << bit);
    00183      }
    00185      inline void setPersistence(Persistence life) {
    00186           persistence_ = life;
    00187      }
    00188      inline Persistence persistence() const {
    00189           return persistence_ ;
    00190      }
    00191
    00193      //---------------------------------------------------------------------------
    00194
    00195 private:
    00197      // Update weight
    00198      double devex_;
    00200      double * weights_;
    00202      CoinIndexedVector * infeasible_;
    00204      CoinIndexedVector * alternateWeights_;
    00206      double * savedWeights_;
    00207      // Array for exact devex to say what is in reference framework
    00208      unsigned int * reference_;
    00214      int state_;
    00227      int mode_;
    00229      Persistence persistence_;
    00231      int numberSwitched_;
    00232      // This is pivot row (or pivot sequence round re-factorization)
    00233      int pivotSequence_;
    00234      // This is saved pivot sequence
    00235      int savedPivotSequence_;
    00236      // This is saved outgoing variable
    00237      int savedSequenceOut_;
    00238      // Iteration when last rectified
    00239      int lastRectified_;
    00240      // Size of factorization at invert (used to decide algorithm)
    00241      int sizeFactorization_;
    00243 };
    00244
    00245 #endif