/home/coin/SVN-release/CoinAll-1.1.0/Bcp/examples/MCF-2/include/MCF2_data.hpp

Go to the documentation of this file.
00001 #ifndef MCF2_data_hpp
00002 #define MCF2_data_hpp
00003 
00004 #include <iostream>
00005 #include "BCP_buffer.hpp"
00006 
00007 //#############################################################################
00008 
00009 // This structure holds the input data
00010 
00011 class MCF2_data {
00012 public:
00013     struct arc {
00014         int tail;
00015         int head;
00016         int lb;
00017         int ub;
00018         double weight;
00019     };
00020     struct commodity {
00021         int source;
00022         int sink;
00023         int demand;
00024     };
00025     char* problem_name;
00026     arc* arcs;
00027     commodity* commodities;
00028     int numarcs;
00029     int numnodes;
00030     int numcommodities;
00031 
00032 public:
00033     MCF2_data() :
00034         arcs(NULL), commodities(NULL),
00035         numarcs(0), numnodes(0), numcommodities(0) {}
00036 
00037     ~MCF2_data() {
00038         delete[] arcs;
00039         delete[] commodities;
00040         delete[] problem_name;
00041     }
00042 
00043     int readDimacsFormat(std::istream& s, bool addDummyArcs);
00044     void pack(BCP_buffer& buf) const;
00045     void unpack(BCP_buffer& buf);
00046 };
00047 
00048 //#############################################################################
00049 
00050 class MCF2_branch_decision
00051 {
00052 public:
00053     int arc_index;
00054     int lb;
00055     int ub;
00056 public: 
00057     MCF2_branch_decision() : arc_index(-1), lb(0), ub(0) {}
00058     MCF2_branch_decision(int i, int l, int u) : arc_index(i), lb(l), ub(u) {}
00059 };
00060 
00061 #endif

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