Cgl  0.60.3
 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 2083 2019-01-06 19:38:09Z unxusr $ */
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 
17 class CoinWarmStartDual : public virtual CoinWarmStart {
18 public:
20  inline int size() const { return dual_.size(); }
22  inline const double *dual() const { return dual_.values(); }
23 
27  inline void assignDual(int size, double *&dual)
28  {
29  dual_.assignVector(size, dual);
30  }
31 
33 
34  CoinWarmStartDual(int size, const double *dual)
35  : dual_(size, dual)
36  {
37  }
38 
40  : dual_(rhs.dual_)
41  {
42  }
43 
45  {
46  if (this != &rhs) {
47  dual_ = rhs.dual_;
48  }
49  return *this;
50  }
51 
53  virtual CoinWarmStart *clone() const
54  {
55  return new CoinWarmStartDual(*this);
56  }
57 
58  virtual ~CoinWarmStartDual() {}
59 
62 
70  virtual CoinWarmStartDiff *
71  generateDiff(const CoinWarmStart *const oldCWS) const;
72 
79  virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff);
80 
81 #if 0
82 protected:
83  inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
84 #endif
85 
87 
88 private:
91 };
92 
93 //#############################################################################
94 
110 class CoinWarmStartDualDiff : public virtual CoinWarmStartDiff {
111 public:
113  virtual CoinWarmStartDiff *clone() const
114  {
115  return new CoinWarmStartDualDiff(*this);
116  }
117 
120  {
121  if (this != &rhs) {
122  diff_ = rhs.diff_;
123  }
124  return *this;
125  }
126 
129 
130 protected:
138  : diff_()
139  {
140  }
141 
153  : diff_(rhs.diff_)
154  {
155  }
156 
157 private:
158  friend CoinWarmStartDiff *
159  CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const;
160  friend void
162 
164  CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs,
165  const double *const diffVals)
166  : diff_(sze, diffNdxs, diffVals)
167  {
168  }
169 
175 };
176 
177 #endif
178 
179 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
180 */
virtual CoinWarmStartDiff * clone() const
`Virtual constructor&#39;
CoinWarmStartDual(const CoinWarmStartDual &rhs)
CoinWarmStartVector< double > dual_
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.
const double * dual() const
return a pointer to the array of duals
virtual ~CoinWarmStartDualDiff()
Destructor.
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.
CoinWarmStartVectorDiff< double > diff_
The difference in the dual vector is simply the difference in a vector.
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.