/home/coin/SVN-release/OS-2.4.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. 
00012 
00013 // For the variables the upper bound is 1, but we set it to 2 so there
00014 // will never be a variable out of basis at its upper bound. That would kill
00015 // column generation. The convexity constraint will take care of keeping these
00016 // variables under 1.
00017 
00018 class MCF3_var : public BCP_var_algo {
00019 public:
00020     int commodity;
00021     CoinPackedVector flow;
00022     double weight;
00023 
00024 public:
00025     MCF3_var(int com, const CoinPackedVector& f, double w) :
00026         BCP_var_algo(BCP_ContinuousVar, w, 0, 2),
00027         commodity(com),
00028         flow(f.getNumElements(), f.getIndices(), f.getElements(), false),
00029         weight(w) {}
00030     MCF3_var(BCP_buffer& buf);
00031     ~MCF3_var() {}
00032 
00033     void pack(BCP_buffer& buf) const;
00034 };
00035 
00036 void MCF3_pack_var(const BCP_var_algo* var, BCP_buffer& buf);
00037 BCP_var_algo* MCF3_unpack_var(BCP_buffer& buf);
00038 
00039 #endif

Generated on Thu Sep 22 03:05:51 2011 by  doxygen 1.4.7