From dcf765f3dcbff2e65428e0f002bb5ea3648940f0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Jun 2011 15:35:01 +0000 Subject: warning cleanup (no functional changes) - enclose && / || with brackets to avoid ambiguity. - don't cast from booleans to pointers. (bzr r10359) --- src/libvpsc/block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libvpsc/block.cpp') diff --git a/src/libvpsc/block.cpp b/src/libvpsc/block.cpp index 221df536a..0bd662f28 100644 --- a/src/libvpsc/block.cpp +++ b/src/libvpsc/block.cpp @@ -72,7 +72,7 @@ void Block::setUpConstraintHeap(PairingHeap* &h,bool in) { for (Cit j=cs->begin();j!=cs->end();++j) { Constraint *c=*j; c->timeStamp=blockTimeCtr; - if (c->left->block != this && in || c->right->block != this && !in) { + if ((c->left->block != this && in) || (c->right->block != this && !in)) { h->insert(c); } } -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/libvpsc/block.cpp | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/libvpsc/block.cpp') diff --git a/src/libvpsc/block.cpp b/src/libvpsc/block.cpp index 0bd662f28..8171780d4 100644 --- a/src/libvpsc/block.cpp +++ b/src/libvpsc/block.cpp @@ -1,8 +1,4 @@ -/** - * \brief A block is a group of variables that must be moved together to improve - * the goal function without violating already active constraints. - * The variables in a block are spanned by a tree of active constraints. - * +/* * Authors: * Tim Dwyer * @@ -95,13 +91,7 @@ void Block::merge(Block* b, Constraint* c) { f<<" merged block="<<(b->deleted?*this:*b)<front(),NULL); @@ -363,12 +350,7 @@ bool Block::isActiveDirectedPathBetween(Variable* u, Variable *v) { } return false; } -/** - * 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 - */ + Constraint* Block::splitBetween(Variable* const vl, Variable* const vr, Block* &lb, Block* &rb) { #ifdef RECTANGLE_OVERLAP_LOGGING @@ -383,11 +365,7 @@ Constraint* Block::splitBetween(Variable* const vl, Variable* const vr, deleted = true; return 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. - */ + void Block::split(Block* &l, Block* &r, Constraint* c) { c->active=false; l=new Block(); @@ -396,10 +374,6 @@ void Block::split(Block* &l, Block* &r, Constraint* c) { populateSplitBlock(r,c->right,c->left); } -/** - * Computes the cost (squared euclidean distance from desired positions) of the - * current positions for variables in this block - */ double Block::cost() { double c = 0; for (Vit v=vars->begin();v!=vars->end();++v) { -- cgit v1.2.3