VRP_GSECCut.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef VRP_SUBTOUR_CUT
00013 #define VRP_SUBTOUR_CUT
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "Decomp.h"
00035 #include "DecompCut.h"
00036
00037 #include <vector>
00038 using namespace std;
00039
00040
00041 #include <boost/dynamic_bitset.hpp>
00042 using namespace boost;
00043
00044
00045 class VRP_GSECCut : public DecompCut {
00046 public:
00047 enum storageType {VECTOR, BITSET, BOTH, NONE};
00048 enum cutType {ACROSS, SIDE, SIDE_COMPL};
00049
00050 private:
00052 const string m_classTag;
00053
00054
00055 vector<int> m_S;
00056 dynamic_bitset<> m_inS;
00057 cutType m_type;
00058 storageType m_storage;
00059 int m_nverts;
00060 int m_demandS;
00061 int m_capacity;
00062
00063 public:
00064
00065 virtual void expandCutToRow(CoinPackedVector * row);
00066 virtual void setBounds();
00067
00068
00069 virtual void print(ostream * os = &cout) const;
00070 virtual bool isSame(const DecompCut * cut) const;
00071
00072 public:
00073 void setStorage();
00074 void create_bitset();
00075 void create_vector();
00076 void setCutType();
00077 void setDemand(const int * vertex_wt);
00078 const int getSize();
00079
00080 public:
00081 VRP_GSECCut(const dynamic_bitset<> & inS,
00082 const int * vertex_wt,
00083 const int capacity,
00084 const int demandS = 0) :
00085 m_classTag("VRP-GSEC"),
00086 m_inS (inS),
00087 m_storage (BITSET),
00088 m_nverts (m_inS.size()),
00089 m_demandS (demandS),
00090 m_capacity(capacity)
00091 {
00092 setStorage();
00093 setCutType();
00094 setDemand(vertex_wt);
00095 setBounds();
00096 }
00097
00098 virtual ~VRP_GSECCut() {}
00099 };
00100
00101 #endif