38 while (++vi != lastvi) {
40 const int bcpind = var.
bcpind();
44 const double obj = var.
obj();
45 const double lb = var.
lb();
46 const double ub = var.
ub();
56 while (++ci != lastci) {
58 const int bcpind = cut.
bcpind();
61 const double lb = cut.
lb();
62 const double ub = cut.
ub();
145 for ( ; vi != lastvi; ++vi)
151 for ( ; ci != lastci; ++ci)
170 for (vari = vars.
begin(); vari != lastvari; ++vari)
174 for (
int i = 0; i < bvarnum; ++i) {
182 for (cuti = cuts.
begin(); cuti != lastcuti; ++cuti)
193 _storage(storage), var_pos(), var_ch(), cut_pos(), cut_ch()
197 BCP_problem_core_change() : bad proposed storage\n");
201 throw BCP_fatal_error(
"BCP_problem_core_change() : bad ocore storage\n");
203 throw BCP_fatal_error(
"BCP_problem_core_change() : bad ncore storage\n");
207 const int bvarnum = ncore.
varnum();
210 for (i = 0; i < bvarnum; ++i) {
217 const int bcutnum = ncore.
cutnum();
220 for (i = 0; i < bcutnum; ++i) {
237 BCP_problem_core_change::ensure_explicit() : bad current storage\n");
240 BCP_problem_core_change::ensure_explicit() : bad ecore storage\n");
243 new_core.
update(ecore, *
this);
255 BCP_problem_core_change::make_wrtcore_if_shorter() : bad storage\n");
258 BCP_problem_core_change::make_wrtcore_if_shorter() : bad ecore storage\n");
261 BCP_problem_core_change::make_wrtcore_if_shorter() : nonequal sizes\n");
270 for (i = 0; i < bvarnum; ++i)
278 for (i = 0; i < bcutnum; ++i)
282 if ((chvar.
size() + chcut.
size()) *
sizeof(
int) <
323 ch_core's WrtCore, but expl_core's not Explicit\n");
330 _storage isn't Explicit && ch_core's WrtParent\n");
337 BCP_problem_core_change::update(): bad ch_core storage!\n");
This class describes changes in the core of the problem.
This class describes the core of the MIP problem, the variables/cuts in it as well as the matrix corr...
BCP_buffer & pack(const T &value)
Pack a single object of type T.
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
The data stored is with respect to the original description of the base problem (as was given by the ...
void clear()
Delete every entry.
Abstract base class that defines members common to all types of cuts.
void pack(BCP_buffer &buf) const
Pack the core change into the buffer.
void set_bcpind(const int bcpind)
Set the internal index of the cut.
BCP_storage_t storage() const
Return the storage type.
BCP_lp_relax * matrix
A pointer to the constraint matrix corresponding to the core variables and cuts.
size_t varnum() const
Return the number of changed variables (the length of the array var_ch).
void set_bcpind(const int bcpind)
Set the internal index of the variable.
BCP_storage_t _storage
Describes how the change is stored.
Core cuts are the cuts that always stay in the LP formulation.
iterator begin()
Return an iterator to the beginning of the object.
double ub() const
Return the upper bound on the cut.
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts...
void unpack(BCP_buffer &buf)
Unpack the contents of the core description from the buffer.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
The object is not removable from the LP formulation, even if the object becomes inactive.
BCP_vec< int > cut_pos
The positions of the core cuts (in the cuts member of [BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.
size_t cutnum() const
Return the number of changed cuts (the length of the array cut_ch).
Core variables are the variables that always stay in the LP formulation.
BCP_vec< BCP_cut_core * > cuts
A vector of pointers to the cuts in the core of the problem.
void keep_by_index(const BCP_vec< int > &positions)
Keep the entries indexed by indices.
BCP_obj_status
This enumerative constant gives the status of an object (variable or cut).
The data stored is an explicit listing of values.
size_t varnum() const
Return the number of variables in the core.
BCP_vec< int > var_pos
The positions of the core variables (in the vars member of [BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.
BCP_vec< BCP_obj_change > var_ch
The new lb/ub/status triplet for each variable for which any of those three have changed.
double lb() const
Return the lower bound on the cut.
void unpack(BCP_buffer &buf)
Unpack the LP relaxation from the buffer.
double ub() const
Return the upper bound.
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...
void clear()
Clear all vector data members.
int pack_size() const
Return the buffer size needed to pack the data in the core change.
void pack(BCP_buffer &buf) const
Pack the contents of the core description into the buffer.
size_t cutnum() const
Return the number of cuts in the core.
BCP_obj_status status() const
Return the status of the cut.
void update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Update those entries listed in positions to the given values.
The data stored is with respect to the same kind of data in the parent of the search tree node...
double obj() const
Return the objective coefficient.
BCP_object_t obj_type() const
Return BCP_CoreObj indicating that the object is a core variable.
void set_status(const BCP_obj_status stat)
Set the status of the cut.
BCP_var_t var_type() const
Return the integrality type of the variable.
void unpack(BCP_buffer &buf)
Unpack the core change data from the buffer.
BCP_problem_core()
The default constructor creates an empty core description: no variables/cuts and an empty matrix...
void pack(BCP_buffer &buf) const
Pack the LP relaxation into the buffer.
BCP_object_t obj_type() const
Return BCP_CoreObj indicating that the object is a core cut.
Abstract base class that defines members common to all types of variables.
Currently there isn't any error handling in BCP.
int bcpind() const
Return the internal index of the variable.
size_t size() const
Return the current number of entries.
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 ...
iterator end()
Return an iterator to the end of the object.
~BCP_problem_core()
The desctructor deletes all data members.
BCP_obj_status status() const
Return the status of the variable.
This class is just a collection of pointers to variables with a number of methods to manipulate these...
The class BCP_vec serves the same purpose as the vector class in the standard template library...
This class describes the message buffer used for all processes of BCP.
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
void swap(BCP_problem_core_change &other)
Swap the contents of the current core change with that of other.
double lb() const
Return the lower bound.
void purge_ptr_vector(BCP_vec< T * > &pvec, typename BCP_vec< T * >::iterator first, typename BCP_vec< T * >::iterator last)
This function purges the entries [first,last) from the vector of pointers pvec.
void update(const BCP_problem_core_change &expl_core, const BCP_problem_core_change &core_change)
Update the current change according to core_change.
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_storage_t
This enumerative constant describes how to store certain data for a search tree node.
BCP_problem_core_change(const BCP_problem_core_change &)
The copy constructor is disabled by declaring it private and not defining it.
iterator entry(const int i)
Return an iterator to the i-th entry.
void set_status(const BCP_obj_status status)
Set the status of the variable.
int bcpind() const
Return the internal index of the cut.
BCP_object_t
This enumerative constant describes the possible types of objects (variables and cuts).
void swap(BCP_vec< T > &x)
Exchange the contents of the object with that of x.
BCP_vec< BCP_var_core * > vars
A vector of pointers to the variables in the core of the problem.
An object of type BCP_lp_relax holds the description of an lp relaxation.
void clear()
Delete all data members.
BCP_var_t
This enumerative constant describes the integrality type of a variable.
void fint fint fint real fint real * x
BCP_vec< BCP_obj_change > cut_ch
The new lb/ub/status triplet for each cut for which any of those three have changed.