help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] writing status from mod files?


From: glpk xypron
Subject: Re: [Help-glpk] writing status from mod files?
Date: Thu, 07 Oct 2010 23:41:03 +0200

Hello Jeff,

> /* can you write out the optimizer status??? */
Unfortunately currently it is not possible to retrieve the return code of 
glp_intopt(), e.g. GLP_ETMLIM.

To enable this feature would require the following coding changes:
glpios.h: change structure glp_tree to comprise a field for the return code of 
glp_intopt,
glpios3.c: change function ios_driver to save the return state in glp_tree,
glpapi14.c change function glp_mpl_postsolve to write the return state to the 
status of the objective.

Then in GMPL you could write:

minimize obj : ...
solve;
printf "solution status = %i\n", obj.status;

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Thu, 7 Oct 2010 11:27:13 -0700
> Betreff: [Help-glpk] writing status from mod files?

> I've been thinking that my --tmlim settings are too short for a project
> I've been working on, and I can't seem to be able to write the status of the
> solution from within a mod file. 
> 
> For example, I have a mathprog file that writes out the results;
> 
> /* can you write out the optimizer status??? */
> printf "per.return,ann.return,per.variance,ann.stdev\n" >
> "ell-one-a-soln.csv";
> printf: "%f,%f,%f,%f\n", 
>       r_portfolio,  
>       100.0*(((1+r_portfolio)^tdpy)-1.0),     
>       sum {i in S, j in S} w[i]*w[j]*cov[i,j],
>       100.0 *  sqrt( ( sum {i in S, j in S} w[i]*w[j]*cov[i,j]) ) / 
> sqrt(1/tdpy
> ) >> "ell-one-a-soln.csv";
> 
> and I would like to know if the solver obtained the optimal solution (and
> get kkt conditions) or if it hit the time limit. 
> 
> I can't find a keyword that allows me to access elements of the solver
> from within the mod file. 
> 
> I can obtain the solver status if I export the solution file (glpsol
> --write), but I'd like to be able to write out the results from directly 
> within
> the mod file.
> 
> Is that possible in the current version?
> 
> Jeff.
> 
> 
> 
> Jeff Hamann, PhD
> PO Box 1421
> Corvallis, Oregon 97339-1421
> 541-754-2457
> jeff.hamann[at]forestinformatics[dot]com
> jeff.d.hamann[at]gmail[dot]com
> http://www.forestinformatics.com
> 
> 
> 
> 

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail



reply via email to

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