#include <BCP_warmstart_basis.hpp>
Inheritance diagram for BCP_warmstart_basis:
Public Member Functions | |
virtual CoinWarmStart * | convert_to_CoinWarmStart () const |
virtual BCP_storage_t | storage () const |
virtual BCP_warmstart * | clone () const |
virtual BCP_warmstart * | empty_wrt_this () const |
virtual int | storage_size () const |
virtual void | update (const BCP_warmstart *const 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 |
void | pack (BCP_buffer &buf) const |
Constructors and destructor | |
BCP_warmstart_basis (BCP_buffer &buf) | |
BCP_warmstart_basis (const char *vfirst, const char *vlast, const char *cfirst, const char *clast) | |
BCP_warmstart_basis (const BCP_warmstart_basis &ws) | |
Private Member Functions | |
BCP_warmstart_basis & | operator= (const BCP_warmstart_basis &) |
BCP_warmstart_basis () | |
Private Attributes | |
BCP_vec_change< char > | _var_stat |
BCP_vec_change< char > | _cut_stat |
"basic / on_upper / on_lower" info is stored on 2 bits for every variable. Only the added methods are documented in details on this page, for the inherited methods see the description of the base class.
Definition at line 24 of file BCP_warmstart_basis.hpp.
|
The default constructor creates an empty WrtParent warmstart info (i.e., no change wrt the parent). This is a private method since only the empty_wrt_this() method should be able to use this form of creation. Definition at line 32 of file BCP_warmstart_basis.hpp. References _cut_stat, and _var_stat. Referenced by as_change(), clone(), and empty_wrt_this().
|
|
Create the object by unpacking it from a buffer Definition at line 45 of file BCP_warmstart_basis.hpp. References _cut_stat, and _var_stat.
|
|
Create an explicitly stored warmstart info by considering the two character arrays ( Definition at line 50 of file BCP_warmstart_basis.hpp. References _cut_stat, and _var_stat.
|
|
Copy constructor Definition at line 54 of file BCP_warmstart_basis.hpp. References _cut_stat, and _var_stat.
|
|
Return a pointer to a warmstart info describing the currently stored data as a change with respect to that stored in
Implements BCP_warmstart. Definition at line 55 of file BCP_warmstart_basis.cpp. References _cut_stat, _var_stat, BCP_warmstart_basis(), storage(), and BCP_vec_change< char >::storage_size().
00060 { 00061 const BCP_warmstart_basis* const ows = 00062 dynamic_cast<const BCP_warmstart_basis* const>(old_ws); 00063 if (!ows) 00064 throw BCP_fatal_error("BCP_warmstart_basis::as_change\n \ 00065 trying to describe a BCP_warmstart_basis as a change to a different ws!\n"); 00066 00067 if (storage() != BCP_Storage_Explicit) 00068 throw BCP_fatal_error("BCP_warmstart_basis::as_change\n \ 00069 current data is not explicit!\n"); 00070 00071 if (ows->storage() == BCP_Storage_WrtParent) 00072 throw BCP_fatal_error("\ 00073 BCP_warmstart_dual::as_change : old_ws is WrtParent!\n"); 00074 00075 if (ows->storage() == BCP_Storage_NoData) 00076 return new BCP_warmstart_basis(*this); 00077 00078 // Both are explicit 00079 BCP_warmstart_basis* ws = new BCP_warmstart_basis(); 00080 00081 new (&ws->_var_stat) BCP_vec_change<char>(ows->_var_stat, _var_stat, 00082 del_vars); 00083 if (ws->_var_stat.storage_size() > ows->_var_stat.storage_size()) 00084 ws->_var_stat = ows->_var_stat; 00085 00086 new (&ws->_cut_stat) BCP_vec_change<char>(ows->_cut_stat, _cut_stat, 00087 del_cuts); 00088 if (ws->_cut_stat.storage_size() > ows->_cut_stat.storage_size()) 00089 ws->_cut_stat = ows->_cut_stat; 00090 00091 return ws; 00092 } |
|
Make a replica of the current warmstart information. Implements BCP_warmstart. Definition at line 69 of file BCP_warmstart_basis.hpp. References BCP_warmstart_basis().
00069 { 00070 return new BCP_warmstart_basis(*this); 00071 } |
|
Return an CoinwarmStart object that can be fed to the LP engine. The implementation for this class will return an CoinwarmStartBasis object. Implements BCP_warmstart. Definition at line 9 of file BCP_warmstart_basis.cpp. References _cut_stat, _var_stat, BCP_vec< T >::begin(), BCP_vec_change< char >::explicit_vector(), BCP_vec< T >::size(), and storage().
00010 { 00011 if (storage() != BCP_Storage_Explicit) 00012 return NULL; 00013 00014 const BCP_vec<char>& vst = _var_stat.explicit_vector(); 00015 const BCP_vec<char>& cst = _cut_stat.explicit_vector(); 00016 return 00017 new CoinWarmStartBasis(vst.size(), cst.size(), vst.begin(), cst.begin()); 00018 } |
|
Create a warmstart info describing that no change should be done. This is really the task of a constructor, but BCP does not know the type of warmstart the user will use, so it will invoke this method for a warmstart that was created by the user. Tricky, isn't it? Implements BCP_warmstart. Definition at line 73 of file BCP_warmstart_basis.hpp. References BCP_warmstart_basis().
00073 { 00074 // The default constructor creates an empty WrtParent warmstart info 00075 // (i.e., no change wrt the parent) 00076 return new BCP_warmstart_basis(); 00077 } |
|
The assignment operator is declared but not defined to disable it. |
|
Pack the warmstart info into a buffer. Definition at line 94 of file BCP_warmstart_basis.hpp. References _cut_stat, _var_stat, and BCP_vec_change< char >::pack().
|
|
Return how the warmstarting info is stored. Implements BCP_warmstart. Definition at line 23 of file BCP_warmstart_basis.cpp. References _cut_stat, _var_stat, and BCP_vec_change< char >::storage(). Referenced by as_change(), and convert_to_CoinWarmStart().
00023 { 00024 // The storage is WrtParent if at least one status set is WrtParent 00025 const BCP_storage_t vst = _var_stat.storage(); 00026 const BCP_storage_t cst = _cut_stat.storage(); 00027 if (vst == BCP_Storage_WrtParent || cst == BCP_Storage_WrtParent) 00028 return BCP_Storage_WrtParent; 00029 // Otherwise Explicit if at least one status set is Explicit 00030 if (vst == BCP_Storage_Explicit || cst == BCP_Storage_Explicit) 00031 return BCP_Storage_Explicit; 00032 // Otherwise it must be NoData 00033 return BCP_Storage_NoData; 00034 } |
|
Return how much memory it'll take to pack this warmstart info. It is used when comparing which sort of storage is smaller. Implements BCP_warmstart. Definition at line 79 of file BCP_warmstart_basis.hpp. References _cut_stat, _var_stat, and BCP_vec_change< char >::storage_size().
00079 { 00080 return _var_stat.storage_size() + _cut_stat.storage_size(); 00081 } |
|
Update the current data with the one in the argument. If the argument is of explicit storage then just replace the current data. If it is relative and the current data is explicit then perform the update. Otherwise throw an exception. Implements BCP_warmstart. Definition at line 39 of file BCP_warmstart_basis.cpp. References _cut_stat, _var_stat, and BCP_vec_change< char >::update().
00040 { 00041 const BCP_warmstart_basis* ch = 00042 dynamic_cast<const BCP_warmstart_basis*>(change); 00043 if (! ch) 00044 throw BCP_fatal_error("BCP_warmstart_basis::update\n \ 00045 Can't update a BCP_warmstart_basis with a different warmstart.\n"); 00046 00047 _var_stat.update(ch->_var_stat); 00048 _cut_stat.update(ch->_cut_stat); 00049 } |
|
The stati of the cuts stored as a vector change. Definition at line 39 of file BCP_warmstart_basis.hpp. Referenced by as_change(), BCP_warmstart_basis(), convert_to_CoinWarmStart(), pack(), storage(), storage_size(), and update(). |
|
The stati of the variables stored as a vector change. Definition at line 37 of file BCP_warmstart_basis.hpp. Referenced by as_change(), BCP_warmstart_basis(), convert_to_CoinWarmStart(), pack(), storage(), storage_size(), and update(). |