Graphviz 13.0.0~dev.20241222.1117
|
#include <block.h>
Public Member Functions | |
Block (Variable *v=nullptr) | |
Block (const Block &)=delete | |
Constraint * | findMinLM () |
Constraint * | findMinLMBetween (Variable *lv, Variable *rv) |
Constraint * | findMinInConstraint () |
Constraint * | findMinOutConstraint () |
void | deleteMinInConstraint () |
void | deleteMinOutConstraint () |
double | desiredWeightedPosition () |
void | merge (Block *b, Constraint *c, double dist) |
void | merge (Block *b, Constraint *c) |
void | mergeIn (Block *b) |
void | mergeOut (Block *b) |
void | split (Block *&l, Block *&r, Constraint *c) |
Constraint * | splitBetween (Variable *vl, Variable *vr, Block *&lb, Block *&rb) |
void | setUpInConstraints () |
void | setUpOutConstraints () |
double | cost () |
Data Fields | |
std::vector< Variable * > | vars |
double | posn |
double | weight |
double | wposn |
bool | deleted |
long | timeStamp |
std::vector< Constraint * > | in |
std::vector< Constraint * > | out |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Block &b) |
Block::Block | ( | Variable * | v = nullptr | ) |
|
delete |
double Block::cost | ( | ) |
Computes the cost (squared euclidean distance from desired positions) of the current positions for variables in this block
Definition at line 408 of file block.cpp.
References Variable::desiredPosition, Variable::position(), vars, and Variable::weight.
void Block::deleteMinInConstraint | ( | ) |
Definition at line 237 of file block.cpp.
References deleteMin(), and in.
Referenced by Blocks::mergeLeft().
void Block::deleteMinOutConstraint | ( | ) |
Definition at line 240 of file block.cpp.
References deleteMin(), and out.
Referenced by Blocks::mergeRight().
double Block::desiredWeightedPosition | ( | ) |
Definition at line 93 of file block.cpp.
References Variable::desiredPosition, Variable::offset, vars, and Variable::weight.
Referenced by Blocks::split().
Constraint * Block::findMinInConstraint | ( | ) |
Definition at line 178 of file block.cpp.
References Variable::block, blockTimeCtr, deleteMin(), findMin(), in, insert(), Constraint::left, LOGFILE, RECTANGLE_OVERLAP_LOGGING, Constraint::right, Constraint::slack(), timeStamp, and Constraint::timeStamp.
Referenced by mergeIn(), and Blocks::mergeLeft().
Constraint * Block::findMinLM | ( | ) |
Constraint * Block::findMinLMBetween | ( | Variable * | lv, |
Variable * | rv | ||
) |
Definition at line 351 of file block.cpp.
References vars.
Referenced by splitBetween().
Constraint * Block::findMinOutConstraint | ( | ) |
Definition at line 227 of file block.cpp.
References Variable::block, deleteMin(), findMin(), Constraint::left, out, and Constraint::right.
Referenced by mergeOut(), and Blocks::mergeRight().
void Block::merge | ( | Block * | b, |
Constraint * | c | ||
) |
Definition at line 121 of file block.cpp.
References Variable::block, deleted, dist(), Constraint::gap, Constraint::left, LOGFILE, merge(), Variable::offset, RECTANGLE_OVERLAP_LOGGING, Constraint::right, and vars.
void Block::merge | ( | Block * | b, |
Constraint * | c, | ||
double | dist | ||
) |
Merges b into this block across c. Can be either a right merge or a left merge
b | block to merge into this |
c | constraint being merged |
distance | separation required to satisfy c |
Definition at line 146 of file block.cpp.
References Constraint::active, Variable::block, deleted, dist(), LOGFILE, Variable::offset, posn, RECTANGLE_OVERLAP_LOGGING, vars, weight, and wposn.
Referenced by merge(), Blocks::mergeLeft(), Blocks::mergeRight(), and IncVPSC::satisfy().
void Block::mergeIn | ( | Block * | b | ) |
Definition at line 163 of file block.cpp.
References findMinInConstraint(), in, LOGFILE, merge_heaps(), and RECTANGLE_OVERLAP_LOGGING.
Referenced by Blocks::mergeLeft().
void Block::mergeOut | ( | Block * | b | ) |
Definition at line 173 of file block.cpp.
References findMinOutConstraint(), merge_heaps(), and out.
Referenced by Blocks::mergeRight().
void Block::setUpInConstraints | ( | ) |
Definition at line 100 of file block.cpp.
References in.
Referenced by Blocks::mergeLeft().
void Block::setUpOutConstraints | ( | ) |
Definition at line 103 of file block.cpp.
References out.
Referenced by Blocks::mergeRight().
void Block::split | ( | Block *& | l, |
Block *& | r, | ||
Constraint * | c | ||
) |
Creates two new blocks, l and r, and splits this block across constraint c, placing the left subtree of constraints (and associated variables) into l and the right into r.
Definition at line 396 of file block.cpp.
References Constraint::active, Constraint::left, and Constraint::right.
Referenced by Blocks::split(), and IncVPSC::splitBlocks().
Constraint * Block::splitBetween | ( | Variable * | vl, |
Variable * | vr, | ||
Block *& | lb, | ||
Block *& | rb | ||
) |
Block needs to be split because of a violated constraint between vl and vr. We need to search the active constraint tree between l and r and find the constraint with min lagrangrian multiplier and split at that point. Returns the split constraint
Definition at line 377 of file block.cpp.
References deleted, findMinLMBetween(), LOGFILE, RECTANGLE_OVERLAP_LOGGING, and split().
Referenced by IncVPSC::satisfy().
|
friend |
bool Block::deleted |
Definition at line 53 of file block.h.
Referenced by Block(), Blocks::cleanup(), merge(), merge(), splitBetween(), and IncVPSC::splitBlocks().
std::vector<Constraint *> Block::in |
Definition at line 55 of file block.h.
Referenced by deleteMinInConstraint(), findMinInConstraint(), mergeIn(), Blocks::mergeLeft(), and setUpInConstraints().
std::vector<Constraint *> Block::out |
Definition at line 56 of file block.h.
Referenced by deleteMinOutConstraint(), findMinOutConstraint(), mergeOut(), and setUpOutConstraints().
double Block::posn |
Definition at line 32 of file block.h.
Referenced by Block(), merge(), Blocks::split(), and IncVPSC::splitBlocks().
long Block::timeStamp |
Definition at line 54 of file block.h.
Referenced by Block(), compareConstraints(), findMinInConstraint(), and Blocks::mergeLeft().
std::vector<Variable*> Block::vars |
Definition at line 31 of file block.h.
Referenced by cost(), desiredWeightedPosition(), findMinLM(), findMinLMBetween(), merge(), merge(), Blocks::mergeLeft(), and Blocks::mergeRight().
double Block::weight |
Definition at line 33 of file block.h.
Referenced by Block(), merge(), and Blocks::split().
double Block::wposn |
Definition at line 34 of file block.h.
Referenced by Block(), merge(), and Blocks::split().