coin-Bcp
List of all members
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:
Collaboration graph
[legend]

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. More...
 
 BCP_problem_core_change (int bvarnum, BCP_var_set &vars, int bcutnum, BCP_cut_set &cuts)
 This constructor creates an Explicit core change description. More...
 
 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. More...
 
 ~BCP_problem_core_change ()
 The destructor deletes all data members. More...
 
Query methods
BCP_storage_t storage () const
 Return the storage type. More...
 
size_t varnum () const
 Return the number of changed variables (the length of the array var_ch). More...
 
size_t cutnum () const
 Return the number of changed cuts (the length of the array cut_ch). More...
 
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. More...
 
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). More...
 
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). More...
 
void swap (BCP_problem_core_change &other)
 Swap the contents of the current core change with that of other. More...
 
void update (const BCP_problem_core_change &expl_core, const BCP_problem_core_change &core_change)
 Update the current change according to core_change. More...
 
Packing and unpacking
int pack_size () const
 Return the buffer size needed to pack the data in the core change. More...
 
void pack (BCP_buffer &buf) const
 Pack the core change into the buffer. More...
 
void unpack (BCP_buffer &buf)
 Unpack the core change data from the buffer. More...
 

Public Attributes

Data members
BCP_storage_t _storage
 Describes how the change is stored. More...
 
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. More...
 
BCP_vec< BCP_obj_changevar_ch
 The new lb/ub/status triplet for each variable for which any of those three have changed. More...
 
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. More...
 
BCP_vec< BCP_obj_changecut_ch
 The new lb/ub/status triplet for each cut for which any of those three have changed. More...
 

Private Member Functions

Private and disabled methods
void clear ()
 Clear all vector data members. More...
 
 BCP_problem_core_change (const BCP_problem_core_change &)
 The copy constructor is disabled by declaring it private and not defining it. More...
 

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:

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::BCP_problem_core_change ( const BCP_problem_core_change )
private

The copy constructor is disabled by declaring it private and not defining it.

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::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::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 ( )
inline

The destructor deletes all data members.

Definition at line 189 of file BCP_problem_core.hpp.

Member Function Documentation

void BCP_problem_core_change::clear ( )
inlineprivate

Clear all vector data members.

BCP_storage_t BCP_problem_core_change::storage ( ) const
inline

Return the storage type.

Definition at line 198 of file BCP_problem_core.hpp.

References _storage.

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.

References BCP_vec< T >::size(), and var_ch.

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.

References cut_ch, and BCP_vec< T >::size().

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.

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.

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.

void BCP_problem_core_change::swap ( BCP_problem_core_change other)

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

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.

int BCP_problem_core_change::pack_size ( ) const

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

void BCP_problem_core_change::pack ( BCP_buffer buf) const

Pack the core change into the buffer.

void BCP_problem_core_change::unpack ( BCP_buffer buf)

Unpack the core change data from the buffer.

Member Data Documentation

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.

Referenced by storage().

BCP_vec<int> BCP_problem_core_change::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.

Definition at line 147 of file BCP_problem_core.hpp.

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.

Referenced by varnum().

BCP_vec<int> BCP_problem_core_change::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.

Definition at line 154 of file BCP_problem_core.hpp.

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.

Referenced by cutnum().


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