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: Marcos Roberto Silva
Subject: Re: [Help-glpk] New statements (solve; printf, if, for, etc.)
Date: Thu, 05 Aug 2004 12:27:20 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.6) Gecko/20040413 Debian/1.6-5

Dear Richard,
I tried the expression:

printf{i in I, j in J, k in K}: "%d to %d via %d \n", if x[i,j,k] then i,j,k;

and the output was the same. I can to filter the results to print only when x[i,j,k] = 1 (x binary), but doesn't work.

Anyway, thanks for your help.

Marcos Roberto Silva


Richard Prescott wrote:


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]