help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] The use of printf.


From: Andrew Makhorin
Subject: Re: [Help-glpk] The use of printf.
Date: Fri, 22 Aug 2008 18:39:42 +0400

> I've got stuck
> figuring out how to get printf work with my results.
> When I use printf I get 
> the following error:

> Reading model 
> section from city2.mod...
> city2.mod:77: only numeric, symbolic, or logical 
> expression allowed
> Context: ...ansfer , <= 20 ; printf { i in PLANTSC } 
> '...' , p_c [ i ] ;
> Model processing error

Variables cannot be printed *before* the solve statement (if there
is no solve statement in your model, one is assumed at the end of the
model section). More precisely, you are attempting to print a linear
form, whose value is unknown yet.

Try writing something like this:

. . .
solve;
printf{i in PLANTSC} "res= %f", p_c[i];
. . .

For more details please see the language reference.





reply via email to

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