bug-glpk
[Top][All Lists]
Advanced

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

[Bug-glpk] Re: Bug?


From: Andrew Makhorin
Subject: [Bug-glpk] Re: Bug?
Date: Thu, 27 Nov 2003 18:37:25 +0300

I have changed the lp presolver to ignore tiny coefficients in the
original constraint matrix that allows resolving the problem. These
changes will appear in the next release of glpk.

If you wish to patch the code right now, please do the following:

1. Add the line:

#include <math.h>

to the top of the file glplpp1.c.

2. Replace lines 496-501, file glplpp1.c:

      /* copy the original constraint matrix into the workspace */
      for (row = lpp->row_ptr; row != NULL; row = row->next)
      {  len = lpx_get_mat_row(orig, row->i, ndx, val);
         for (t = 1; t <= len; t++)
            lpp_add_aij(lpp, row, map[ndx[t]], val[t]);
      }

by the following ones:

      /* copy the original constraint matrix into the workspace */
      for (row = lpp->row_ptr; row != NULL; row = row->next)
      {  double big, eps;
         len = lpx_get_mat_row(orig, row->i, ndx, val);
         big = 0.0;
         for (t = 1; t <= len; t++)
            if (big < fabs(val[t])) big = fabs(val[t]);
         eps = 1e-10 * big;
         for (t = 1; t <= len; t++)
         {  if (fabs(val[t]) < eps) continue;
            lpp_add_aij(lpp, row, map[ndx[t]], val[t]);
         }
      }

Andrew Makhorin






reply via email to

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