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

- File List
- File Members

# /home/coin/SVN-release/Blis-0.92.0/CoinUtils/src/CoinWarmStartDual.hpp

Go to the documentation of this file.

    00001 /* $Id: CoinWarmStartDual.hpp 1372 2011-01-03 23:31:00Z lou $ */
    00002 // Copyright (C) 2000, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
    00005
    00006 #ifndef CoinWarmStartDual_H
    00007 #define CoinWarmStartDual_H
    00008
    00009 #include "CoinHelperFunctions.hpp"
    00010 #include "CoinWarmStart.hpp"
    00011 #include "CoinWarmStartVector.hpp"
    00012
    00013
    00014 //#############################################################################
    00015
    00018 class CoinWarmStartDual : public virtual CoinWarmStart {
    00019 public:
    00021    inline int size() const { return dual_.size(); }
    00023    inline const double * dual() const { return dual_.values(); }
    00024
    00028    inline void assignDual(int size, double *& dual)
    00029     { dual_.assignVector(size, dual); }
    00030
    00031    CoinWarmStartDual() {}
    00032
    00033    CoinWarmStartDual(int size, const double * dual) : dual_(size, dual) {}
    00034
    00035    CoinWarmStartDual(const CoinWarmStartDual& rhs) : dual_(rhs.dual_) {}
    00036
    00037    CoinWarmStartDual& operator=(const CoinWarmStartDual& rhs) {
    00038      if (this != &rhs) {
    00039        dual_ = rhs.dual_;
    00040      }
    00041      return *this;
    00042    }
    00043
    00045    virtual CoinWarmStart *clone() const {
    00046       return new CoinWarmStartDual(*this);
    00047    }
    00048
    00049    virtual ~CoinWarmStartDual() {}
    00050
    00053
    00061   virtual CoinWarmStartDiff*
    00062   generateDiff (const CoinWarmStart *const oldCWS) const ;
    00063
    00070   virtual void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
    00071
    00072 #if 0
    00073 protected:
    00074   inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
    00075 #endif
    00076
    00078
    00079 private:
    00081   CoinWarmStartVector<double> dual_;
    00082 };
    00083
    00084 //#############################################################################
    00085
    00101 class CoinWarmStartDualDiff : public virtual CoinWarmStartDiff
    00102 { public:
    00103
    00105   virtual CoinWarmStartDiff *clone() const
    00106   {
    00107       return new CoinWarmStartDualDiff(*this) ;
    00108   }
    00109
    00111   virtual CoinWarmStartDualDiff &operator= (const CoinWarmStartDualDiff &rhs)
    00112   {
    00113       if (this != &rhs) {
    00114           diff_ = rhs.diff_;
    00115       }
    00116       return *this;
    00117   }
    00118
    00120   virtual ~CoinWarmStartDualDiff() {}
    00121
    00122   protected:
    00123
    00130   CoinWarmStartDualDiff () : diff_() {}
    00131
    00142   CoinWarmStartDualDiff (const CoinWarmStartDualDiff &rhs) :
    00143       diff_(rhs.diff_) {}
    00144
    00145   private:
    00146
    00147   friend CoinWarmStartDiff*
    00148     CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const ;
    00149   friend void
    00150     CoinWarmStartDual::applyDiff(const CoinWarmStartDiff *const diff) ;
    00151
    00153   CoinWarmStartDualDiff (int sze, const unsigned int *const diffNdxs,
    00154                          const double *const diffVals) :
    00155       diff_(sze, diffNdxs, diffVals) {}
    00156
    00161   CoinWarmStartVectorDiff<double> diff_;
    00162 };
    00163
    00164
    00165 #endif
    00166