/home/coin/SVN-release/CoinAll-1.1.0/Bcp/src/include/BCP_warmstart_basis.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _BCP_WARMSTART_BASIS_H
00004 #define _BCP_WARMSTART_BASIS_H
00005 
00006 #include "BCP_warmstart.hpp"
00007 #include "BCP_vector_change.hpp"
00008 
00009 /* NOTE:
00010    Doxygen gracefully generates description for all inherited methods if they
00011    are not documented here. So the virtual methods are documented ONLY if they
00012    have something additional to say.
00013 */
00014 
00015 //#############################################################################
00016 
00024 class BCP_warmstart_basis : public BCP_warmstart {
00025 private:
00027   BCP_warmstart_basis& operator=(const BCP_warmstart_basis&);
00028 
00032   BCP_warmstart_basis() :
00033     _var_stat(BCP_Storage_WrtParent), _cut_stat(BCP_Storage_WrtParent) {}
00034 
00035 private:
00037   BCP_vec_change<char> _var_stat;
00039   BCP_vec_change<char> _cut_stat;
00040 
00041 public:
00045     BCP_warmstart_basis(BCP_buffer& buf) : _var_stat(buf), _cut_stat(buf) {}
00050     BCP_warmstart_basis(const char* vfirst, const char* vlast,
00051                         const char* cfirst, const char* clast) :
00052        _var_stat(vfirst, vlast), _cut_stat(cfirst, clast) {}
00054     BCP_warmstart_basis(const BCP_warmstart_basis& ws) :
00055       _var_stat(ws._var_stat), _cut_stat(ws._cut_stat) {}
00056 
00057    ~BCP_warmstart_basis() {}
00060   // Inherited methods --------------------------------------------------------
00061 
00065   virtual CoinWarmStart* convert_to_CoinWarmStart() const;
00066 
00067   virtual BCP_storage_t storage() const;
00068 
00069   virtual BCP_warmstart* clone() const {
00070     return new BCP_warmstart_basis(*this);
00071   }
00072 
00073   virtual BCP_warmstart* empty_wrt_this() const {
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   }
00078 
00079   virtual int storage_size() const {
00080     return _var_stat.storage_size() + _cut_stat.storage_size();
00081   }
00082 
00083   virtual void update(const BCP_warmstart* const change);
00084 
00085   virtual BCP_warmstart* as_change(const BCP_warmstart* const old_ws,
00086                                    const BCP_vec<int>& del_vars,
00087                                    const BCP_vec<int>& del_cuts,
00088                                    const double petol,
00089                                    const double detol) const; 
00090 
00091   // Not inherited methods ----------------------------------------------------
00092 
00094   void pack(BCP_buffer& buf) const {
00095     _var_stat.pack(buf);
00096     _cut_stat.pack(buf);
00097   }
00098 };
00099 
00100 #endif

Generated on Sun Nov 14 14:06:30 2010 for Coin-All by  doxygen 1.4.7