00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef UDINE_CUTS
00022 #define UDINE_CUTS
00023
00024 #include <map>
00025 #include <vector>
00026 #include <utility>
00027
00028 #include <ilcplex/ilocplex.h>
00029
00030 #include "solver_config.h"
00031 #include "model.h"
00032
00033 namespace Udine {
00034
00035
00036 typedef std::pair<int, int> CliqueCutIdentifier;
00037 typedef std::map<CliqueCutIdentifier, bool> CliquePool;
00038
00039
00040 class CutManagerI : public IloCplex::LazyConstraintCallbackI {
00041 protected:
00042 bool active;
00043 int totalCalls, totalCutsAdded;
00044 Model& solver;
00045 Config &config;
00046 CliquePool cliquePool;
00047 public:
00048 ILOCOMMONCALLBACKSTUFF(CutManager)
00049 CutManagerI(IloEnv env, Model& s, Config &c)
00050 : IloCplex::LazyConstraintCallbackI(env), solver(s), config(c) {
00051 active = true;
00052 totalCalls = 0;
00053 totalCutsAdded = 0;
00054 std::cout << "Mycuts: Instantiating the cut manager ..." << std::endl;
00055 }
00056 void main();
00057 int genCutsFromCliquePool();
00058 int genCutsFromComponents();
00059 int genCutsFromTriangles();
00060 int genCutsFromTriangleNeighbourhood(int u, int v, int w, int p);
00061 int genCutsFromPatterns();
00062 int genCutsFromPatternsWithHeuristicAtSurface();
00063
00064 };
00065
00066 IloCplex::Callback CutManager(IloEnv env, Model& s, Config &c);
00067
00068 }
00069
00070 #endif // UDINE CUTS