Graphviz 16.1.1~dev.20261012.0359
Loading...
Searching...
No Matches
Blocks Class Reference

#include <blocks.h>

Inheritance diagram for Blocks:
[legend]
Collaboration diagram for Blocks:
[legend]

Public Member Functions

 Blocks (const int n, Variable *vs[])
 
 ~Blocks ()
 
void mergeLeft (Block *r)
 
void mergeRight (Block *l)
 
void split (Block *b, Block *&l, Block *&r, Constraint *c)
 
std::list< Variable * > totalOrder ()
 
void cleanup ()
 
double cost ()
 

Detailed Description

A block structure defined over the variables such that each block contains 1 or more variables, with the invariant that all constraints inside a block are satisfied by keeping the variables fixed relative to one another

Definition at line 37 of file blocks.h.

Constructor & Destructor Documentation

◆ Blocks()

Blocks::Blocks ( const int  n,
Variable *  vs[] 
)

Definition at line 39 of file blocks.cpp.

References blockTimeCtr, and insert().

Here is the call graph for this function:

◆ ~Blocks()

Blocks::~Blocks ( )

Definition at line 45 of file blocks.cpp.

References blockTimeCtr.

Member Function Documentation

◆ cleanup()

void Blocks::cleanup ( )

Definition at line 158 of file blocks.cpp.

References Block::deleted.

Referenced by VPSC::satisfy(), IncVPSC::satisfy(), and IncVPSC::splitBlocks().

Here is the caller graph for this function:

◆ cost()

double Blocks::cost ( )

returns the cost total squared distance of variables from their desired positions

Definition at line 197 of file blocks.cpp.

Referenced by IncVPSC::solve().

Here is the caller graph for this function:

◆ mergeLeft()

void Blocks::mergeLeft ( Block *  r)

Processes incoming constraints, most violated to least, merging with the neighbouring (left) block until no more violated constraints are found

Definition at line 88 of file blocks.cpp.

References Variable::block, blockTimeCtr, Block::deleteMinInConstraint(), dist(), Block::findMinInConstraint(), Constraint::gap, Block::in, Constraint::left, LOGFILE, Block::merge(), Block::mergeIn(), Variable::offset, RECTANGLE_OVERLAP_LOGGING, Constraint::right, Block::setUpInConstraints(), Constraint::slack(), Block::timeStamp, and Block::vars.

Referenced by VPSC::satisfy(), and split().

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

◆ mergeRight()

void Blocks::mergeRight ( Block *  l)

Symmetrical to mergeLeft

Definition at line 124 of file blocks.cpp.

References Variable::block, Block::deleteMinOutConstraint(), dist(), Block::findMinOutConstraint(), Constraint::gap, Constraint::left, LOGFILE, Block::merge(), Block::mergeOut(), Variable::offset, RECTANGLE_OVERLAP_LOGGING, Constraint::right, Block::setUpOutConstraints(), Constraint::slack(), and Block::vars.

Referenced by split().

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

◆ split()

void Blocks::split ( Block *  b,
Block *&  l,
Block *&  r,
Constraint *  c 
)

Splits block b across constraint c into two new blocks, l and r (c's left and right sides respectively)

Definition at line 173 of file blocks.cpp.

References Variable::block, Block::desiredWeightedPosition(), insert(), LOGFILE, mergeLeft(), mergeRight(), Block::posn, RECTANGLE_OVERLAP_LOGGING, Constraint::right, Block::split(), Block::weight, and Block::wposn.

Here is the call graph for this function:

◆ totalOrder()

list< Variable * > Blocks::totalOrder ( )

returns a list of variables with total ordering determined by the constraint DAG

Definition at line 57 of file blocks.cpp.

References in(), and Variable::visited.

Referenced by VPSC::satisfy().

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

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