[Top][All Lists]

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

[Help-glpk] Re: loading constraint coefficients

From: Andrew Makhorin
Subject: [Help-glpk] Re: loading constraint coefficients
Date: Tue, 16 Sep 2003 08:42:43 +0400

>The problem is that in each row of the matrix, there
>are some coefficients with zero elements, this has
>cause a problem when i use load_mat3 to load these
>May i know how can i load these coefficients without
>modification of the zero elements in the matrix. Thank
>you very much

Before call to lpx_load_mat3 you can eliminate zero coefficients in the
following way:

   {  int k, newnz = 0;
      for (k = 1; k <= nz; k++)
      {  if (a[k] != 0.0)
         {  newnz++;
            rn[newnz] = rn[k];
            cn[newnz] = cn[k];
            a[newnz] = a[k];
      nz = newnz;
   lpx_load_mat3(lp, nz, rn, cn, a);

reply via email to

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