31#ifndef RECTANGLE_OVERLAP_LOGGING
32 #define RECTANGLE_OVERLAP_LOGGING 0
39 for(
int i=0;i<nvs;i++) {
46 for (
Block *b : *
this) {
56 list<Variable*> order;
57 for(
int i=0;i<nvs;i++) {
60 for(
int i=0;i<nvs;i++) {
61 if(vs[i]->in.empty()) {
62 dfsVisit(vs[i],order);
69void Blocks::dfsVisit(
Variable *v, list<Variable*> &order) {
72 if(!c->right->visited) {
73 dfsVisit(c->right, order);
78 f<<
" order="<<*v<<
"\n";
89 f<<
"mergeLeft called on "<<*r<<
"\n";
94 while (c !=
nullptr && c->
slack()<0) {
97 f<<
"mergeLeft on constraint: "<<*c<<
"\n";
103 if (r->
vars.size() < l->
vars.size()) {
116 f<<
"merged "<<*r<<
"\n";
125 f<<
"mergeRight called on "<<*l<<
"\n";
129 while (c !=
nullptr && c->
slack()<0) {
132 f<<
"mergeRight on constraint: "<<*c<<
"\n";
138 if (l->
vars.size() > r->
vars.size()) {
149 f<<
"merged "<<*l<<
"\n";
152void Blocks::removeBlock(
Block *doomed) {
157 for (
auto i = begin(); i != end();) {
175 f<<
"Split left: "<<*l<<
"\n";
176 f<<
"Split right: "<<*r<<
"\n";
197 for (
Block *b : *
this) {
static void out(agerrlevel_t level, const char *fmt, va_list args)
Report messages using a user-supplied or default write function.
#define RECTANGLE_OVERLAP_LOGGING
#define LOGFILE
A block structure defined over the variables.
Constraint * findMinInConstraint()
std::vector< Variable * > vars
void split(Block *&l, Block *&r, Constraint *c)
void deleteMinOutConstraint()
std::vector< Constraint * > in
void setUpOutConstraints()
void setUpInConstraints()
double desiredWeightedPosition()
Constraint * findMinOutConstraint()
void merge(Block *b, Constraint *c, double dist)
void deleteMinInConstraint()
void split(Block *b, Block *&l, Block *&r, Constraint *c)
std::list< Variable * > totalOrder()
Blocks(const int n, Variable *vs[])
void mergeRight(Block *l)
static void insert(PairHeap *h, Pair edge)
static double dist(int dim, double *x, double *y)
A constraint determines a minimum or exact spacing required between two variables.