help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [Fwd: Suppressing output]


From: Nigel Galloway
Subject: Re: [Help-glpk] [Fwd: Suppressing output]
Date: Sat, 14 May 2011 01:50:29 -0700

Páidí,

An oportunity to be rid of these hidden inequality monsters.

The following python code, placed in a file called ng.py:

import subprocess
x =
subprocess.check_output(["glpsol","--math","H20110427.mathprog","-o","out.sol"])
print ("Nigel, your every command is obeyed")


when executed produces:
  
C:\Users\Nigel\KuKu3\0bin>python ng.py
Nigel, your every command is obeyed

glpsol's console output is in x if you want it. The model's solution is
in out.sol, if your interested. The only result I want to see is output
to the console.

Let x and the bit-bucket have the sleepless nights worrying about
inequality monsters hiding under the bed.
-- 
  Nigel Galloway
  address@hidden


On Thu, 12 May 2011 17:04 +0400, "Andrew Makhorin" <address@hidden> wrote:
> -------- Forwarded Message --------
> From: Páidí Creed <address@hidden>
> To: address@hidden
> Subject: Suppressing output
> Date: Thu, 12 May 2011 13:44:38 +0100
> 
> Hi,
> 
> 
> Is there any option to suppress output when using GLPK? I have a python
> program that is using GLPK to solve a sequence of LPs, which causes
> something like the following to be printed to my output. 
> 
> 
> GLPSOL: GLPK LP/MIP Solver, v4.43
> Parameter(s) specified in the command line:
>  --cpxlp /tmp/3702-pulp.lp -o /tmp/3702-pulp.sol
> Reading problem data from `/tmp/3702-pulp.lp'...
> 54 rows, 19 columns, 274 non-zeros
> 87 lines were read
> GLPK Simplex Optimizer, v4.43
> 54 rows, 19 columns, 274 non-zeros
> Preprocessing...
> PROBLEM HAS NO PRIMAL FEASIBLE SOLUTION
> If you need actual output for non-optimal solution, use --nopresol
> Time used:   0.0 secs
> Memory used: 0.1 Mb (68980 bytes)
> Writing basic solution to `/tmp/3702-pulp.sol'...
> GLPSOL: GLPK LP/MIP Solver, v4.43
> Parameter(s) specified in the command line:
>  --cpxlp /tmp/3702-pulp.lp -o /tmp/3702-pulp.sol
> Reading problem data from `/tmp/3702-pulp.lp'...
> 54 rows, 19 columns, 274 non-zeros
> 87 lines were read
> GLPK Simplex Optimizer, v4.43
> 54 rows, 19 columns, 274 non-zeros
> Preprocessing...
> PROBLEM HAS NO PRIMAL FEASIBLE SOLUTION
> If you need actual output for non-optimal solution, use --nopresol
> Time used:   0.0 secs
> Memory used: 0.1 Mb (68980 bytes)
> Writing basic solution to `/tmp/3702-pulp.sol'...
> GLPSOL: GLPK LP/MIP Solver, v4.43
> Parameter(s) specified in the command line:
>  --cpxlp /tmp/3702-pulp.lp -o /tmp/3702-pulp.sol
> Reading problem data from `/tmp/3702-pulp.lp'...
> 54 rows, 19 columns, 291 non-zeros
> 88 lines were read
> GLPK Simplex Optimizer, v4.43
> 54 rows, 19 columns, 291 non-zeros
> Preprocessing...
> 36 rows, 18 columns, 273 non-zeros
> Scaling...
>  A: min|aij| =  1.000e+00  max|aij| =  1.000e+00  ratio =  1.000e+00
> Problem data seem to be well scaled
> Constructing initial basis...
> Size of triangular part = 36
>       0: obj =   0.000000000e+00  infeas =  1.000e+00 (0)
>      12: obj =   0.000000000e+00  infeas =  1.000e+00 (0)
> PROBLEM HAS NO FEASIBLE SOLUTION
> glp_simplex: unable to recover undefined or non-optimal solution
> If you need actual output for non-optimal solution, use --nopresol
> Time used:   0.0 secs
> Memory used: 0.1 Mb (122109 bytes)
> Writing basic solution to `/tmp/3702-pulp.sol'...
> GLPSOL: GLPK LP/MIP Solver, v4.43
> Parameter(s) specified in the command line:
>  --cpxlp /tmp/3702-pulp.lp -o /tmp/3702-pulp.sol
> Reading problem data from `/tmp/3702-pulp.lp'...
> 54 rows, 19 columns, 291 non-zeros
> 88 lines were read
> GLPK Simplex Optimizer, v4.43
> 54 rows, 19 columns, 291 non-zeros
> Preprocessing...
> 36 rows, 18 columns, 273 non-zeros
> Scaling...
>  A: min|aij| =  1.000e+00  max|aij| =  1.000e+00  ratio =  1.000e+00
> Problem data seem to be well scaled
> Constructing initial basis...
> Size of triangular part = 36
>       0: obj =   0.000000000e+00  infeas =  1.000e+00 (0)
>       1: obj =   0.000000000e+00  infeas =  1.000e+00 (0)
> PROBLEM HAS NO FEASIBLE SOLUTION
> glp_simplex: unable to recover undefined or non-optimal solution
> If you need actual output for non-optimal solution, use --nopresol
> Time used:   0.0 secs
> Memory used: 0.1 Mb (119349 bytes)
> Writing basic solution to `/tmp/3702-pulp.sol'...
> No separator of arity 3
> 
> 
> However, I would rather only see the final line of output (which does
> not come from GLPK): 
> 
> 
> No separator of arity 3
> 
> 
> Any help appreciated.
> 
> 
> Regards,
> Páidí 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
> 

-- 
http://www.fastmail.fm - Same, same, but different...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]