# HG changeset patch # User marci # Date 1133370017 0 # Node ID 173b53b28d7c410600d068aa45e26020dc563b6d # Parent b2dfd32b4895359b4d18f6569ecbf13f227f64f6 max flow with lp column generation diff -r b2dfd32b4895 -r 173b53b28d7c lemon/lp_base.h --- a/lemon/lp_base.h Wed Nov 30 13:24:37 2005 +0000 +++ b/lemon/lp_base.h Wed Nov 30 17:00:17 2005 +0000 @@ -595,6 +595,7 @@ virtual Value _getPrimal(int i) = 0; virtual Value _getDual(int i) = 0; virtual Value _getPrimalValue() = 0; + virtual bool _isBasicCol(int i) = 0; virtual SolutionStatus _getPrimalStatus() = 0; virtual SolutionStatus _getDualStatus() = 0; ///\todo This could be implemented here, too, using _getPrimalStatus() and @@ -1000,6 +1001,9 @@ Value dual(Row r) { return _getDual(rows.floatingId(r.id)); } ///\e + bool isBasicCol(Col c) { return _isBasicCol(cols.floatingId(c.id)); } + + ///\e ///\return ///- \ref INF or -\ref INF means either infeasibility or unboundedness diff -r b2dfd32b4895 -r 173b53b28d7c lemon/lp_cplex.cc --- a/lemon/lp_cplex.cc Wed Nov 30 13:24:37 2005 +0000 +++ b/lemon/lp_cplex.cc Wed Nov 30 17:00:17 2005 +0000 @@ -284,7 +284,13 @@ //printf("Objective value: %g \n",objval); return objval; } - + bool LpCplex::_isBasicCol(int i) { + int* cstat=new int[CPXgetnumcols(env, lp)]; + return CPXgetbase(env, lp, cstat, NULL); + bool result=(cstat[i]==CPX_BASIC); + delete[] cstat; + return result; + } //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!) // This table lists the statuses, returned by the CPXgetstat() routine, for solutions to LP problems or mixed integer problems. If no solution exists, the return value is zero. diff -r b2dfd32b4895 -r 173b53b28d7c lemon/lp_cplex.h --- a/lemon/lp_cplex.h Wed Nov 30 13:24:37 2005 +0000 +++ b/lemon/lp_cplex.h Wed Nov 30 17:00:17 2005 +0000 @@ -76,11 +76,10 @@ ///\e virtual SolveExitStatus _solve(); - virtual Value _getPrimal(int i); virtual Value _getDual(int i); - virtual Value _getPrimalValue(); + virtual bool _isBasicCol(int i); virtual SolutionStatus _getPrimalStatus(); virtual SolutionStatus _getDualStatus(); diff -r b2dfd32b4895 -r 173b53b28d7c lemon/lp_glpk.cc --- a/lemon/lp_glpk.cc Wed Nov 30 13:24:37 2005 +0000 +++ b/lemon/lp_glpk.cc Wed Nov 30 17:00:17 2005 +0000 @@ -419,6 +419,9 @@ { return lpx_get_obj_val(lp); } + bool LpGlpk::_isBasicCol(int i) { + return (lpx_get_col_stat(lp, i)==LPX_BS); + } LpGlpk::SolutionStatus LpGlpk::_getPrimalStatus() diff -r b2dfd32b4895 -r 173b53b28d7c lemon/lp_glpk.h --- a/lemon/lp_glpk.h Wed Nov 30 13:24:37 2005 +0000 +++ b/lemon/lp_glpk.h Wed Nov 30 17:00:17 2005 +0000 @@ -81,6 +81,7 @@ virtual Value _getPrimal(int i); virtual Value _getDual(int i); virtual Value _getPrimalValue(); + virtual bool _isBasicCol(int i); ///\e ///\todo It should be clarified