Bcp  1.4.4
BCP_problem_core.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_PROBLEM_CORE_H
4 #define _BCP_PROBLEM_CORE_H
5 
6 // This file is fully docified.
7 
8 #include "BCP_vector.hpp"
9 #include "BCP_matrix.hpp"
10 #include "BCP_buffer.hpp"
11 #include "BCP_enum.hpp"
12 #include "BCP_obj_change.hpp"
13 
14 //#############################################################################
15 
16 class BCP_var_core;
17 class BCP_cut_core;
18 class BCP_indexed_pricing_list;
19 
20 class BCP_buffer;
21 
22 class BCP_internal_brobj;
23 
24 //#############################################################################
25 
32 private:
37  inline void clear();
41  BCP_problem_core& operator=(const BCP_problem_core&);
43 public:
56 public:
66  BCP_lp_relax*& m) : vars(), cuts(), matrix(m) {
67  vars.swap(v);
68  cuts.swap(c);
69  m = 0;
70  }
78  inline size_t varnum() const { return vars.size(); }
80  inline size_t cutnum() const { return cuts.size(); }
86  void pack(BCP_buffer& buf) const; // *INLINE ?*
88  void unpack(BCP_buffer& buf); // *INLINE ?*
90 };
91 
92 //#############################################################################
93 
94 // The following class holds the change in the core. It may be WrtParent,
95 // WrtCore or Explicit. In the latter case indices is empty.
96 
117 private:
121  inline void clear();
127 public:
160 public:
170  _storage(store), var_pos(), var_ch(), cut_pos(), cut_ch() {}
171 
176  int bcutnum, BCP_cut_set& cuts);
177 
186  BCP_problem_core_change& ncore);
187 
190 
191  /* Default assignment operator is OK. */
192 
198  inline BCP_storage_t storage() const { return _storage; }
201  inline size_t varnum() const { return var_ch.size(); }
204  inline size_t cutnum() const { return cut_ch.size(); }
212 
220  void ensure_explicit(const BCP_problem_core_change& expl_core);
221 
229 
233 
250  void update(const BCP_problem_core_change& expl_core,
251  const BCP_problem_core_change& core_change);
257  int pack_size() const;
259  void pack(BCP_buffer& buf) const;
261  void unpack(BCP_buffer& buf);
263 };
264 
265 #endif
BCP_vector.hpp
BCP_problem_core_change::swap
void swap(BCP_problem_core_change &other)
Swap the contents of the current core change with that of other.
BCP_problem_core_change::var_pos
BCP_vec< int > var_pos
The positions of the core variables (in the vars member of \URL[BCP_problem_core]{BCP_problem_core....
Definition: BCP_problem_core.hpp:147
BCP_problem_core::vars
BCP_vec< BCP_var_core * > vars
A vector of pointers to the variables in the core of the problem.
Definition: BCP_problem_core.hpp:48
BCP_problem_core_change::cut_pos
BCP_vec< int > cut_pos
The positions of the core cuts (in the cuts member of \URL[BCP_problem_core]{BCP_problem_core....
Definition: BCP_problem_core.hpp:154
BCP_Storage_WrtCore
@ BCP_Storage_WrtCore
The data stored is with respect to the original description of the base problem (as was given by the ...
Definition: BCP_enum.hpp:94
BCP_problem_core::pack
void pack(BCP_buffer &buf) const
Pack the contents of the core description into the buffer.
BCP_matrix.hpp
BCP_enum.hpp
BCP_vec< BCP_var_core * >
BCP_problem_core::cuts
BCP_vec< BCP_cut_core * > cuts
A vector of pointers to the cuts in the core of the problem.
Definition: BCP_problem_core.hpp:51
BCP_problem_core::cutnum
size_t cutnum() const
Return the number of cuts in the core.
Definition: BCP_problem_core.hpp:80
BCP_problem_core_change::BCP_problem_core_change
BCP_problem_core_change(int bvarnum, BCP_var_set &vars, int bcutnum, BCP_cut_set &cuts)
This constructor creates an Explicit core change description.
BCP_vec::size
size_t size() const
Return the current number of entries.
Definition: BCP_vector.hpp:116
BCP_problem_core_change::operator=
BCP_problem_core_change & operator=(const BCP_problem_core &core)
Set the core change description to be an explicit description (in the form of a change) of the given ...
BCP_problem_core_change::pack
void pack(BCP_buffer &buf) const
Pack the core change into the buffer.
BCP_var_core
Core variables are the variables that always stay in the LP formulation.
Definition: BCP_var.hpp:230
BCP_problem_core_change::cutnum
size_t cutnum() const
Return the number of changed cuts (the length of the array cut_ch).
Definition: BCP_problem_core.hpp:204
BCP_obj_change.hpp
BCP_vec::swap
void swap(BCP_vec< T > &x)
Exchange the contents of the object with that of x.
Definition: BCP_vector_general.hpp:124
BCP_problem_core_change::pack_size
int pack_size() const
Return the buffer size needed to pack the data in the core change.
BCP_problem_core_change::update
void update(const BCP_problem_core_change &expl_core, const BCP_problem_core_change &core_change)
Update the current change according to core_change.
BCP_problem_core::BCP_problem_core
BCP_problem_core(BCP_vec< BCP_var_core * > &v, BCP_vec< BCP_cut_core * > &c, BCP_lp_relax *&m)
This constructor "takes over" the arguments.
Definition: BCP_problem_core.hpp:65
BCP_problem_core
This class describes the core of the MIP problem, the variables/cuts in it as well as the matrix corr...
Definition: BCP_problem_core.hpp:31
BCP_problem_core::matrix
BCP_lp_relax * matrix
A pointer to the constraint matrix corresponding to the core variables and cuts.
Definition: BCP_problem_core.hpp:54
BCP_problem_core_change::cut_ch
BCP_vec< BCP_obj_change > cut_ch
The new lb/ub/status triplet for each cut for which any of those three have changed.
Definition: BCP_problem_core.hpp:157
BCP_cut_set
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts...
Definition: BCP_cut.hpp:279
BCP_problem_core::varnum
size_t varnum() const
Return the number of variables in the core.
Definition: BCP_problem_core.hpp:78
BCP_problem_core_change::var_ch
BCP_vec< BCP_obj_change > var_ch
The new lb/ub/status triplet for each variable for which any of those three have changed.
Definition: BCP_problem_core.hpp:150
BCP_problem_core_change::BCP_problem_core_change
BCP_problem_core_change(BCP_storage_t storage, BCP_problem_core_change &ocore, BCP_problem_core_change &ncore)
Create a core change describing the changes from old_bc</node> to new_bc.
BCP_internal_brobj
This class is the internal representation of a branching object.
Definition: BCP_branch.hpp:31
BCP_lp_relax
An object of type BCP_lp_relax holds the description of an lp relaxation.
Definition: BCP_matrix.hpp:267
BCP_problem_core_change::varnum
size_t varnum() const
Return the number of changed variables (the length of the array var_ch).
Definition: BCP_problem_core.hpp:201
BCP_problem_core_change::storage
BCP_storage_t storage() const
Return the storage type.
Definition: BCP_problem_core.hpp:198
BCP_problem_core_change::unpack
void unpack(BCP_buffer &buf)
Unpack the core change data from the buffer.
BCP_problem_core_change::_storage
BCP_storage_t _storage
Describes how the change is stored.
Definition: BCP_problem_core.hpp:143
BCP_problem_core::unpack
void unpack(BCP_buffer &buf)
Unpack the contents of the core description from the buffer.
BCP_problem_core::BCP_problem_core
BCP_problem_core()
The default constructor creates an empty core description: no variables/cuts and an empty matrix.
BCP_problem_core_change::BCP_problem_core_change
BCP_problem_core_change(BCP_storage_t store=BCP_Storage_WrtCore)
This constructor creates a core change with the given storage.
Definition: BCP_problem_core.hpp:169
BCP_problem_core::~BCP_problem_core
~BCP_problem_core()
The desctructor deletes all data members.
BCP_problem_core_change::ensure_explicit
void ensure_explicit(const BCP_problem_core_change &expl_core)
If the current storage is not already explicit then replace it with an explicit description of the co...
BCP_var_set
This class is just a collection of pointers to variables with a number of methods to manipulate these...
Definition: BCP_var.hpp:316
BCP_cut_core
Core cuts are the cuts that always stay in the LP formulation.
Definition: BCP_cut.hpp:195
BCP_problem_core_change::make_wrtcore_if_shorter
void make_wrtcore_if_shorter(const BCP_problem_core_change &orig_core)
Replace the current explicitly stored core change with one stored with respect to the explicitly stor...
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_problem_core_change
This class describes changes in the core of the problem.
Definition: BCP_problem_core.hpp:116
BCP_buffer
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
BCP_problem_core_change::~BCP_problem_core_change
~BCP_problem_core_change()
The destructor deletes all data members.
Definition: BCP_problem_core.hpp:189
BCP_buffer.hpp