coin-Bcp
MCF3_var.hpp
Go to the documentation of this file.
1 #ifndef MCF3_var_hpp
2 #define MCF3_var_hpp
3 
4 #include "CoinPackedVector.hpp"
5 #include "BCP_buffer.hpp"
6 #include "BCP_var.hpp"
7 
8 /*---------------------------------------------------------------------------*/
9 
10 // A var describing a column of the master problem, that is a flow for a
11 // commodity.
12 
13 // For the variables the upper bound is 1, but we set it to 2 so there
14 // will never be a variable out of basis at its upper bound. That would kill
15 // column generation. The convexity constraint will take care of keeping these
16 // variables under 1.
17 
18 class MCF3_var : public BCP_var_algo {
19 public:
20  int commodity;
22  double weight;
23 
24 public:
25  MCF3_var(int com, const CoinPackedVector& f, double w) :
27  commodity(com),
28  flow(f.getNumElements(), f.getIndices(), f.getElements(), false),
29  weight(w) {}
30  MCF3_var(BCP_buffer& buf);
31  ~MCF3_var() {}
32 
33  void pack(BCP_buffer& buf) const;
34 };
35 
36 void MCF3_pack_var(const BCP_var_algo* var, BCP_buffer& buf);
38 
39 #endif
~MCF3_var()
Definition: MCF3_var.hpp:31
void MCF3_pack_var(const BCP_var_algo *var, BCP_buffer &buf)
void pack(BCP_buffer &buf) const
double weight
Definition: MCF3_var.hpp:22
BCP_var_algo * MCF3_unpack_var(BCP_buffer &buf)
MCF3_var(int com, const CoinPackedVector &f, double w)
Definition: MCF3_var.hpp:25
int commodity
Definition: MCF3_var.hpp:20
CoinPackedVector flow
Definition: MCF3_var.hpp:21
Continuous variable.
Definition: BCP_enum.hpp:167
This is the class from which the user should derive her own algorithmic variables.
Definition: BCP_var.hpp:277
Sparse Vector.
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39