Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinWarmStartDual.hpp
Go to the documentation of this file.
1 /* $Id: CoinWarmStartDual.hpp 1372 2011-01-03 23:31:00Z lou $ */
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CoinWarmStartDual_H
7 #define CoinWarmStartDual_H
8 
10 #include "CoinWarmStart.hpp"
11 #include "CoinWarmStartVector.hpp"
12 
13 
14 //#############################################################################
15 
18 class CoinWarmStartDual : public virtual CoinWarmStart {
19 public:
21  inline int size() const { return dual_.size(); }
23  inline const double * dual() const { return dual_.values(); }
24 
28  inline void assignDual(int size, double *& dual)
29  { dual_.assignVector(size, dual); }
30 
32 
33  CoinWarmStartDual(int size, const double * dual) : dual_(size, dual) {}
34 
36 
38  if (this != &rhs) {
39  dual_ = rhs.dual_;
40  }
41  return *this;
42  }
43 
45  virtual CoinWarmStart *clone() const {
46  return new CoinWarmStartDual(*this);
47  }
48 
49  virtual ~CoinWarmStartDual() {}
50 
53 
61  virtual CoinWarmStartDiff*
62  generateDiff (const CoinWarmStart *const oldCWS) const ;
63 
70  virtual void applyDiff (const CoinWarmStartDiff *const cwsdDiff) ;
71 
72 #if 0
73 protected:
74  inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
75 #endif
76 
78 
79 private:
82 };
83 
84 //#############################################################################
85 
102 { public:
103 
105  virtual CoinWarmStartDiff *clone() const
106  {
107  return new CoinWarmStartDualDiff(*this) ;
108  }
109 
112  {
113  if (this != &rhs) {
114  diff_ = rhs.diff_;
115  }
116  return *this;
117  }
118 
121 
122  protected:
123 
131 
143  diff_(rhs.diff_) {}
144 
145  private:
146 
147  friend CoinWarmStartDiff*
148  CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const ;
149  friend void
151 
153  CoinWarmStartDualDiff (int sze, const unsigned int *const diffNdxs,
154  const double *const diffVals) :
155  diff_(sze, diffNdxs, diffVals) {}
156 
162 };
163 
164 
165 #endif
166 
virtual CoinWarmStartDiff * clone() const
`Virtual constructor&#39;
CoinWarmStartDual(const CoinWarmStartDual &rhs)
int size() const
return the size of the dual vector
void assignVector(int size, T *&vec)
Assign the vector to be the warmstart information.
WarmStart information that is only a dual vector.
CoinWarmStartDualDiff(const CoinWarmStartDualDiff &rhs)
Copy constructor.
CoinWarmStartDualDiff()
Default constructor.
CoinWarmStartVectorDiff< double > diff_
The difference in the dual vector is simply the difference in a vector.
const double * dual() const
return a pointer to the array of duals
virtual ~CoinWarmStartDualDiff()
Destructor.
CoinWarmStartVector< double > dual_
virtual CoinWarmStartDiff * generateDiff(const CoinWarmStart *const oldCWS) const
Generate a `diff&#39; that can convert the warm start passed as a parameter to the warm start specified b...
CoinWarmStartDual(int size, const double *dual)
void assignDual(int size, double *&dual)
Assign the dual vector to be the warmstart information.
Copyright (C) 2000 – 2003, International Business Machines Corporation and others.
virtual CoinWarmStart * clone() const
`Virtual constructor&#39;
CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs, const double *const diffVals)
Standard constructor.
Abstract base class for warm start `diff&#39; objects.
A `diff&#39; between two CoinWarmStartDual objects.
virtual CoinWarmStartDualDiff & operator=(const CoinWarmStartDualDiff &rhs)
Assignment.
int size() const
return the size of the vector
CoinWarmStartDual & operator=(const CoinWarmStartDual &rhs)
virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff)
Apply diff to this warm start.
const T * values() const
return a pointer to the array of vectors
Abstract base class for warm start information.