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
BCP_warmstart_basis::BCP_warmstart_basis
BCP_warmstart_basis(const BCP_warmstart_basis &ws)
Copy constructor.
Definition: BCP_warmstart_basis.hpp:54
BCP_warmstart_basis::clone
virtual BCP_warmstart * clone() const
Make a replica of the current warmstart information.
Definition: BCP_warmstart_basis.hpp:69
BCP_Storage_WrtParent
@ BCP_Storage_WrtParent
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::empty_wrt_this
virtual BCP_warmstart * empty_wrt_this() const
Create a warmstart info describing that no change should be done.
Definition: BCP_warmstart_basis.hpp:73
BCP_warmstart_basis::storage_size
virtual int storage_size() const
Return how much memory it'll take to pack this warmstart info.
Definition: BCP_warmstart_basis.hpp:79
BCP_warmstart.hpp
BCP_vec< int >
BCP_vec_change::storage_size
int storage_size() const
Return how much memory it'll take to pack this info.
Definition: BCP_vector_change.hpp:161
BCP_warmstart_basis::BCP_warmstart_basis
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,...
Definition: BCP_warmstart_basis.hpp:50
BCP_warmstart_basis::storage
virtual BCP_storage_t storage() const
Return how the warmstarting info is stored.
BCP_vec_change< char >
BCP_vector_change.hpp
BCP_warmstart_basis::pack
void pack(BCP_buffer &buf) const
Pack the warmstart info into a buffer.
Definition: BCP_warmstart_basis.hpp:94
BCP_vec_change::pack
void pack(BCP_buffer &buf) const
Pack the data into a buffer.
Definition: BCP_vector_change.hpp:208
BCP_warmstart_basis
This class describes a warmstart information that consists of basis information for structural and ar...
Definition: BCP_warmstart_basis.hpp:24
CoinWarmStart
BCP_warmstart_basis::convert_to_CoinWarmStart
virtual CoinWarmStart * convert_to_CoinWarmStart() const
Return an CoinwarmStart object that can be fed to the LP engine.
BCP_warmstart_basis::as_change
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...
BCP_warmstart_basis::~BCP_warmstart_basis
~BCP_warmstart_basis()
Definition: BCP_warmstart_basis.hpp:57
BCP_storage_t
BCP_storage_t
This enumerative constant describes how to store certain data for a search tree node.
Definition: BCP_enum.hpp:84
BCP_warmstart
Warmstarting information for the LP solver.
Definition: BCP_warmstart.hpp:24
BCP_warmstart_basis::BCP_warmstart_basis
BCP_warmstart_basis(BCP_buffer &buf)
Create the object by unpacking it from a buffer.
Definition: BCP_warmstart_basis.hpp:45
BCP_buffer
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
BCP_warmstart_basis::update
virtual void update(const BCP_warmstart *const change)
Update the current data with the one in the argument.