Hello Umair, in GNU Octave you have to set
param.msglev = 2 or param.msglev = 3 to see the iteration count. See https://www.gnu.org/software/octave/doc/v4.0.0/Linear-Programming.html The different constants of the GLPK library like GLP_MSG_ON mentioned in the Octave online help are documented in doc/glpk.pdf of the GLPK source. Here is an example: # provide normal GLPK ouput param.msglev = 2; # set up the problem c = [1; -2; -3; -1]; a = [1, -1, -2, -1; 2, 0, 1, -4; -2, 1, 0, 1]; b = [4; 2; 1]; lb = []; ub = []; vartype = "CCCC"; ctype = "UUU"; s = -1; # solve the problem [xopt, fopt, status] = ... glpk (c, a, b, lb, ub, ctype, vartype, s, param) The output for the example looks like this: * 0: obj = 0.000000000e+00 infeas = 0.000e+00 (0) * 2: obj = 4.000000000e+00 infeas = 0.000e+00 (0) 2 is the number of iterations. Best regards Heinrich Schuchardt On 11/15/2016 06:48 AM, Muhammad Arif, Umair wrote: > Hi Heinrich > > Thanks for getting back to me. I am using the glpk library in octave. It > has a glpk() function with some input parameters as mentioned in the > below link: > > https://www.gnu.org/software/octave/doc/v4.0.0/Linear-Programming.html > > So my question was in this context. Can you help? > > Thanks > > > On Nov 10, 2016 11:49 PM, "Heinrich Schuchardt" <[email protected] > <mailto:[email protected]>> wrote: > > Hello Umair, > > the GLPK library sends the number of iterations to the terminal output. > > The simplex method output syntax is fully explained in the "Terminal > output" subsection of the glp_simplex call documentation in doc/glpk.pdf > (for GLPK 4.60 this is section 2.8.1) of the source distribution > available at > http://ftp.gnu.org/gnu/glpk/glpk-4.60.tar.gz > <http://ftp.gnu.org/gnu/glpk/glpk-4.60.tar.gz> > > There is no glpk() function in the GLPK library. If you are using a > wrapper to the GLPK library, see the documention there to find out how > to enable terminal output. > > Best regards > > Heinrich Schuchardt > > On 11/10/2016 08:49 PM, Muhammad Arif, Umair wrote: > > Hi there, > > > > Hope you are doing fine. I am using GLPK for solving the LP of my > > research problem. I have to compare the number of iterations of > simplex > > method with the algorithm that I developed. So, is it possible to get > > the number of simplex iterations performed when we call glpk() > function > > once. > > > > I know there is a parameter where we can set the maximum limit of > > iterations but it does not specify how many iterations are > performed in > > a single glpk() call. > > > > Hope to receive a prompt response. Thanks > > > > Best Regards, > > > > *Umair M. Arif* > _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
