[Top][All Lists]

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

[Help-glpk] Printing only non-zero output

From: BruceM
Subject: [Help-glpk] Printing only non-zero output
Date: Mon, 3 Nov 2008 02:01:12 +0300

I'm a complete newbie to GLPK, but have battled through much of the early
learning over the past week.
I'm now trying to print my output in a sensible way - specifically, in the
code below I want to print only days where I have bought something.
As it is, I have commented out the bit where I tried to make it only print
days where I buy something, so the model works, but it doesn't do what I
If I un-comment out that line, it says "invalid use of reserved keyword if"

Can someone please tell me how I should make GLPK do what I want it to do.

Many thanks,

printf "\nday\tadult\tchild\tsenior\n";
for {d in day}:
      #if sum{t in ticket}buy[d,t] then
        {printf "%d\t%4.2f\t%4.2f\t%4.2f\n",d, 
         buy[d,'adult'], buy[d,'child'], buy[d,'senior'];
View this message in context:
Sent from the Gnu - GLPK - Help mailing list archive at

reply via email to

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