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

- File List
- File Members

# /home/coin/SVN-release/Blis-0.91.2/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 1408 2009-10-04 10:27:59Z stefan $
    00017 */
    00018
    00019 #include "CoinWarmStartBasis.hpp"
    00020
    00021 class CoinMessageHandler;
    00022
    00023 #define DYLP_INTERNAL
    00024 extern "C" {
    00025 #include "dylp.h"
    00026 }
    00027
    00028
    00029
    00041 class OsiDylpWarmStartBasis : public CoinWarmStartBasis
    00042
    00043 { public:
    00044
    00053
    00056   int numberActiveConstraints() const ;
    00057
    00058
    00061   inline Status getConStatus (int i) const
    00062
    00063   { const int st = (constraintStatus_[i>>2] >> ((i&3)<<1)) & 3 ;
    00064     return (static_cast<CoinWarmStartBasis::Status>(st)) ; }
    00065
    00066
    00069   inline void setConStatus (int i, Status st)
    00070
    00071   { char &st_byte = constraintStatus_[i>>2] ;
    00072     st_byte = static_cast<char>(st_byte & ~(3 << ((i&3)<<1))) ;
    00073     st_byte = static_cast<char>(st_byte | (st << ((i&3)<<1))) ; }
    00074
    00075
    00078   inline char *getConstraintStatus () { return (constraintStatus_) ; }
    00079
    00086   inline const char *getConstraintStatus () const
    00087
    00088   { return (constraintStatus_) ; }
    00089
    00090
    00093   inline void setPhase (dyphase_enum phase) { phase_ = phase ; }
    00094
    00097   inline dyphase_enum getPhase () const { return (phase_) ; }
    00098
    00100
    00103
    00106   CoinWarmStartDiff *generateDiff (const CoinWarmStart *const oldCWS) const ;
    00107
    00110   void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
    00111
    00113
    00116
    00119   void setSize (int ns, int na) ;
    00120
    00123   void resize (int numRows, int numCols) ;
    00124
    00137   void compressRows (int tgtCnt, const int *tgts) ;
    00138
    00146   void deleteRows (int number, const int *which) ;
    00147
    00161   virtual void mergeBasis(const CoinWarmStartBasis *src,
    00162                           const XferVec *xferRows,
    00163                           const XferVec *xferCols) ;
    00164
    00166
    00169
    00172   OsiDylpWarmStartBasis () ;
    00173
    00176   OsiDylpWarmStartBasis (int ns, int na, const char *sStat,
    00177                          const char *aStat, const char *cStat = 0) ;
    00178
    00181   OsiDylpWarmStartBasis (const CoinWarmStartBasis &cwsb) ;
    00182
    00185   OsiDylpWarmStartBasis (const OsiDylpWarmStartBasis &ws) ;
    00186
    00189   CoinWarmStart *clone () const ;
    00190
    00193   ~OsiDylpWarmStartBasis () ;
    00194
    00197   OsiDylpWarmStartBasis& operator= (const OsiDylpWarmStartBasis &rhs) ;
    00198
    00201   void assignBasisStatus
    00202     (int ns, int na, char *&sStat, char *&aStat, char *&cStat) ;
    00203
    00206   void assignBasisStatus
    00207     (int ns, int na, char *&sStat, char *&aStat) ;
    00208
    00209
    00211
    00214
    00217   void print () const ;
    00218
    00221   void checkBasis (CoinMessageHandler* msghandler = NULL) const ;
    00222
    00224
    00225   private:
    00226
    00229
    00230   dyphase_enum phase_ ;
    00231
    00232   char *constraintStatus_ ;
    00233
    00235
    00236 } ;
    00237
    00238
    00239
    00263 class OsiDylpWarmStartBasisDiff : public CoinWarmStartBasisDiff
    00264 { public:
    00265
    00267   virtual CoinWarmStartDiff *clone() const
    00268   { OsiDylpWarmStartBasisDiff *odwsbd =  new OsiDylpWarmStartBasisDiff(*this) ;
    00269     return (dynamic_cast<CoinWarmStartDiff *>(odwsbd)) ; }
    00270
    00272   virtual
    00273   OsiDylpWarmStartBasisDiff &operator= (const OsiDylpWarmStartBasisDiff &rhs) ;
    00274
    00276   virtual ~OsiDylpWarmStartBasisDiff()
    00277   { delete[] condiffNdxs_ ;
    00278     delete[] condiffVals_ ; }
    00279
    00280   private:
    00281
    00282   friend CoinWarmStartDiff *OsiDylpWarmStartBasis::generateDiff
    00283     (const CoinWarmStart *const oldCWS) const ;
    00284   friend void OsiDylpWarmStartBasis::applyDiff
    00285     (const CoinWarmStartDiff *const diff) ;
    00286
    00288   OsiDylpWarmStartBasisDiff (int sze, const unsigned int *const diffNdxs,
    00289                              const unsigned int *const diffVals,
    00290                              const CoinWarmStartBasisDiff *const cwsbd) ;
    00291
    00293   OsiDylpWarmStartBasisDiff ()
    00294     : CoinWarmStartBasisDiff(),
    00295       consze_(0),
    00296       condiffNdxs_(0),
    00297       condiffVals_(0)
    00298   { /* intentionally left blank */ }
    00299
    00306   OsiDylpWarmStartBasisDiff (const OsiDylpWarmStartBasisDiff &odwsbd) ;
    00307
    00308   /* Data members */
    00309
    00311   int consze_ ;
    00312
    00315   unsigned int *condiffNdxs_ ;
    00316
    00319   unsigned int *condiffVals_ ;
    00320
    00321 } ;
    00322
    00323
    00324
    00325 #endif // OsiDylpWarmStartBasis_H