Clp 1.17.6

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

- File List
- File Members

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
9 #include "CoinHelperFunctions.hpp"
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
32 CoinWarmStartDual() {}
33
34 CoinWarmStartDual(int size, const double *dual)
35 : dual_(size, dual)
36 {
37 }
38
39 CoinWarmStartDual(const CoinWarmStartDual &rhs)
40 : dual_(rhs.dual_)
41 {
42 }
43
44 CoinWarmStartDual &operator=(const CoinWarmStartDual &rhs)
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:
90 CoinWarmStartVector< double > dual_;
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
119 virtual CoinWarmStartDualDiff &operator=(const CoinWarmStartDualDiff &rhs)
120 {
121 if (this != &rhs) {
122 diff_ = rhs.diff_;
123 }
124 return *this;
125 }
126
128 virtual ~CoinWarmStartDualDiff() {}
129
130 protected:
137 CoinWarmStartDualDiff()
138 : diff_()
139 {
140 }
141
152 CoinWarmStartDualDiff(const CoinWarmStartDualDiff &rhs)
153 : diff_(rhs.diff_)
154 {
155 }
156
157 private:
158 friend CoinWarmStartDiff *
159 CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const;
160 friend void
161 CoinWarmStartDual::applyDiff(const CoinWarmStartDiff *const diff);
162
164 CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs,
165 const double *const diffVals)
166 : diff_(sze, diffNdxs, diffVals)
167 {
168 }
169
174 CoinWarmStartVectorDiff< double > diff_;
175 };
176
177 #endif
178
179 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
180 */
CoinHelperFunctions.hpp
CoinWarmStartDualDiff::clone
virtual CoinWarmStartDiff * clone() const
`Virtual constructor&#39;
Definition: CoinWarmStartDual.hpp:113
CoinWarmStartVectorDiff< double >
CoinWarmStartDual::CoinWarmStartDual
CoinWarmStartDual(const CoinWarmStartDual &rhs)
Definition: CoinWarmStartDual.hpp:39
CoinWarmStartDual::dual_
CoinWarmStartVector< double > dual_
Definition: CoinWarmStartDual.hpp:90
CoinWarmStartDual::size
int size() const
return the size of the dual vector
Definition: CoinWarmStartDual.hpp:20
CoinWarmStartVector::assignVector
void assignVector(int size, T *&vec)
Assign the vector to be the warmstart information.
Definition: CoinWarmStartVector.hpp:47
CoinWarmStartDual
WarmStart information that is only a dual vector.
Definition: CoinWarmStartDual.hpp:17
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff(const CoinWarmStartDualDiff &rhs)
Copy constructor.
Definition: CoinWarmStartDual.hpp:152
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff()
Default constructor.
Definition: CoinWarmStartDual.hpp:137
CoinWarmStartDual::dual
const double * dual() const
return a pointer to the array of duals
Definition: CoinWarmStartDual.hpp:22
CoinWarmStartDualDiff::~CoinWarmStartDualDiff
virtual ~CoinWarmStartDualDiff()
Destructor.
Definition: CoinWarmStartDual.hpp:128
CoinWarmStartDual::CoinWarmStartDual
CoinWarmStartDual()
Definition: CoinWarmStartDual.hpp:32
CoinWarmStartDual::generateDiff
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::CoinWarmStartDual
CoinWarmStartDual(int size, const double *dual)
Definition: CoinWarmStartDual.hpp:34
CoinWarmStartVector.hpp
CoinWarmStartDual::assignDual
void assignDual(int size, double *&dual)
Assign the dual vector to be the warmstart information.
Definition: CoinWarmStartDual.hpp:27
CoinWarmStart.hpp
Copyright (C) 2000 – 2003, International Business Machines Corporation and others.
CoinWarmStartDualDiff::diff_
CoinWarmStartVectorDiff< double > diff_
The difference in the dual vector is simply the difference in a vector.
Definition: CoinWarmStartDual.hpp:174
CoinWarmStartDual::clone
virtual CoinWarmStart * clone() const
`Virtual constructor&#39;
Definition: CoinWarmStartDual.hpp:53
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs, const double *const diffVals)
Standard constructor.
Definition: CoinWarmStartDual.hpp:164
CoinWarmStartDiff
Abstract base class for warm start `diff&#39; objects.
Definition: CoinWarmStart.hpp:44
CoinWarmStartVector< double >
CoinWarmStartDualDiff
A `diff&#39; between two CoinWarmStartDual objects.
Definition: CoinWarmStartDual.hpp:110
CoinWarmStartDualDiff::operator=
virtual CoinWarmStartDualDiff & operator=(const CoinWarmStartDualDiff &rhs)
Assignment.
Definition: CoinWarmStartDual.hpp:119
CoinWarmStartVector::size
int size() const
return the size of the vector
Definition: CoinWarmStartVector.hpp:40
CoinWarmStartDual::operator=
CoinWarmStartDual & operator=(const CoinWarmStartDual &rhs)
Definition: CoinWarmStartDual.hpp:44
CoinWarmStartDual::~CoinWarmStartDual
virtual ~CoinWarmStartDual()
Definition: CoinWarmStartDual.hpp:58
CoinWarmStartDual::applyDiff
virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff)
Apply diff to this warm start.
CoinWarmStartVector::values
const T * values() const
return a pointer to the array of vectors
Definition: CoinWarmStartVector.hpp:42
CoinWarmStart
Abstract base class for warm start information.
Definition: CoinWarmStart.hpp:21