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

- File List
- File Members

# /home/coin/SVN-release/Osi-0.98.1/Osi/src/OsiDylp/OsiDylpWarmStartBasis.hpp

Go to the documentation of this file.

    00001 #ifndef OsiDylpWarmStartBasis_H
    00002 #define OsiDylpWarmStartBasis_H
    00003
    00014 /*
    00015   sccs: @(#)OsiDylpWarmStartBasis.hpp   1.5     09/16/04
    00016   cvs: $Id: OsiDylpWarmStartBasis.hpp 1071 2007-08-20 04:04:33Z andreasw $
    00017 */
    00018
    00019 #include "CoinWarmStartBasis.hpp"
    00020
    00021 #define DYLP_INTERNAL
    00022 extern "C" {
    00023 #include "dylp.h"
    00024 }
    00025
    00026
    00027
    00039 class OsiDylpWarmStartBasis : public CoinWarmStartBasis
    00040
    00041 { public:
    00042
    00051
    00054   int numberActiveConstraints() const ;
    00055
    00056
    00059   inline Status getConStatus (int i) const
    00060
    00061   { const int st = (constraintStatus_[i>>2] >> ((i&3)<<1)) & 3 ;
    00062     return (static_cast<CoinWarmStartBasis::Status>(st)) ; }
    00063
    00064
    00067   inline void setConStatus (int i, Status st)
    00068
    00069   { char &st_byte = constraintStatus_[i>>2] ;
    00070     st_byte &= ~(3 << ((i&3)<<1)) ;
    00071     st_byte |= (st << ((i&3)<<1)) ; }
    00072
    00073
    00076   inline char *getConstraintStatus () { return (constraintStatus_) ; }
    00077
    00084   inline const char *getConstraintStatus () const
    00085
    00086   { return (constraintStatus_) ; }
    00087
    00088
    00091   inline void setPhase (dyphase_enum phase) { phase_ = phase ; }
    00092
    00095   inline dyphase_enum getPhase () const { return (phase_) ; }
    00096
    00098
    00101
    00104   CoinWarmStartDiff *generateDiff (const CoinWarmStart *const oldCWS) const ;
    00105
    00108   void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
    00109
    00111
    00114
    00117   void setSize (int ns, int na) ;
    00118
    00121   void resize (int numRows, int numCols) ;
    00122
    00135   void compressRows (int tgtCnt, const int *tgts) ;
    00136
    00144   void deleteRows (int number, const int *which) ;
    00145
    00159   virtual void mergeBasis(const CoinWarmStartBasis *src,
    00160                           const XferVec *xferRows,
    00161                           const XferVec *xferCols) ;
    00162
    00164
    00167
    00170   OsiDylpWarmStartBasis () ;
    00171
    00174   OsiDylpWarmStartBasis (int ns, int na, const char *sStat,
    00175                          const char *aStat, const char *cStat = 0) ;
    00176
    00179   OsiDylpWarmStartBasis (const CoinWarmStartBasis &cwsb) ;
    00180
    00183   OsiDylpWarmStartBasis (const OsiDylpWarmStartBasis &ws) ;
    00184
    00187   CoinWarmStart *clone () const ;
    00188
    00191   ~OsiDylpWarmStartBasis () ;
    00192
    00195   OsiDylpWarmStartBasis& operator= (const OsiDylpWarmStartBasis &rhs) ;
    00196
    00199   void assignBasisStatus
    00200     (int ns, int na, char *&sStat, char *&aStat, char *&cStat) ;
    00201
    00204   void assignBasisStatus
    00205     (int ns, int na, char *&sStat, char *&aStat) ;
    00206
    00207
    00209
    00212
    00215   void print () const ;
    00216
    00219   void checkBasis () const ;
    00220
    00222
    00223   private:
    00224
    00227
    00228   dyphase_enum phase_ ;
    00229
    00230   char *constraintStatus_ ;
    00231
    00233
    00234 } ;
    00235
    00236
    00237
    00261 class OsiDylpWarmStartBasisDiff : public CoinWarmStartBasisDiff
    00262 { public:
    00263
    00265   virtual CoinWarmStartDiff *clone() const
    00266   { OsiDylpWarmStartBasisDiff *odwsbd =  new OsiDylpWarmStartBasisDiff(*this) ;
    00267     return (dynamic_cast<CoinWarmStartDiff *>(odwsbd)) ; }
    00268
    00270   virtual
    00271   OsiDylpWarmStartBasisDiff &operator= (const OsiDylpWarmStartBasisDiff &rhs) ;
    00272
    00274   virtual ~OsiDylpWarmStartBasisDiff()
    00275   { delete[] condiffNdxs_ ;
    00276     delete[] condiffVals_ ; }
    00277
    00278   private:
    00279
    00280   friend CoinWarmStartDiff *OsiDylpWarmStartBasis::generateDiff
    00281     (const CoinWarmStart *const oldCWS) const ;
    00282   friend void OsiDylpWarmStartBasis::applyDiff
    00283     (const CoinWarmStartDiff *const diff) ;
    00284
    00286   OsiDylpWarmStartBasisDiff (int sze, const unsigned int *const diffNdxs,
    00287                              const unsigned int *const diffVals,
    00288                              const CoinWarmStartBasisDiff *const cwsbd) ;
    00289
    00291   OsiDylpWarmStartBasisDiff ()
    00292     : CoinWarmStartBasisDiff(),
    00293       consze_(0),
    00294       condiffNdxs_(0),
    00295       condiffVals_(0)
    00296   { /* intentionally left blank */ }
    00297
    00304   OsiDylpWarmStartBasisDiff (const OsiDylpWarmStartBasisDiff &odwsbd) ;
    00305
    00306   /* Data members */
    00307
    00309   int consze_ ;
    00310
    00313   unsigned int *condiffNdxs_ ;
    00314
    00317   unsigned int *condiffVals_ ;
    00318
    00319 } ;
    00320
    00321
    00322
    00323 #endif // OsiDylpWarmStartBasis_H