00001 /* 00002 * $Revision: 2299 $ 00003 * 00004 * last checkin: 00005 * $Author: gutwenger $ 00006 * $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 00007 ***************************************************************/ 00008 00047 #ifndef OGDF_CLUSTER_CUT_CONSTRAINT_H 00048 #define OGDF_CLUSTER_CUT_CONSTRAINT_H 00049 00050 #include <ogdf/internal/cluster/Cluster_EdgeVar.h> 00051 #include <ogdf/internal/cluster/basics.h> 00052 00053 #include <abacus/constraint.h> 00054 00055 namespace ogdf { 00056 00057 class CutConstraint : public BaseConstraint { 00058 00059 public: 00060 00061 CutConstraint(ABA_MASTER *master, ABA_SUB *sub, List<nodePair> &edges); 00062 00063 virtual ~CutConstraint(); 00064 00065 // Computes and returns the coefficient for the given variable 00066 virtual double coeff(ABA_VARIABLE *v) { EdgeVar *ev = (EdgeVar *)v; return (double)coeff(ev->sourceNode(), ev->targetNode()); } 00067 inline int coeff(const nodePair& n) { return coeff(n.v1,n.v2); } 00068 int coeff(node n1, node n2); 00069 00070 void printMe(ostream& out) const { 00071 out << "[CutCon: "; 00072 forall_listiterators(nodePair, it, m_cutEdges) { 00073 (*it).printMe(out); 00074 out << ","; 00075 } 00076 out << "]"; 00077 } 00078 00079 private: 00080 00081 // The list containing the node pairs corresponding to the cut edges 00082 List<nodePair> m_cutEdges; 00083 00084 }; 00085 00086 } 00087 00088 #endif