CoinUtils 2.11.10
Loading...
Searching...
No Matches
CoinWarmStartPrimalDual.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 CoinWarmStartPrimalDual_H
7#define CoinWarmStartPrimalDual_H
8
10#include "CoinWarmStart.hpp"
12
13//#############################################################################
14
17class CoinWarmStartPrimalDual : public virtual CoinWarmStart {
18public:
20 inline int dualSize() const { return dual_.size(); }
22 inline const double *dual() const { return dual_.values(); }
23
25 inline int primalSize() const { return primal_.size(); }
27 inline const double *primal() const { return primal_.values(); }
28
38 void assign(int primalSize, int dualSize, double *&primal, double *&dual)
39 {
42 }
43
45 : primal_()
46 , dual_()
47 {
48 }
49
51 const double *primal, const double *dual)
54 {
55 }
56
58 : primal_(rhs.primal_)
59 , dual_(rhs.dual_)
60 {
61 }
62
64 {
65 if (this != &rhs) {
66 primal_ = rhs.primal_;
67 dual_ = rhs.dual_;
68 }
69 return *this;
70 }
71
77 inline void clear()
78 {
79 primal_.clear();
80 dual_.clear();
81 }
82
83 inline void swap(CoinWarmStartPrimalDual &rhs)
84 {
85 if (this != &rhs) {
86 primal_.swap(rhs.primal_);
87 dual_.swap(rhs.dual_);
88 }
89 }
90
92 virtual CoinWarmStart *clone() const
93 {
94 return new CoinWarmStartPrimalDual(*this);
95 }
96
98
101
109 virtual CoinWarmStartDiff *
110 generateDiff(const CoinWarmStart *const oldCWS) const;
111
118 virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff);
119
121
122#if 0
123protected:
125 { return primal_; }
127 { return dual_; }
128#endif
129
130private:
132
136};
137
138//#############################################################################
139
157 friend CoinWarmStartDiff *
159 friend void
161
162public:
165 virtual CoinWarmStartDiff *clone() const
166 {
167 return new CoinWarmStartPrimalDualDiff(*this);
168 }
169
172
173protected:
181 : primalDiff_()
182 , dualDiff_()
183 {
184 }
185
201
207 inline void clear()
208 {
211 }
212
214 {
215 if (this != &rhs) {
218 }
219 }
220
221private:
228};
229
230#endif
231
232/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
233*/
\legal Copyright (C) 2000 – 2003, International Business Machines Corporation and others.
Abstract base class for warm start ‘diff’ objects.
A ‘diff’ between two CoinWarmStartPrimalDual objects.
CoinWarmStartVectorDiff< double > primalDiff_
These two differences describe the differences in the primal and in the dual vector.
CoinWarmStartPrimalDualDiff(const CoinWarmStartPrimalDualDiff &rhs)
Copy constructor.
virtual CoinWarmStartDiff * clone() const
‘Virtual constructor’.
void swap(CoinWarmStartPrimalDualDiff &rhs)
CoinWarmStartPrimalDualDiff()
Default constructor.
CoinWarmStartVectorDiff< double > dualDiff_
virtual ~CoinWarmStartPrimalDualDiff()
Destructor.
WarmStart information that is only a dual vector.
void assign(int primalSize, int dualSize, double *&primal, double *&dual)
Assign the primal/dual vectors to be the warmstart information.
CoinWarmStartPrimalDual & operator=(const CoinWarmStartPrimalDual &rhs)
int dualSize() const
return the size of the dual vector
virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff)
Apply diff to this warm start.
const double * dual() const
return a pointer to the array of duals
virtual CoinWarmStart * clone() const
‘Virtual constructor’
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...
CoinWarmStartPrimalDual(const CoinWarmStartPrimalDual &rhs)
CoinWarmStartVector< double > dual_
void swap(CoinWarmStartPrimalDual &rhs)
CoinWarmStartPrimalDual(int primalSize, int dualSize, const double *primal, const double *dual)
const double * primal() const
return a pointer to the array of primals
CoinWarmStartVector< double > primal_
int primalSize() const
return the size of the primal vector
void clear()
Clear the data.
void swap(CoinWarmStartVectorDiff &rhs)
void assignVector(int size, T *&vec)
Assign the vector to be the warmstart information.
void swap(CoinWarmStartVector &rhs)
const T * values() const
return a pointer to the array of vectors
void clear()
Clear the data.
int size() const
return the size of the vector
Abstract base class for warm start information.
An ordered pair.
Definition CoinSort.hpp:30