summaryrefslogtreecommitdiffstats
path: root/src/removeoverlap/blocks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/removeoverlap/blocks.cpp')
-rw-r--r--src/removeoverlap/blocks.cpp15
1 files changed, 7 insertions, 8 deletions
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<nvs;i++) {
insert(new Block(vs[i]));
@@ -39,7 +39,7 @@ Blocks::Blocks(Variable *vs[], const int n) : vs(vs),nvs(n) {
Blocks::~Blocks(void)
{
blockTimeCtr=0;
- for(set<Block*>::iterator i=begin();i!=end();i++) {
+ for(set<Block*>::iterator i=begin();i!=end();++i) {
delete *i;
}
clear();
@@ -66,7 +66,7 @@ list<Variable*> *Blocks::totalOrder() {
void Blocks::dfsVisit(Variable *v, list<Variable*> *order) {
v->visited=true;
vector<Constraint*>::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<Block*> bcopy(size());
- copy(begin(),end(),bcopy.begin());
- for(vector<Block*>::iterator i=bcopy.begin();i!=bcopy.end();i++) {
+ vector<Block*> bcopy(begin(),end());
+ for(vector<Block*>::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<Block*>::iterator i=begin();i!=end();i++) {
+ for(set<Block*>::iterator i=begin();i!=end();++i) {
c += (*i)->cost();
}
return c;