Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
vpsc::Block Class Reference

#include <block.h>

Public Member Functions

 Block (Blocks *blocks, Variable *const v=nullptr)
 
 ~Block (void)
 
ConstraintfindMinLM ()
 
ConstraintfindMinLMBetween (Variable *const lv, Variable *const rv)
 
ConstraintfindMinInConstraint ()
 
ConstraintfindMinOutConstraint ()
 
void deleteMinInConstraint ()
 
void deleteMinOutConstraint ()
 
void updateWeightedPosition ()
 
void merge (Block *b, Constraint *c, double dist)
 
Blockmerge (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 ()
 
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

Variablesvars
 
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

Blocksblocks
 

Friends

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

Detailed Description

Definition at line 51 of file block.h.

Member Typedef Documentation

◆ Cit

typedef Constraints::iterator vpsc::Block::Cit
private

Definition at line 56 of file block.h.

◆ Cit_const

typedef Constraints::const_iterator vpsc::Block::Cit_const
private

Definition at line 57 of file block.h.

◆ Constraints

typedef std::vector<Constraint*> vpsc::Block::Constraints
private

Definition at line 54 of file block.h.

◆ Pair

typedef std::pair<double, Constraint*> vpsc::Block::Pair
private

Definition at line 95 of file block.h.

◆ Variables

typedef std::vector<Variable*> vpsc::Block::Variables
private

Definition at line 53 of file block.h.

◆ Vit

typedef Variables::iterator vpsc::Block::Vit
private

Definition at line 55 of file block.h.

Member Enumeration Documentation

◆ Direction

enum vpsc::Block::Direction
private
Enumerator
NONE 
LEFT 
RIGHT 

Definition at line 94 of file block.h.

Constructor & Destructor Documentation

◆ Block()

vpsc::Block::Block ( Blocks blocks,
Variable *const  v = nullptr 
)

Definition at line 80 of file block.cpp.

References addVariable().

◆ ~Block()

vpsc::Block::~Block ( void  )

Definition at line 111 of file block.cpp.

References in, out, and vars.

Member Function Documentation

◆ addVariable()

void vpsc::Block::addVariable ( Variable v)
private

◆ canFollowLeft()

bool vpsc::Block::canFollowLeft ( Constraint const *  c,
Variable const *  last 
) const
inlineprivate

◆ canFollowRight()

bool vpsc::Block::canFollowRight ( Constraint const *  c,
Variable const *  last 
) const
inlineprivate

◆ compute_dfdv() [1/2]

double vpsc::Block::compute_dfdv ( Variable *const  v,
Variable *const  u 
)
private

◆ compute_dfdv() [2/2]

double vpsc::Block::compute_dfdv ( Variable *const  v,
Variable *const  u,
Constraint *&  min_lm 
)
private

Definition at line 297 of file block.cpp.

References c, canFollowLeft(), canFollowRight(), compute_dfdv(), and vpsc::Constraint::lm.

◆ cost()

double vpsc::Block::cost ( )

Definition at line 626 of file block.cpp.

References c, and vars.

◆ deleteMinInConstraint()

void vpsc::Block::deleteMinInConstraint ( )

Definition at line 274 of file block.cpp.

References in.

Referenced by vpsc::Solver::blockGraphIsCyclic(), and vpsc::Blocks::mergeLeft().

◆ deleteMinOutConstraint()

void vpsc::Block::deleteMinOutConstraint ( )

Definition at line 282 of file block.cpp.

References out.

Referenced by vpsc::Solver::blockGraphIsCyclic(), and vpsc::Blocks::mergeRight().

◆ findMinInConstraint()

Constraint * vpsc::Block::findMinInConstraint ( )

◆ findMinLM()

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

◆ findMinLMBetween()

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

◆ findMinOutConstraint()

Constraint * vpsc::Block::findMinOutConstraint ( )

Definition at line 264 of file block.cpp.

References out.

Referenced by vpsc::Solver::blockGraphIsCyclic(), mergeOut(), and vpsc::Blocks::mergeRight().

◆ getActiveDirectedPathBetween()

bool vpsc::Block::getActiveDirectedPathBetween ( Constraints path,
Variable const *  u,
Variable const *  v 
) const

◆ getActivePathBetween()

bool vpsc::Block::getActivePathBetween ( Constraints path,
Variable const *  u,
Variable const *  v,
Variable const *  w 
) const

◆ isActiveDirectedPathBetween()

bool vpsc::Block::isActiveDirectedPathBetween ( Variable const *  u,
Variable const *  v 
) const

◆ list_active()

void vpsc::Block::list_active ( Variable *const  v,
Variable *const  u 
)
private

Definition at line 460 of file block.cpp.

References c, canFollowLeft(), canFollowRight(), and list_active().

Referenced by findMinLM(), and list_active().

◆ merge() [1/2]

Block * vpsc::Block::merge ( Block b,
Constraint c 
)

Definition at line 140 of file block.cpp.

References c, deleted, merge(), and vars.

◆ merge() [2/2]

void vpsc::Block::merge ( Block b,
Constraint c,
double  dist 
)

◆ mergeIn()

void vpsc::Block::mergeIn ( Block b)

Definition at line 197 of file block.cpp.

References findMinInConstraint(), and in.

Referenced by vpsc::Blocks::mergeLeft().

◆ mergeOut()

void vpsc::Block::mergeOut ( Block b)

Definition at line 210 of file block.cpp.

References findMinOutConstraint(), and out.

Referenced by vpsc::Blocks::mergeRight().

◆ populateSplitBlock()

void vpsc::Block::populateSplitBlock ( Block b,
Variable v,
Variable const *  u 
)
private

Definition at line 522 of file block.cpp.

References addVariable(), c, canFollowLeft(), canFollowRight(), and populateSplitBlock().

Referenced by populateSplitBlock(), and split().

◆ reset_active_lm()

void vpsc::Block::reset_active_lm ( Variable *const  v,
Variable *const  u 
)
private

◆ setUpConstraintHeap()

void vpsc::Block::setUpConstraintHeap ( PairingHeap< Constraint *, CompareConstraints > *&  h,
bool  in 
)
private

◆ setUpInConstraints()

void vpsc::Block::setUpInConstraints ( )

◆ setUpOutConstraints()

void vpsc::Block::setUpOutConstraints ( )

◆ split()

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

◆ split_path()

bool vpsc::Block::split_path ( Variable r,
Variable * const  v,
Variable * const  u,
Constraint *&  min_lm,
bool  desperation = false 
)
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().

◆ splitBetween()

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

◆ updateWeightedPosition()

void vpsc::Block::updateWeightedPosition ( )

Friends And Related Symbol Documentation

◆ operator<<

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

Definition at line 634 of file block.cpp.

Member Data Documentation

◆ blocks

Blocks* vpsc::Block::blocks
private

Definition at line 109 of file block.h.

Referenced by findMinInConstraint(), setUpConstraintHeap(), and split().

◆ deleted

bool vpsc::Block::deleted

◆ in

◆ out

◆ posn

◆ ps

◆ timeStamp

long vpsc::Block::timeStamp

◆ vars


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