00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00018
00020
00021
00022 #ifndef GENERAL_CONSTRAINT_HH
00023 #define GENERAL_CONSTRAINT_HH
00024
00025
00026 #include "abacus/constraint.h"
00027 #include <vector>
00028
00029 using namespace std;
00030
00031 class Graph;
00032
00033
00038 class GeneralConstraint: public ABA_CONSTRAINT {
00039
00040
00041 public:
00042
00043
00044
00045
00046
00058 GeneralConstraint(ABA_MASTER *master, vector<int> *vertices,
00059 vector<int> *dualCoeff, int rhs, Graph *theGraph);
00060
00064 virtual ~GeneralConstraint();
00065
00073 int genRow(ABA_ACTIVE<ABA_VARIABLE,ABA_CONSTRAINT> *var, ABA_ROW &row);
00074
00081 virtual double coeff(ABA_VARIABLE *var);
00082
00088 int getSize();
00089
00097 bool isInConstraint(int node);
00098
00106 virtual bool equal(ABA_CONVAR *cv);
00107
00113 virtual const char* name();
00114
00120 virtual unsigned hashKey();
00121
00122
00123 private:
00124
00125
00126
00127
00128
00132 void calculateHashKey();
00133
00134
00135
00136
00137
00138
00142 vector<int> nodes;
00143
00147 vector<int> coefficients;
00148
00152 int itsRhs;
00153
00157 Graph *itsGraph;
00158
00162 unsigned thisHashKey;
00163 };
00164
00165 #endif
00166
00167
00168
00169