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

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.52.0/CoinUtils/src/CoinWarmStartDual.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2000, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003
    00004 #ifndef CoinWarmStartDual_H
    00005 #define CoinWarmStartDual_H
    00006
    00007 #include "CoinHelperFunctions.hpp"
    00008 #include "CoinWarmStart.hpp"
    00009 #include "CoinWarmStartVector.hpp"
    00010
    00011
    00012 //#############################################################################
    00013
    00016 class CoinWarmStartDual : public virtual CoinWarmStart {
    00017 public:
    00019    inline int size() const { return dual_.size(); }
    00021    inline const double * dual() const { return dual_.values(); }
    00022
    00026    inline void assignDual(int size, double *& dual)
    00027     { dual_.assignVector(size, dual); }
    00028
    00029    CoinWarmStartDual() {}
    00030
    00031    CoinWarmStartDual(int size, const double * dual) : dual_(size, dual) {}
    00032
    00033    CoinWarmStartDual(const CoinWarmStartDual& rhs) : dual_(rhs.dual_) {}
    00034
    00035    CoinWarmStartDual& operator=(const CoinWarmStartDual& rhs) {
    00036      if (this != &rhs) {
    00037        dual_ = rhs.dual_;
    00038      }
    00039      return *this;
    00040    }
    00041
    00043    virtual CoinWarmStart *clone() const {
    00044       return new CoinWarmStartDual(*this);
    00045    }
    00046
    00047    virtual ~CoinWarmStartDual() {}
    00048
    00051
    00059   virtual CoinWarmStartDiff*
    00060   generateDiff (const CoinWarmStart *const oldCWS) const ;
    00061
    00068   virtual void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
    00069
    00070 #if 0
    00071 protected:
    00072   inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
    00073 #endif
    00074
    00076
    00077 private:
    00079   CoinWarmStartVector<double> dual_;
    00080 };
    00081
    00082 //#############################################################################
    00083
    00099 class CoinWarmStartDualDiff : public virtual CoinWarmStartDiff
    00100 { public:
    00101
    00103   virtual CoinWarmStartDiff *clone() const
    00104   {
    00105       return new CoinWarmStartDualDiff(*this) ;
    00106   }
    00107
    00109   virtual CoinWarmStartDualDiff &operator= (const CoinWarmStartDualDiff &rhs)
    00110   {
    00111       if (this != &rhs) {
    00112           diff_ = rhs.diff_;
    00113       }
    00114       return *this;
    00115   }
    00116
    00118   virtual ~CoinWarmStartDualDiff() {}
    00119
    00120   protected:
    00121
    00128   CoinWarmStartDualDiff () : diff_() {}
    00129
    00140   CoinWarmStartDualDiff (const CoinWarmStartDualDiff &rhs) :
    00141       diff_(rhs.diff_) {}
    00142
    00143   private:
    00144
    00145   friend CoinWarmStartDiff*
    00146     CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const ;
    00147   friend void
    00148     CoinWarmStartDual::applyDiff(const CoinWarmStartDiff *const diff) ;
    00149
    00151   CoinWarmStartDualDiff (int sze, const unsigned int *const diffNdxs,
    00152                          const double *const diffVals) :
    00153       diff_(sze, diffNdxs, diffVals) {}
    00154
    00159   CoinWarmStartVectorDiff<double> diff_;
    00160 };
    00161
    00162
    00163 #endif
    00164