From: Mikko Rasa Date: Tue, 27 Nov 2012 11:04:39 +0000 (+0200) Subject: Report non-basic variables in Layout::LinearProgram as having zero value X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=26364157167e38a93d93c7912769d4362c52d387;p=libs%2Fgltk.git Report non-basic variables in Layout::LinearProgram as having zero value --- diff --git a/source/layout.cpp b/source/layout.cpp index 74b33f0..2972ec8 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -365,8 +365,10 @@ float Layout::LinearProgram::get_variable(unsigned i) if(i+1>=n_columns) throw out_of_range("LinearProgram::get_variable"); - unsigned r = columns[i].basic; - return columns.back().values[r]; + if(unsigned r = columns[i].basic) + return columns.back().values[r]; + else + return 0; } bool Layout::LinearProgram::solve()