Debian Codegraph @

Bonmin/src/Interfaces/Filter/BonBqpdWarmStart.hpp

raw
1 // (C) Copyright International Business Machines Corporation 2007
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Andreas Waechter, International Business Machines Corporation
7 // based on BonFilterWarmStart.hpp
8 //
9 // Date : 2007-08-03
10
11
12 #ifndef BonBqpdWarmStart_H
13 #define BonBqpdWarmStart_H
14
15 #include "CoinWarmStartBasis.hpp"
16 #include "CoinWarmStartPrimalDual.hpp"
17 #include "BonFilterSolver.hpp" /* for types */
18
19 #include <vector>
20
21 namespace Bonmin{
22
23 /** Warm start for filter interface.
24 * Warm start for filter constists of a (possibly huge) array of integers.
25 * This class inherits from CoinWarmStartPrimalDual, because that's what
26 * this warmstart really is. <br>
27 * For practical reason (integration in Cbc) this class also inherits from
28 * CoinWarmStartBasis. <br>
29 */
30 class BqpdWarmStart :
31 public virtual CoinWarmStartPrimalDual, public virtual CoinWarmStartBasis,
32 public Coin::ReferencedObject
33 {
34 typedef FilterSolver::fint fint;
35 typedef FilterSolver::real real;
36
37 public:
38 /** Default values for istat */
39 static fint def_istat[14];
40 /** Constructor */
41 BqpdWarmStart(const fint xSize = 0,
42 const real* xArray = NULL,
43 const fint lamSize = 0,
44 const real* lamArray = NULL,
45 const fint lwsSize = 0,
46 const fint *lwsArray = NULL,
47 const fint istat[14] = def_istat);
48
49 /** Copy constructor */
50 BqpdWarmStart(const BqpdWarmStart & other);
51
52 /** constructor from a CoinWarmStartPrimalDual */
53 BqpdWarmStart(const CoinWarmStartPrimalDual& pdws);
54
55 /** virtual copy */
56 virtual CoinWarmStart * clone() const
57 { return new BqpdWarmStart(*this);}
58
59 /** Destructor. */
60 virtual ~BqpdWarmStart();
61
62 /** Generate differences.*/
63 virtual CoinWarmStartDiff* generateDiff(const CoinWarmStart * const other) const;
64
65 /** Apply differences. */
66 virtual void applyDiff(const CoinWarmStartDiff * const cswDiff);
67
68 /** Access to lws array */
69 const fint *lwsArray() const{
70 return lwsArray_;
71 }
72
73 /** Access to lws size. */
74 fint lwsSize() const {
75 return lwsSize_;}
76
77 const fint* istat()const {
78 return istat_;}
79
80 void flushPoint();
81
82 ///Is this an empty warm start?
83 bool empty() const
84 {
85 return empty_;
86 }
87 private:
88 /** Size of fint lws array store. */
89 fint lwsSize_;
90
91 /** fint lws array to store */
92 fint* lwsArray_;
93
94 /** Filter's istat (AW: I think we only need first entry) */
95 fint istat_[14];
96 ///Say if warm start is empty
97 bool empty_;
98 };
99
100 } /* end namespace Bonmin */
101 #endif
102