From 0623102c16ecbf5ade1a7ef195659826a6f92548 Mon Sep 17 00:00:00 2001 From: Tim Dwyer Date: Wed, 10 May 2006 07:13:45 +0000 Subject: Apparently a problem was reported with one of the test cases. I can't reproduce the problem, however solve_VPSC code in inkscape was getting quite out of date with that in www.sf.net/projects/adaptagrams. I've updated the code, which may fix the problem, or at least if it's reported again then I'll know it's still an issue. (bzr r803) --- src/removeoverlap/blocks.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/removeoverlap/blocks.cpp') diff --git a/src/removeoverlap/blocks.cpp b/src/removeoverlap/blocks.cpp index 13da8e15e..62b7e99f5 100644 --- a/src/removeoverlap/blocks.cpp +++ b/src/removeoverlap/blocks.cpp @@ -10,7 +10,7 @@ * * Copyright (C) 2005 Authors * - * Released under GNU GPL. Read the file 'COPYING' for more information. + * Released under GNU LGPL. Read the file 'COPYING' for more information. */ #include "blocks.h" @@ -30,7 +30,7 @@ using std::copy; long blockTimeCtr; -Blocks::Blocks(Variable *vs[], const int n) : vs(vs),nvs(n) { +Blocks::Blocks(const int n, Variable *vs[]) : vs(vs),nvs(n) { blockTimeCtr=0; for(int i=0;i::iterator i=begin();i!=end();i++) { + for(set::iterator i=begin();i!=end();++i) { delete *i; } clear(); @@ -66,7 +66,7 @@ list *Blocks::totalOrder() { void Blocks::dfsVisit(Variable *v, list *order) { v->visited=true; vector::iterator it=v->out.begin(); - for(;it!=v->out.end();it++) { + for(;it!=v->out.end();++it) { Constraint *c=*it; if(!c->right->visited) { dfsVisit(c->right, order); @@ -149,9 +149,8 @@ void Blocks::removeBlock(Block *doomed) { //erase(doomed); } void Blocks::cleanup() { - vector bcopy(size()); - copy(begin(),end(),bcopy.begin()); - for(vector::iterator i=bcopy.begin();i!=bcopy.end();i++) { + vector bcopy(begin(),end()); + for(vector::iterator i=bcopy.begin();i!=bcopy.end();++i) { Block *b=*i; if(b->deleted) { erase(b); @@ -189,7 +188,7 @@ void Blocks::split(Block *b, Block *&l, Block *&r, Constraint *c) { */ double Blocks::cost() { double c = 0; - for(set::iterator i=begin();i!=end();i++) { + for(set::iterator i=begin();i!=end();++i) { c += (*i)->cost(); } return c; -- cgit v1.2.3