CoinUtils 2.11.4
CoinWarmStartDual.hpp
Go to the documentation of this file.
1/* $Id$ */
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"
12
13//#############################################################################
14
17class CoinWarmStartDual : public virtual CoinWarmStart {
18public:
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 {
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
82protected:
83 inline const CoinWarmStartVector<double>& warmStartVector() const { return dual_; }
84#endif
85
87
88private:
91};
92
93//#############################################################################
94
111public:
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
130protected:
138 : diff_()
139 {
140 }
141
153 : diff_(rhs.diff_)
154 {
155 }
156
157private:
158 friend CoinWarmStartDiff *
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*/
\legal Copyright (C) 2000 – 2003, International Business Machines Corporation and others.
Abstract base class for warm start ‘diff’ objects.
A ‘diff’ between two CoinWarmStartDual objects.
virtual CoinWarmStartDiff * clone() const
‘Virtual constructor’
CoinWarmStartDualDiff(int sze, const unsigned int *const diffNdxs, const double *const diffVals)
Standard constructor.
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.
virtual ~CoinWarmStartDualDiff()
Destructor.
virtual CoinWarmStartDualDiff & operator=(const CoinWarmStartDualDiff &rhs)
Assignment.
WarmStart information that is only a dual vector.
const double * dual() const
return a pointer to the array of duals
CoinWarmStartDual(int size, const double *dual)
virtual CoinWarmStartDiff * generateDiff(const CoinWarmStart *const oldCWS) const
Generate a ‘diff’ that can convert the warm start passed as a parameter to the warm start specified b...
int size() const
return the size of the dual vector
CoinWarmStartDual & operator=(const CoinWarmStartDual &rhs)
CoinWarmStartDual(const CoinWarmStartDual &rhs)
virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff)
Apply diff to this warm start.
void assignDual(int size, double *&dual)
Assign the dual vector to be the warmstart information.
virtual CoinWarmStart * clone() const
‘Virtual constructor’
CoinWarmStartVector< double > dual_
void assignVector(int size, T *&vec)
Assign the vector to be the warmstart information.
const T * values() const
return a pointer to the array of vectors
int size() const
return the size of the vector
Abstract base class for warm start information.