Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

ChunkConnection.h
Go to the documentation of this file.
1 
41 #pragma once
42 
43 #include <ogdf/basic/Array.h>
44 #include <ogdf/basic/ArrayBuffer.h>
48 
50 
51 namespace ogdf {
52 namespace cluster_planarity {
53 
55 #ifdef OGDF_DEBUG
56  //Mainly for debugging output purposes
57  friend class MaxCPlanarMaster;
58  friend class MaxCPlanarSub;
59  friend class CPlanarMaster;
60  friend class CPlanarSub;
61 #endif
62 public:
63 
64  ChunkConnection(abacus::Master *master, const ArrayBuffer<node>& chunk, const ArrayBuffer<node>& cochunk);
65 
66  virtual ~ChunkConnection();
67 
68  // Computes and returns the coefficient for the given variable
69  virtual double coeff(const abacus::Variable *v) const override {
70  const EdgeVar *ev = static_cast<const EdgeVar *>(v);
71  //Safe for both clustered planarity testing and maximum c-planar subgraph
72  return (ev->theEdgeType() != EdgeVar::EdgeType::Connect) ? 0.0 : (double)coeff(ev->sourceNode(), ev->targetNode());
73  }
74  inline int coeff(const NodePair& n) const override { return coeff(n.source ,n.target); }
75  int coeff(node v1, node v2) const;
76 
77  void printMe(std::ostream& out) const {
78  out << "[ChunkCon: (";
79  for(node v : m_chunk) {
80  Logger::slout() << v << ",";
81  }
82  out << "|";
83  for(node v : m_cochunk) {
84  Logger::slout() << v << ",";
85  }
86  out << ")]";
87  }
88 
89 private:
90  // The nodePairs corresponding to the constraint
93 };
94 
95 }
96 }
EdgeType theEdgeType() const
Definition: EdgeVar.h:59
Derived class of GraphObserver providing additional functionality to handle clustered graphs...
The master of the optimization.
Definition: master.h:69
Declaration and implementation of ArrayBuffer class.
ChunkConnection(abacus::Master *master, const ArrayBuffer< node > &chunk, const ArrayBuffer< node > &cochunk)
virtual double coeff(const abacus::Variable *v) const override
Returns the coefficient of the variable v in the constraint.
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
Definition: Array.h:45
static std::ostream & slout(Level level=Level::Default)
stream for logging-output (global)
Definition: Logger.h:168
Declaration and implementation of Array class and Array algorithms.
void printMe(std::ostream &out) const
Declaration of the variable class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph prob...
Basic constraint type.
Definition: basics.h:59
constraint.
Class for the representation of nodes.
Definition: Graph_d.h:169
Forms the virtual base class for all possible variables given in pool format.
Definition: variable.h:59
int coeff(const NodePair &n) const override
The namespace for all OGDF objects.
Declaration of the master class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph proble...