/home/coin/SVN-release/CoinAll-1.1.0/Bcp/examples/MCF-3/include/MCF3_var.hpp

Go to the documentation of this file.
00001 #ifndef MCF3_var_hpp
00002 #define MCF3_var_hpp
00003 
00004 #include "CoinPackedVector.hpp"
00005 #include "BCP_buffer.hpp"
00006 #include "BCP_var.hpp"
00007 
00008 /*---------------------------------------------------------------------------*/
00009 
00010 // A var describing a column of the master problem, that is a flow for a
00011 // commodity. The second is a "fake" variable. It simply holds information on
00012 // the branching decision so that in the subproblems we can make the
00013 // appropriate restrictions on the flow values.
00014 
00015 class MCF3_var : public BCP_var_algo {
00016 public:
00017     int commodity;
00018     CoinPackedVector flow;
00019     double weight;
00020 
00021 public:
00022     MCF3_var(int com, const CoinPackedVector& f, double w) :
00023         BCP_var_algo(BCP_ContinuousVar, w, 0, 1),
00024         commodity(com), flow(false), weight(w)
00025     {
00026         new (&flow) CoinPackedVector(f.getNumElements(),
00027                                      f.getIndices(), f.getElements(), false);
00028     }
00029     MCF3_var(BCP_buffer& buf);
00030     ~MCF3_var() {}
00031 
00032     void pack(BCP_buffer& buf) const;
00033 };
00034 
00035 void MCF3_pack_var(const BCP_var_algo* var, BCP_buffer& buf);
00036 BCP_var_algo* MCF3_unpack_var(BCP_buffer& buf);
00037 
00038 #endif

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