summaryrefslogtreecommitdiffstats
path: root/src/libvpsc/blocks.cpp
diff options
context:
space:
mode:
authorAndrew Higginson <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
committerAndrew <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
commit80960b623a99aae1402ab651b2974ef544ed3b03 (patch)
treeba49d42c2789e9e11f805e2d5263e10f9fedeef8 /src/libvpsc/blocks.cpp
parenttry to fix bug (diff)
parentGDL: Cherry-pick upstream patch 73852 (2011-03-23) - Add missing return value. (diff)
downloadinkscape-80960b623a99aae1402ab651b2974ef544ed3b03.tar.gz
inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.zip
merged with trunk so I can build again...
(bzr r10092.1.36)
Diffstat (limited to 'src/libvpsc/blocks.cpp')
-rw-r--r--src/libvpsc/blocks.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/libvpsc/blocks.cpp b/src/libvpsc/blocks.cpp
index fe0caacfc..7eff1e6c4 100644
--- a/src/libvpsc/blocks.cpp
+++ b/src/libvpsc/blocks.cpp
@@ -1,9 +1,5 @@
-/**
- * \brief A block structure defined over the variables
- *
- * 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
+/*
+ * A block structure defined over the variables.
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
@@ -47,10 +43,6 @@ Blocks::~Blocks(void)
clear();
}
-/**
- * returns a list of variables with total ordering determined by the constraint
- * DAG
- */
list<Variable*> *Blocks::totalOrder() {
list<Variable*> *order = new list<Variable*>;
for(int i=0;i<nvs;i++) {
@@ -80,10 +72,7 @@ void Blocks::dfsVisit(Variable *v, list<Variable*> *order) {
#endif
order->push_front(v);
}
-/**
- * Processes incoming constraints, most violated to least, merging with the
- * neighbouring (left) block until no more violated constraints are found
- */
+
void Blocks::mergeLeft(Block *r) {
#ifdef RECTANGLE_OVERLAP_LOGGING
ofstream f(LOGFILE,ios::app);
@@ -115,9 +104,7 @@ void Blocks::mergeLeft(Block *r) {
f<<"merged "<<*r<<endl;
#endif
}
-/**
- * Symmetrical to mergeLeft
- */
+
void Blocks::mergeRight(Block *l) {
#ifdef RECTANGLE_OVERLAP_LOGGING
ofstream f(LOGFILE,ios::app);
@@ -160,10 +147,7 @@ void Blocks::cleanup() {
}
}
}
-/**
- * Splits block b across constraint c into two new blocks, l and r (c's left
- * and right sides respectively)
- */
+
void Blocks::split(Block *b, Block *&l, Block *&r, Constraint *c) {
b->split(l,r,c);
#ifdef RECTANGLE_OVERLAP_LOGGING
@@ -184,10 +168,7 @@ void Blocks::split(Block *b, Block *&l, Block *&r, Constraint *c) {
insert(l);
insert(r);
}
-/**
- * returns the cost total squared distance of variables from their desired
- * positions
- */
+
double Blocks::cost() {
double c = 0;
for(set<Block*>::iterator i=begin();i!=end();++i) {