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

- File List
- File Members

# /home/coin/SVN-release/Alps-1.2.1/CoinUtils/src/CoinWarmStartDual.hpp

Go to the documentation of this file.

    00001 /* $Id: CoinWarmStartDual.hpp 1191 2009-07-25 08:38:12Z forrest $ */
    00002 // Copyright (C) 2000, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004
    00005 #ifndef CoinWarmStartDual_H
    00006 #define CoinWarmStartDual_H
    00007
    00008 #include "CoinHelperFunctions.hpp"
    00009 #include "CoinWarmStart.hpp"
    00010 #include "CoinWarmStartVector.hpp"
    00011
    00012
    00013 //#############################################################################
    00014
    00017 class CoinWarmStartDual : public virtual CoinWarmStart {
    00018 public:
    00020    inline int size() const { return dual_.size(); }
    00022    inline const double * dual() const { return dual_.values(); }
    00023
    00027    inline void assignDual(int size, double *& dual)
    00028     { dual_.assignVector(size, dual); }
    00029
    00030    CoinWarmStartDual() {}
    00031
    00032    CoinWarmStartDual(int size, const double * dual) : dual_(size, dual) {}
    00033
    00034    CoinWarmStartDual(const CoinWarmStartDual& rhs) : dual_(rhs.dual_) {}
    00035
    00036    CoinWarmStartDual& operator=(const CoinWarmStartDual& rhs) {
    00037      if (this != &rhs) {
    00038        dual_ = rhs.dual_;
    00039      }
    00040      return *this;
    00041    }
    00042
    00044    virtual CoinWarmStart *clone() const {
    00045       return new CoinWarmStartDual(*this);
    00046    }
    00047
    00048    virtual ~CoinWarmStartDual() {}
    00049
    00052
    00060   virtual CoinWarmStartDiff*
    00061   generateDiff (const CoinWarmStart *const oldCWS) const ;
    00062
    00069   virtual void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
    00070
    00071 #if 0
    00072 protected:
    00073   inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
    00074 #endif
    00075
    00077
    00078 private:
    00080   CoinWarmStartVector<double> dual_;
    00081 };
    00082
    00083 //#############################################################################
    00084
    00100 class CoinWarmStartDualDiff : public virtual CoinWarmStartDiff
    00101 { public:
    00102
    00104   virtual CoinWarmStartDiff *clone() const
    00105   {
    00106       return new CoinWarmStartDualDiff(*this) ;
    00107   }
    00108
    00110   virtual CoinWarmStartDualDiff &operator= (const CoinWarmStartDualDiff &rhs)
    00111   {
    00112       if (this != &rhs) {
    00113           diff_ = rhs.diff_;
    00114       }
    00115       return *this;
    00116   }
    00117
    00119   virtual ~CoinWarmStartDualDiff() {}
    00120
    00121   protected:
    00122
    00129   CoinWarmStartDualDiff () : diff_() {}
    00130
    00141   CoinWarmStartDualDiff (const CoinWarmStartDualDiff &rhs) :
    00142       diff_(rhs.diff_) {}
    00143
    00144   private:
    00145
    00146   friend CoinWarmStartDiff*
    00147     CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const ;
    00148   friend void
    00149     CoinWarmStartDual::applyDiff(const CoinWarmStartDiff *const diff) ;
    00150
    00152   CoinWarmStartDualDiff (int sze, const unsigned int *const diffNdxs,
    00153                          const double *const diffVals) :
    00154       diff_(sze, diffNdxs, diffVals) {}
    00155
    00160   CoinWarmStartVectorDiff<double> diff_;
    00161 };
    00162
    00163
    00164 #endif
    00165