Inkscape
Vector Graphics Editor
|
#include <block.h>
Public Member Functions | |
Block (Blocks *blocks, Variable *const v=nullptr) | |
~Block (void) | |
Constraint * | findMinLM () |
Constraint * | findMinLMBetween (Variable *const lv, Variable *const rv) |
Constraint * | findMinInConstraint () |
Constraint * | findMinOutConstraint () |
void | deleteMinInConstraint () |
void | deleteMinOutConstraint () |
void | updateWeightedPosition () |
void | merge (Block *b, Constraint *c, double dist) |
Block * | 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 () |
bool | getActivePathBetween (Constraints &path, Variable const *u, Variable const *v, Variable const *w) const |
bool | isActiveDirectedPathBetween (Variable const *u, Variable const *v) const |
bool | getActiveDirectedPathBetween (Constraints &path, Variable const *u, Variable const *v) const |
Public Attributes | |
Variables * | vars |
double | posn |
PositionStats | ps |
bool | deleted |
long | timeStamp |
PairingHeap< Constraint *, CompareConstraints > * | in |
PairingHeap< Constraint *, CompareConstraints > * | out |
Private Types | |
enum | Direction { NONE , LEFT , RIGHT } |
typedef std::vector< Variable * > | Variables |
typedef std::vector< Constraint * > | Constraints |
typedef Variables::iterator | Vit |
typedef Constraints::iterator | Cit |
typedef Constraints::const_iterator | Cit_const |
typedef std::pair< double, Constraint * > | Pair |
Private Member Functions | |
void | reset_active_lm (Variable *const v, Variable *const u) |
void | list_active (Variable *const v, Variable *const u) |
double | compute_dfdv (Variable *const v, Variable *const u) |
double | compute_dfdv (Variable *const v, Variable *const u, Constraint *&min_lm) |
bool | split_path (Variable *, Variable *const, Variable *const, Constraint *&min_lm, bool desperation) |
bool | canFollowLeft (Constraint const *c, Variable const *last) const |
bool | canFollowRight (Constraint const *c, Variable const *last) const |
void | populateSplitBlock (Block *b, Variable *v, Variable const *u) |
void | addVariable (Variable *v) |
void | setUpConstraintHeap (PairingHeap< Constraint *, CompareConstraints > *&h, bool in) |
Private Attributes | |
Blocks * | blocks |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Block &b) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 80 of file block.cpp.
References addVariable().
vpsc::Block::~Block | ( | void | ) |
|
private |
Definition at line 63 of file block.cpp.
References vpsc::PositionStats::A2, vpsc::PositionStats::AB, vpsc::PositionStats::AD, vpsc::PositionStats::addVariable(), posn, ps, vpsc::PositionStats::scale, and vars.
Referenced by Block(), merge(), and populateSplitBlock().
|
inlineprivate |
Definition at line 285 of file block.cpp.
References c.
Referenced by compute_dfdv(), compute_dfdv(), getActivePathBetween(), list_active(), populateSplitBlock(), reset_active_lm(), and split_path().
|
inlineprivate |
Definition at line 288 of file block.cpp.
References vpsc::Variable::block, and c.
Referenced by compute_dfdv(), compute_dfdv(), getActiveDirectedPathBetween(), getActivePathBetween(), isActiveDirectedPathBetween(), list_active(), populateSplitBlock(), reset_active_lm(), and split_path().
Definition at line 318 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), compute_dfdv(), and vpsc::Constraint::lm.
Referenced by compute_dfdv(), compute_dfdv(), findMinLM(), and findMinLMBetween().
|
private |
Definition at line 297 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), compute_dfdv(), and vpsc::Constraint::lm.
void vpsc::Block::deleteMinInConstraint | ( | ) |
Definition at line 274 of file block.cpp.
References in.
Referenced by vpsc::Solver::blockGraphIsCyclic(), and vpsc::Blocks::mergeLeft().
void vpsc::Block::deleteMinOutConstraint | ( | ) |
Definition at line 282 of file block.cpp.
References out.
Referenced by vpsc::Solver::blockGraphIsCyclic(), and vpsc::Blocks::mergeRight().
Constraint * vpsc::Block::findMinInConstraint | ( | ) |
Definition at line 215 of file block.cpp.
References blocks, vpsc::Blocks::blockTimeCtr, in, and timeStamp.
Referenced by vpsc::Solver::blockGraphIsCyclic(), mergeIn(), and vpsc::Blocks::mergeLeft().
Constraint * vpsc::Block::findMinLM | ( | ) |
Definition at line 486 of file block.cpp.
References compute_dfdv(), list_active(), reset_active_lm(), and vars.
Referenced by vpsc::Solver::refine(), and vpsc::IncSolver::splitBlocks().
Constraint * vpsc::Block::findMinLMBetween | ( | Variable *const | lv, |
Variable *const | rv | ||
) |
Definition at line 497 of file block.cpp.
References compute_dfdv(), getActivePathBetween(), vpsc::UnsatisfiableException::path, reset_active_lm(), split_path(), and vars.
Referenced by splitBetween(), test1(), and test2().
Constraint * vpsc::Block::findMinOutConstraint | ( | ) |
Definition at line 264 of file block.cpp.
References out.
Referenced by vpsc::Solver::blockGraphIsCyclic(), mergeOut(), and vpsc::Blocks::mergeRight().
bool vpsc::Block::getActiveDirectedPathBetween | ( | Constraints & | path, |
Variable const * | u, | ||
Variable const * | v | ||
) | const |
Definition at line 571 of file block.cpp.
References c, canFollowRight(), getActiveDirectedPathBetween(), and vpsc::Variable::out.
Referenced by getActiveDirectedPathBetween().
bool vpsc::Block::getActivePathBetween | ( | Constraints & | path, |
Variable const * | u, | ||
Variable const * | v, | ||
Variable const * | w | ||
) | const |
Definition at line 536 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), getActivePathBetween(), vpsc::Variable::in, vpsc::Variable::out, and w.
Referenced by findMinLMBetween(), and getActivePathBetween().
Definition at line 560 of file block.cpp.
References c, canFollowRight(), isActiveDirectedPathBetween(), and vpsc::Variable::out.
Referenced by isActiveDirectedPathBetween(), and vpsc::IncSolver::satisfy().
Definition at line 460 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), and list_active().
Referenced by findMinLM(), and list_active().
Block * vpsc::Block::merge | ( | Block * | b, |
Constraint * | c | ||
) |
void vpsc::Block::merge | ( | Block * | b, |
Constraint * | c, | ||
double | dist | ||
) |
Definition at line 166 of file block.cpp.
References vpsc::PositionStats::A2, vpsc::PositionStats::AB, vpsc::PositionStats::AD, addVariable(), c, deleted, posn, ps, and vars.
Referenced by merge(), vpsc::Blocks::mergeLeft(), vpsc::Blocks::mergeRight(), vpsc::IncSolver::satisfy(), test1(), and test2().
void vpsc::Block::mergeIn | ( | Block * | b | ) |
Definition at line 197 of file block.cpp.
References findMinInConstraint(), and in.
Referenced by vpsc::Blocks::mergeLeft().
void vpsc::Block::mergeOut | ( | Block * | b | ) |
Definition at line 210 of file block.cpp.
References findMinOutConstraint(), and out.
Referenced by vpsc::Blocks::mergeRight().
Definition at line 522 of file block.cpp.
References addVariable(), c, canFollowLeft(), canFollowRight(), and populateSplitBlock().
Referenced by populateSplitBlock(), and split().
Definition at line 444 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), vpsc::Constraint::lm, and reset_active_lm().
Referenced by findMinLM(), findMinLMBetween(), and reset_active_lm().
|
private |
Definition at line 123 of file block.cpp.
References blocks, vpsc::Blocks::blockTimeCtr, c, in, PairingHeap< T, TCompare >::insert(), vpsc::Constraint::timeStamp, and vars.
Referenced by setUpInConstraints(), and setUpOutConstraints().
void vpsc::Block::setUpInConstraints | ( | ) |
Definition at line 117 of file block.cpp.
References in, and setUpConstraintHeap().
Referenced by vpsc::Solver::blockGraphIsCyclic(), vpsc::Blocks::mergeLeft(), and vpsc::Solver::refine().
void vpsc::Block::setUpOutConstraints | ( | ) |
Definition at line 120 of file block.cpp.
References out, and setUpConstraintHeap().
Referenced by vpsc::Solver::blockGraphIsCyclic(), vpsc::Blocks::mergeRight(), and vpsc::Solver::refine().
void vpsc::Block::split | ( | Block *& | l, |
Block *& | r, | ||
Constraint * | c | ||
) |
Definition at line 612 of file block.cpp.
References blocks, c, and populateSplitBlock().
Referenced by vpsc::Blocks::split(), splitBetween(), and vpsc::IncSolver::splitBlocks().
|
private |
Definition at line 346 of file block.cpp.
References c, canFollowLeft(), canFollowRight(), vpsc::Constraint::lm, and split_path().
Referenced by findMinLMBetween(), and split_path().
Constraint * vpsc::Block::splitBetween | ( | Variable * | vl, |
Variable * | vr, | ||
Block *& | lb, | ||
Block *& | rb | ||
) |
Definition at line 590 of file block.cpp.
References c, deleted, findMinLMBetween(), and split().
Referenced by vpsc::IncSolver::satisfy().
void vpsc::Block::updateWeightedPosition | ( | ) |
Definition at line 97 of file block.cpp.
References vpsc::PositionStats::A2, vpsc::PositionStats::AB, vpsc::PositionStats::AD, vpsc::PositionStats::addVariable(), posn, ps, and vars.
Referenced by vpsc::IncSolver::moveBlocks(), and vpsc::Blocks::split().
|
friend |
|
private |
Definition at line 109 of file block.h.
Referenced by findMinInConstraint(), setUpConstraintHeap(), and split().
bool vpsc::Block::deleted |
Definition at line 84 of file block.h.
Referenced by merge(), merge(), vpsc::Blocks::removeBlock(), vpsc::IncSolver::satisfy(), splitBetween(), and vpsc::IncSolver::splitBlocks().
PairingHeap<Constraint*,CompareConstraints>* vpsc::Block::in |
Definition at line 86 of file block.h.
Referenced by vpsc::Solver::blockGraphIsCyclic(), deleteMinInConstraint(), findMinInConstraint(), mergeIn(), vpsc::Blocks::mergeLeft(), setUpConstraintHeap(), setUpInConstraints(), and ~Block().
PairingHeap<Constraint*,CompareConstraints>* vpsc::Block::out |
Definition at line 87 of file block.h.
Referenced by vpsc::Solver::blockGraphIsCyclic(), deleteMinOutConstraint(), findMinOutConstraint(), mergeOut(), setUpOutConstraints(), and ~Block().
double vpsc::Block::posn |
Definition at line 62 of file block.h.
Referenced by addVariable(), merge(), vpsc::Variable::position(), vpsc::Blocks::split(), vpsc::Variable::unscaledPosition(), and updateWeightedPosition().
PositionStats vpsc::Block::ps |
Definition at line 65 of file block.h.
Referenced by addVariable(), merge(), vpsc::Variable::position(), vpsc::Variable::unscaledPosition(), and updateWeightedPosition().
long vpsc::Block::timeStamp |
Definition at line 85 of file block.h.
Referenced by findMinInConstraint(), vpsc::Blocks::mergeLeft(), and vpsc::CompareConstraints::operator()().
Variables* vpsc::Block::vars |
Definition at line 61 of file block.h.
Referenced by addVariable(), cost(), findMinLM(), findMinLMBetween(), merge(), merge(), vpsc::Blocks::mergeLeft(), vpsc::Blocks::mergeRight(), setUpConstraintHeap(), updateWeightedPosition(), and ~Block().