Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
Block Class Reference

#include <block.h>

Public Member Functions

 Block (Variable *v=nullptr)
 
 Block (const Block &)=delete
 
ConstraintfindMinLM ()
 
ConstraintfindMinLMBetween (Variable *lv, Variable *rv)
 
ConstraintfindMinInConstraint ()
 
ConstraintfindMinOutConstraint ()
 
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)
 
ConstraintsplitBetween (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)
 

Detailed Description

Definition at line 27 of file block.h.

Constructor & Destructor Documentation

◆ Block() [1/2]

Block::Block ( Variable v = nullptr)

Definition at line 83 of file block.cpp.

References deleted, Variable::offset, posn, timeStamp, weight, and wposn.

◆ Block() [2/2]

Block::Block ( const Block )
delete

Member Function Documentation

◆ cost()

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.

Here is the call graph for this function:

◆ deleteMinInConstraint()

void Block::deleteMinInConstraint ( )

Definition at line 237 of file block.cpp.

References deleteMin(), and in.

Referenced by Blocks::mergeLeft().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteMinOutConstraint()

void Block::deleteMinOutConstraint ( )

Definition at line 240 of file block.cpp.

References deleteMin(), and out.

Referenced by Blocks::mergeRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ desiredWeightedPosition()

double Block::desiredWeightedPosition ( )

Definition at line 93 of file block.cpp.

References Variable::desiredPosition, Variable::offset, vars, and Variable::weight.

Referenced by Blocks::split().

Here is the caller graph for this function:

◆ findMinInConstraint()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMinLM()

Constraint * Block::findMinLM ( )

finds the constraint with the minimum lagrange multiplier, that is, the constraint that most wants to split

Definition at line 345 of file block.cpp.

References vars.

◆ findMinLMBetween()

Constraint * Block::findMinLMBetween ( Variable lv,
Variable rv 
)

Definition at line 351 of file block.cpp.

References vars.

Referenced by splitBetween().

Here is the caller graph for this function:

◆ findMinOutConstraint()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge() [1/2]

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.

Here is the call graph for this function:

◆ merge() [2/2]

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

Parameters
bblock to merge into this
cconstraint being merged
distanceseparation 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergeIn()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergeOut()

void Block::mergeOut ( Block b)

Definition at line 173 of file block.cpp.

References findMinOutConstraint(), merge_heaps(), and out.

Referenced by Blocks::mergeRight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpInConstraints()

void Block::setUpInConstraints ( )

Definition at line 100 of file block.cpp.

References in.

Referenced by Blocks::mergeLeft().

Here is the caller graph for this function:

◆ setUpOutConstraints()

void Block::setUpOutConstraints ( )

Definition at line 103 of file block.cpp.

References out.

Referenced by Blocks::mergeRight().

Here is the caller graph for this function:

◆ split()

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().

Here is the caller graph for this function:

◆ splitBetween()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Block b 
)
friend

Definition at line 417 of file block.cpp.

Field Documentation

◆ deleted

bool Block::deleted

Definition at line 53 of file block.h.

Referenced by Block(), Blocks::cleanup(), merge(), merge(), splitBetween(), and IncVPSC::splitBlocks().

◆ in

std::vector<Constraint *> Block::in

◆ out

std::vector<Constraint *> Block::out

◆ posn

double Block::posn

Definition at line 32 of file block.h.

Referenced by Block(), merge(), Blocks::split(), and IncVPSC::splitBlocks().

◆ timeStamp

long Block::timeStamp

Definition at line 54 of file block.h.

Referenced by Block(), compareConstraints(), findMinInConstraint(), and Blocks::mergeLeft().

◆ vars

std::vector<Variable*> Block::vars

◆ weight

double Block::weight

Definition at line 33 of file block.h.

Referenced by Block(), merge(), and Blocks::split().

◆ wposn

double Block::wposn

Definition at line 34 of file block.h.

Referenced by Block(), merge(), and Blocks::split().


The documentation for this class was generated from the following files: