Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_problem_core_change Class Reference

This class describes changes in the core of the problem. More...

#include <BCP_problem_core.hpp>

+ Collaboration diagram for BCP_problem_core_change:

Public Member Functions

Constructors and destructor
 BCP_problem_core_change (BCP_storage_t store=BCP_Storage_WrtCore)
 This constructor creates a core change with the given storage.
 
 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_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_problem_core_change ()
 The destructor deletes all data members.
 
Query methods
BCP_storage_t storage () const
 Return the storage type.
 
size_t varnum () const
 Return the number of changed variables (the length of the array var_ch).
 
size_t cutnum () const
 Return the number of changed cuts (the length of the array cut_ch).
 
Modifying methods
BCP_problem_core_changeoperator= (const BCP_problem_core &core)
 Set the core change description to be an explicit description (in the form of a change) of the given core.
 
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 core generated by applying the currently stored changes to expl_core (which of course, must be explicitly stored).
 
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 stored original core change in orig_core if the WrtCore description is shorter (requires less space to pack into a buffer).
 
void swap (BCP_problem_core_change &other)
 Swap the contents of the current core change with that of other.
 
void update (const BCP_problem_core_change &expl_core, const BCP_problem_core_change &core_change)
 Update the current change according to core_change.
 
Packing and unpacking
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 core change into the buffer.
 
void unpack (BCP_buffer &buf)
 Unpack the core change data from the buffer.
 

Public Attributes

Data members
BCP_storage_t _storage
 Describes how the change is stored.
 
BCP_vec< int > var_pos
 The positions of the core variables (in the vars member of \URL[BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.
 
BCP_vec< BCP_obj_changevar_ch
 The new lb/ub/status triplet for each variable for which any of those three have changed.
 
BCP_vec< int > cut_pos
 The positions of the core cuts (in the cuts member of \URL[BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.
 
BCP_vec< BCP_obj_changecut_ch
 The new lb/ub/status triplet for each cut for which any of those three have changed.
 

Detailed Description

This class describes changes in the core of the problem.

While the set of core variables and cuts always remains the same, their bounds and stati may change during processing. An object of this type may store the description of the bounds and stati of the core of three possible ways:

  • explicitly: the bounds and stati of everything in the core is stored in this class. In this case ..._pos is empty and ..._ch stores the bounds and stati.
  • with respect to parent: this is the case when a sequence of core changes have to be applied to get the current state. Each core change in the sequence describes the changes to be done after the previous change has been applied.
  • with respect to core: the current state of the core is given as one set of changes with respect to the very original state of the core.

This class is internal to the framework, the user shouldn't worry about it.

Definition at line 116 of file BCP_problem_core.hpp.

Constructor & Destructor Documentation

◆ BCP_problem_core_change() [1/3]

BCP_problem_core_change::BCP_problem_core_change ( BCP_storage_t store = BCP_Storage_WrtCore)
inline

This constructor creates a core change with the given storage.

The other members are empty, i.e., the created object contains NoData; is Explicit and empty; is WrtCore or WrtParent but there's no change.
Note that the argument defaults to WrtCore, this constructor is the default constructor as well, and as the default constructor it creates a "no change WrtCore" core change.

Definition at line 169 of file BCP_problem_core.hpp.

◆ BCP_problem_core_change() [2/3]

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.

The first bvarnum variables in vars are the core variables. Similarly for the cuts.

◆ BCP_problem_core_change() [3/3]

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.

Both core change arguments must have explicit storage. The only reason for passing storage as an argument (and not setting it automatically to WrtParent) is that old_bc might be the original core in which case storage must be set to WrtCore.

◆ ~BCP_problem_core_change()

BCP_problem_core_change::~BCP_problem_core_change ( )
inline

The destructor deletes all data members.

Definition at line 189 of file BCP_problem_core.hpp.

Member Function Documentation

◆ storage()

BCP_storage_t BCP_problem_core_change::storage ( ) const
inline

Return the storage type.

Definition at line 198 of file BCP_problem_core.hpp.

◆ varnum()

size_t BCP_problem_core_change::varnum ( ) const
inline

Return the number of changed variables (the length of the array var_ch).

Definition at line 201 of file BCP_problem_core.hpp.

◆ cutnum()

size_t BCP_problem_core_change::cutnum ( ) const
inline

Return the number of changed cuts (the length of the array cut_ch).

Definition at line 204 of file BCP_problem_core.hpp.

◆ operator=()

BCP_problem_core_change & 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 core.

◆ ensure_explicit()

void BCP_problem_core_change::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 core generated by applying the currently stored changes to expl_core (which of course, must be explicitly stored).


NOTE: An exception is thrown if the currently stored change is not stored as explicit or WrtCore; or the storage of expl_core is not explicit.

◆ make_wrtcore_if_shorter()

void BCP_problem_core_change::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 stored original core change in orig_core if the WrtCore description is shorter (requires less space to pack into a buffer).


NOTE: An exception is thrown if either the current storage or that of expl_core is not explicit.

◆ swap()

void BCP_problem_core_change::swap ( BCP_problem_core_change & other)

Swap the contents of the current core change with that of other.

◆ update()

void BCP_problem_core_change::update ( const BCP_problem_core_change & expl_core,
const BCP_problem_core_change & core_change )

Update the current change according to core_change.

If the storage type of core_change is

  • NoData or Explicit then it is simply copied over into this change.
  • WrtParent then the current change is supposed to be the parent and this explicitly stored core change will be updated with the changes in core_change (an exception is thrown if the current change is not explicitly stored).
  • WrtCore storage then the current change will be replaced by expl_core updated with core_change (the storage of expl_core must be explicit or an exception is thrown).

NOTE: When this function exits the stored change will have either explicit or NoData storage.

◆ pack_size()

int BCP_problem_core_change::pack_size ( ) const

Return the buffer size needed to pack the data in the core change.

◆ pack()

void BCP_problem_core_change::pack ( BCP_buffer & buf) const

Pack the core change into the buffer.

◆ unpack()

void BCP_problem_core_change::unpack ( BCP_buffer & buf)

Unpack the core change data from the buffer.

Member Data Documentation

◆ _storage

BCP_storage_t BCP_problem_core_change::_storage

Describes how the change is stored.

The interpretation of the other data members depends on the storage type.

  • BCP_Storage_NoData: when no data is stored (i.e., the change is not described yet) the other members are undefined.
  • BCP_Storage_WrtCore: with respect to core storage (as explained in the class description).
  • BCP_Storage_WrtParent: with respect to parent storage (as explained in the class description).
  • BCP_Storage_Explicit: Explicit storage (as explained in the class description).

Definition at line 143 of file BCP_problem_core.hpp.

◆ var_pos

BCP_vec<int> BCP_problem_core_change::var_pos

The positions of the core variables (in the vars member of \URL[BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.

Definition at line 147 of file BCP_problem_core.hpp.

◆ var_ch

BCP_vec<BCP_obj_change> BCP_problem_core_change::var_ch

The new lb/ub/status triplet for each variable for which any of those three have changed.

Definition at line 150 of file BCP_problem_core.hpp.

◆ cut_pos

BCP_vec<int> BCP_problem_core_change::cut_pos

The positions of the core cuts (in the cuts member of \URL[BCP_problem_core]{BCP_problem_core.html}) whose bounds and/or stati have changed.

Definition at line 154 of file BCP_problem_core.hpp.

◆ cut_ch

BCP_vec<BCP_obj_change> BCP_problem_core_change::cut_ch

The new lb/ub/status triplet for each cut for which any of those three have changed.

Definition at line 157 of file BCP_problem_core.hpp.


The documentation for this class was generated from the following file: