/home/coin/SVN-release/CoinAll-1.1.0/Bcp/src/include/BCP_problem_core.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_PROBLEM_CORE_H
00004 #define _BCP_PROBLEM_CORE_H
00005 
00006 // This file is fully docified.
00007 
00008 #include "BCP_vector.hpp"
00009 #include "BCP_matrix.hpp"
00010 #include "BCP_buffer.hpp"
00011 #include "BCP_enum.hpp"
00012 #include "BCP_obj_change.hpp"
00013 
00014 //#############################################################################
00015 
00016 class BCP_var_core;
00017 class BCP_cut_core;
00018 class BCP_indexed_pricing_list;
00019 
00020 class BCP_buffer;
00021 
00022 class BCP_internal_brobj;
00023 
00024 //#############################################################################
00025 
00031 class BCP_problem_core{
00032 private:
00037     inline void clear();
00039     BCP_problem_core(const BCP_problem_core&);
00041     BCP_problem_core& operator=(const BCP_problem_core&);
00043 public:
00048     BCP_vec<BCP_var_core*> vars;
00051     BCP_vec<BCP_cut_core*> cuts;
00054     BCP_lp_relax* matrix;
00056 public:
00061     BCP_problem_core();
00065     BCP_problem_core(BCP_vec<BCP_var_core*>& v, BCP_vec<BCP_cut_core*>& c,
00066                      BCP_lp_relax*& m) : vars(), cuts(), matrix(m) {
00067       vars.swap(v);
00068       cuts.swap(c);
00069       m = 0;
00070     }
00072     ~BCP_problem_core();
00078     inline size_t varnum() const { return vars.size(); }
00080     inline size_t cutnum() const { return cuts.size(); }
00086     void pack(BCP_buffer& buf) const; // *INLINE ?*
00088     void unpack(BCP_buffer& buf); // *INLINE ?*
00090 };
00091 
00092 //#############################################################################
00093 
00094 // The following class holds the change in the core. It may be WrtParent,
00095 // WrtCore or Explicit. In the latter case indices is empty.
00096 
00116 class BCP_problem_core_change{
00117 private:
00121     inline void clear();
00124     BCP_problem_core_change(const BCP_problem_core_change&); // disabled
00127     BCP_problem_core_change& operator=(const BCP_problem_core_change& x);
00130 public:
00146     BCP_storage_t _storage;
00150     BCP_vec<int>            var_pos;
00153     BCP_vec<BCP_obj_change> var_ch;
00157     BCP_vec<int>            cut_pos;
00160     BCP_vec<BCP_obj_change> cut_ch;
00163 public:
00172     BCP_problem_core_change(BCP_storage_t store = BCP_Storage_WrtCore) :
00173        _storage(store), var_pos(), var_ch(), cut_pos(), cut_ch() {}
00174   
00178     BCP_problem_core_change(int bvarnum, BCP_var_set& vars,
00179                             int bcutnum, BCP_cut_set& cuts);
00180 
00187     BCP_problem_core_change(BCP_storage_t storage,
00188                             BCP_problem_core_change& ocore,
00189                             BCP_problem_core_change& ncore);
00190 
00192     ~BCP_problem_core_change() {}
00198     inline BCP_storage_t storage() const { return _storage; }
00201     inline size_t varnum() const { return var_ch.size(); }
00204     inline size_t cutnum() const { return cut_ch.size(); }
00211     BCP_problem_core_change& operator=(const BCP_problem_core& core);
00212   
00220     void ensure_explicit(const BCP_problem_core_change& expl_core);
00221   
00228     void make_wrtcore_if_shorter(const BCP_problem_core_change& orig_core);
00229   
00232     void swap(BCP_problem_core_change& other);
00233   
00250     void update(const BCP_problem_core_change& expl_core,
00251                 const BCP_problem_core_change& core_change);
00257     int pack_size() const;
00259     void pack(BCP_buffer& buf) const;
00261     void unpack(BCP_buffer& buf);
00263 };
00264 
00265 #endif

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