00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00018
00020
00021
00022 #ifndef ODD_CYCLE_CONSTRAINT_HH
00023 #define ODD_CYCLE_CONSTRAINT_HH
00024
00025
00026 #include "abacus/constraint.h"
00027 #include <vector>
00028
00029 using namespace std;
00030
00031 class Graph;
00032
00033
00039 class OddCycleConstraint: public ABA_CONSTRAINT {
00040
00041
00042 public:
00043
00044
00045
00046
00047
00058 OddCycleConstraint(ABA_MASTER *master, int oddCycleSize, int *nodes,
00059 Graph *itsGraph);
00060
00064 virtual ~OddCycleConstraint();
00065
00073 int genRow(ABA_ACTIVE<ABA_VARIABLE,ABA_CONSTRAINT> *var, ABA_ROW &row);
00074
00081 virtual double coeff(ABA_VARIABLE *var);
00082
00089 int getSize();
00090
00098 bool isInConstraint(int node);
00099
00107 virtual bool equal(ABA_CONVAR *cv);
00108
00115 virtual const char* name();
00116
00123 virtual unsigned hashKey();
00124
00125
00126 private:
00127
00128
00129
00130
00131
00138 void calculateHashKey();
00139
00140
00141
00142
00143
00144
00148 vector<int> oddCycle;
00149
00153 unsigned thisHashKey;
00154
00159 Graph *itsGraph;
00160 };
00161
00162 #endif
00163
00164