help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] New statements (solve; printf, if, for, etc.)


From: Richard Prescott
Subject: Re: [Help-glpk] New statements (solve; printf, if, for, etc.)
Date: Thu, 5 Aug 2004 10:53:38 -0400 (EDT)


I didn't try yet 4.6 but I am pretty sure that

print("...\n");
print{i in I, j in J, k in L: x[i,j,k]} ("%d to %d via %d", i, j, k);

is closer to your wish.


On Thu, 5 Aug 2004, Marcos Roberto Silva wrote:

Hello list,

I am learning and testing the new statements of the 4.6 version, and in my test I was not able to print i , j and k _only_ if x[i,j,k] =1.

The code used was:

printf("\nFlow Assignment: ");
for {i in I}
{
      for {j in J}
      {
for {k in K} printf "\nThe flow from %d to %d is via hub %d.", if x[i,j,k] then i,j,k;
      }
}


With this code, the output print  all the cases.

What's wrong?

Thanks.

Regards,

Marcos Roberto Silva




--------------------------------------------------------------------------
     1024D/BEF5DD36 Richard Prescott <address@hidden>
     Key fingerprint = E11B E939 8A1D 2FA8 A672  555F ABA8 DE5A BEF5 DD36




reply via email to

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