Bcp  1.4.4
BCP_warmstart_basis.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _BCP_WARMSTART_BASIS_H
4 #define _BCP_WARMSTART_BASIS_H
5 
6 #include "BCP_warmstart.hpp"
7 #include "BCP_vector_change.hpp"
8 
9 /* NOTE:
10  Doxygen gracefully generates description for all inherited methods if they
11  are not documented here. So the virtual methods are documented ONLY if they
12  have something additional to say.
13 */
14 
15 //#############################################################################
16 
25 private:
27  BCP_warmstart_basis& operator=(const BCP_warmstart_basis&);
28 
33  _var_stat(BCP_Storage_WrtParent), _cut_stat(BCP_Storage_WrtParent) {}
34 
35 private:
37  BCP_vec_change<char> _var_stat;
39  BCP_vec_change<char> _cut_stat;
40 
41 public:
45  BCP_warmstart_basis(BCP_buffer& buf) : _var_stat(buf), _cut_stat(buf) {}
50  BCP_warmstart_basis(const char* vfirst, const char* vlast,
51  const char* cfirst, const char* clast) :
52  _var_stat(vfirst, vlast), _cut_stat(cfirst, clast) {}
55  _var_stat(ws._var_stat), _cut_stat(ws._cut_stat) {}
56 
60  // Inherited methods --------------------------------------------------------
61 
65  virtual CoinWarmStart* convert_to_CoinWarmStart() const;
66 
67  virtual BCP_storage_t storage() const;
68 
69  virtual BCP_warmstart* clone() const {
70  return new BCP_warmstart_basis(*this);
71  }
72 
73  virtual BCP_warmstart* empty_wrt_this() const {
74  // The default constructor creates an empty WrtParent warmstart info
75  // (i.e., no change wrt the parent)
76  return new BCP_warmstart_basis();
77  }
78 
79  virtual int storage_size() const {
80  return _var_stat.storage_size() + _cut_stat.storage_size();
81  }
82 
83  virtual void update(const BCP_warmstart* const change);
84 
85  virtual BCP_warmstart* as_change(const BCP_warmstart* const old_ws,
86  const BCP_vec<int>& del_vars,
87  const BCP_vec<int>& del_cuts,
88  const double petol,
89  const double detol) const;
90 
91  // Not inherited methods ----------------------------------------------------
92 
94  void pack(BCP_buffer& buf) const {
95  _var_stat.pack(buf);
96  _cut_stat.pack(buf);
97  }
98 };
99 
100 #endif
virtual BCP_warmstart * clone() const
Make a replica of the current warmstart information.
virtual void update(const BCP_warmstart *const change)
Update the current data with the one in the argument.
void pack(BCP_buffer &buf) const
Pack the warmstart info into a buffer.
BCP_warmstart_basis(const BCP_warmstart_basis &ws)
Copy constructor.
virtual int storage_size() const
Return how much memory it&#39;ll take to pack this warmstart info.
int storage_size() const
Return how much memory it&#39;ll take to pack this info.
BCP_storage_t
This enumerative constant describes how to store certain data for a search tree node.
Definition: BCP_enum.hpp:84
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
Warmstarting information for the LP solver.
virtual BCP_storage_t storage() const
Return how the warmstarting info is stored.
This class describes a warmstart information that consists of basis information for structural and ar...
void pack(BCP_buffer &buf) const
Pack the data into a buffer.
BCP_warmstart_basis(const char *vfirst, const char *vlast, const char *cfirst, const char *clast)
Create an explicitly stored warmstart info by considering the two character arrays ([vfirst...
virtual BCP_warmstart * empty_wrt_this() const
Create a warmstart info describing that no change should be done.
The data stored is with respect to the same kind of data in the parent of the search tree node...
Definition: BCP_enum.hpp:91
BCP_warmstart_basis(BCP_buffer &buf)
Create the object by unpacking it from a buffer.
virtual CoinWarmStart * convert_to_CoinWarmStart() const
Return an CoinwarmStart object that can be fed to the LP engine.
virtual BCP_warmstart * as_change(const BCP_warmstart *const old_ws, const BCP_vec< int > &del_vars, const BCP_vec< int > &del_cuts, const double petol, const double detol) const
Return a pointer to a warmstart info describing the currently stored data as a change with respect to...