CoinUtils 2.10.15

- 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 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
9 #include "CoinHelperFunctions.hpp"
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
31 CoinWarmStartDual() {}
32
33 CoinWarmStartDual(int size, const double * dual) : dual_(size, dual) {}
34
35 CoinWarmStartDual(const CoinWarmStartDual& rhs) : dual_(rhs.dual_) {}
36
37 CoinWarmStartDual& operator=(const CoinWarmStartDual& rhs) {
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:
81 CoinWarmStartVector<double> dual_;
82 };
83
84 //#############################################################################
85
101 class CoinWarmStartDualDiff : public virtual CoinWarmStartDiff
102 { public:
103
105 virtual CoinWarmStartDiff *clone() const
106 {
107 return new CoinWarmStartDualDiff(*this) ;
108 }
109
111 virtual CoinWarmStartDualDiff &operator= (const CoinWarmStartDualDiff &rhs)
112 {
113 if (this != &rhs) {
114 diff_ = rhs.diff_;
115 }
116 return *this;
117 }
118
120 virtual ~CoinWarmStartDualDiff() {}
121
122 protected:
123
130 CoinWarmStartDualDiff () : diff_() {}
131
142 CoinWarmStartDualDiff (const CoinWarmStartDualDiff &rhs) :
143 diff_(rhs.diff_) {}
144
145 private:
146
147 friend CoinWarmStartDiff*
148 CoinWarmStartDual::generateDiff(const CoinWarmStart *const oldCWS) const ;
149 friend void
150 CoinWarmStartDual::applyDiff(const CoinWarmStartDiff *const diff) ;
151
153 CoinWarmStartDualDiff (int sze, const unsigned int *const diffNdxs,
154 const double *const diffVals) :
155 diff_(sze, diffNdxs, diffVals) {}
156
161 CoinWarmStartVectorDiff<double> diff_;
162 };
163
164
165 #endif
166
CoinHelperFunctions.hpp
CoinWarmStartDualDiff::clone
virtual CoinWarmStartDiff * clone() const
`Virtual constructor&#39;
Definition: CoinWarmStartDual.hpp:105
CoinWarmStartVectorDiff< double >
CoinWarmStartDual::CoinWarmStartDual
CoinWarmStartDual(const CoinWarmStartDual &rhs)
Definition: CoinWarmStartDual.hpp:35
CoinWarmStartDual::size
int size() const
return the size of the dual vector
Definition: CoinWarmStartDual.hpp:21
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:18
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff(const CoinWarmStartDualDiff &rhs)
Copy constructor.
Definition: CoinWarmStartDual.hpp:142
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff()
Default constructor.
Definition: CoinWarmStartDual.hpp:130
CoinWarmStartDualDiff::diff_
CoinWarmStartVectorDiff< double > diff_
The difference in the dual vector is simply the difference in a vector.
Definition: CoinWarmStartDual.hpp:161
CoinWarmStartDual::dual
const double * dual() const
return a pointer to the array of duals
Definition: CoinWarmStartDual.hpp:23
CoinWarmStartDualDiff::~CoinWarmStartDualDiff
virtual ~CoinWarmStartDualDiff()
Destructor.
Definition: CoinWarmStartDual.hpp:120
CoinWarmStartDual::dual_
CoinWarmStartVector< double > dual_
Definition: CoinWarmStartDual.hpp:81
CoinWarmStartDual::CoinWarmStartDual
CoinWarmStartDual()
Definition: CoinWarmStartDual.hpp:31
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:33
CoinWarmStartVector.hpp
CoinWarmStartDual::assignDual
void assignDual(int size, double *&dual)
Assign the dual vector to be the warmstart information.
Definition: CoinWarmStartDual.hpp:28
CoinWarmStart.hpp
Copyright (C) 2000 – 2003, International Business Machines Corporation and others.
CoinWarmStartDual::clone
virtual CoinWarmStart * clone() const
`Virtual constructor&#39;
Definition: CoinWarmStartDual.hpp:45
CoinWarmStartDualDiff::CoinWarmStartDualDiff
CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs, const double *const diffVals)
Standard constructor.
Definition: CoinWarmStartDual.hpp:153
CoinWarmStartDiff
Abstract base class for warm start `diff&#39; objects.
Definition: CoinWarmStart.hpp:48
CoinWarmStartVector< double >
CoinWarmStartDualDiff
A `diff&#39; between two CoinWarmStartDual objects.
Definition: CoinWarmStartDual.hpp:101
CoinWarmStartDualDiff::operator=
virtual CoinWarmStartDualDiff & operator=(const CoinWarmStartDualDiff &rhs)
Assignment.
Definition: CoinWarmStartDual.hpp:111
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:37
CoinWarmStartDual::~CoinWarmStartDual
virtual ~CoinWarmStartDual()
Definition: CoinWarmStartDual.hpp:49
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