From fea22d7bdfae9e2cb70a6c0c1a3f85da531e2de2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 27 Jun 2013 16:36:09 +0300 Subject: [PATCH] The slack column counter needs to be outside the slot loop --- source/layout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/layout.cpp b/source/layout.cpp index 7902902..5ebb55c 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -340,6 +340,7 @@ void Layout::solve_constraints(int dir, SolveMode mode) remaining three are slack columns; see below for their purposes. */ LinearProgram linprog(n_active_slots*5+n_slack_constraints[dir]+1); float weight = slots.size(); + unsigned k = n_active_slots*5; for(list::iterator i=slots.begin(); i!=slots.end(); ++i) { if((*i)->index<0) @@ -396,7 +397,6 @@ void Layout::solve_constraints(int dir, SolveMode mode) /* Add rows for user-defined constraints. Constraints are always added in pairs, so it's only necessary to create a row for one half. */ - unsigned k = n_active_slots*5; for(list::iterator j=(*i)->constraints.begin(); j!=(*i)->constraints.end(); ++j) if(j->target.index>(*i)->index && (j->type&1)==dir) { -- 2.43.0