diff -r -C 2 lrslib-041/lrsgmp.c lrslib-041.patched/lrsgmp.c
*** lrslib-041/lrsgmp.c	Tue Apr  3 23:51:15 2001
--- lrslib-041.patched/lrsgmp.c	Wed Sep 25 15:27:52 2002
***************
*** 293,299 ****
  {
    long i,j;
!   for (i = 0; i < m + 1; i++)
      {
!       for (j = 0; j < n + 1; j++)
          lrs_clear_mp (p[i][j]);
  
--- 293,299 ----
  {
    long i,j;
!   for (i = 0; i <= m; i++)
      {
!       for (j = 0; j <= n; j++)
          lrs_clear_mp (p[i][j]);
  
***************
*** 342,351 ****
  
    lrs_alloc_mp(temp1); lrs_alloc_mp(temp2); lrs_alloc_mp(temp3);
! 
    printf(" gmp v.%d.%d",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
! 
    return TRUE;
  }
  
  void 
  notimpl (char s[])
--- 342,356 ----
  
    lrs_alloc_mp(temp1); lrs_alloc_mp(temp2); lrs_alloc_mp(temp3);
! #ifndef LRS_QUIET
    printf(" gmp v.%d.%d",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
! #endif
    return TRUE;
  }
  
+ void lrs_mp_close()
+ {
+    lrs_clear_mp(temp1); lrs_clear_mp(temp2); lrs_clear_mp(temp3);
+ }
+ 
  void 
  notimpl (char s[])
diff -r -C 2 lrslib-041/lrsgmp.h lrslib-041.patched/lrsgmp.h
*** lrslib-041/lrsgmp.h	Tue Apr  3 23:50:32 2001
--- lrslib-041.patched/lrsgmp.h	Fri Dec 14 14:38:22 2001
***************
*** 152,155 ****
--- 152,156 ----
  
  long lrs_mp_init (long dec_digits, FILE * lrs_ifp, FILE * lrs_ofp);	/* max number of decimal digits, fps   */
+ void lrs_mp_close ();
  
  #define lrs_alloc_mp(a)		(mpz_init (a) )
***************
*** 201,206 ****
--- 202,210 ----
  void stringcpy (char *s, char *t);	/* copy t to s pointer version                            */
  
+ #ifndef __STDC__
  void *calloc ();
  void *malloc ();
+ #endif
+ 
  void *xcalloc (long n, long s, long l, char *f);
  
diff -r -C 2 lrslib-041/lrslib.c lrslib-041.patched/lrslib.c
*** lrslib-041/lrslib.c	Tue Jun 26 22:38:42 2001
--- lrslib-041.patched/lrslib.c	Wed Sep 25 15:25:02 2002
***************
*** 1255,1259 ****
--- 1255,1261 ----
    if (!primalfeasible (D, Q))
      {
+ #ifndef LRS_QUIET
        fprintf (lrs_ofp, "\nNo feasible solution");
+ #endif
        return FALSE;
      }
***************
*** 1270,1279 ****
    if (Q->maximize || Q->minimize)
      {
!       lrs_solvelp (D, Q, Q->maximize);
        if (Q->lponly)		
          {
-          fprintf (lrs_ofp, "\nNumber of pivots for optimum solution: %ld",Q->count[3]);
           if (Q->verbose)
           {
             printA (D, Q);
            }
--- 1272,1281 ----
    if (Q->maximize || Q->minimize)
      {
!       Q->unbounded = !lrs_solvelp (D, Q, Q->maximize);
        if (Q->lponly)		
          {
           if (Q->verbose)
           {
+            fprintf (lrs_ofp, "\nNumber of pivots for optimum solution: %ld",Q->count[3]);
             printA (D, Q);
            }
***************
*** 2164,2169 ****
    if (zero (Q->objnum))
          storesign (Q->objnum, POS);
! 
!    reduce (Q->objnum,Q->objden);
  
  
--- 2166,2171 ----
    if (zero (Q->objnum))
          storesign (Q->objnum, POS);
!   else
! 	reduce (Q->objnum,Q->objden);
  
  
***************
*** 2231,2236 ****
--- 2233,2240 ----
    if (j < d && i == 0)		/* selectpivot gives information on unbounded solution */
      {
+ #ifndef LRS_QUIET
        if (Q->lponly)
  	fprintf (lrs_ofp, "\n*Unbounded solution");
+ #endif
        return FALSE;
      }
***************
*** 2284,2288 ****
--- 2288,2294 ----
  	  if (Q->debug)
  	    printA (P, Q);
+ #ifndef LRS_QUIET
  	  fprintf (lrs_ofp, "\nCannot find linearity in the basis");
+ #endif
  	  return FALSE;
  	}
***************
*** 2302,2306 ****
--- 2308,2314 ----
  	      if (zero (A[Row[i]][0]))
  		{
+ #ifndef LRS_QUIET
  		  fprintf (lrs_ofp, "\n*Input linearity in row %ld is redundant--skipped", order[j]);
+ #endif
  		  linearity[j] = 0;
  		}
***************
*** 2309,2313 ****
--- 2317,2323 ----
  		  if (Q->debug)
  		    printA (P, Q);
+ #ifndef LRS_QUIET
  		  fprintf (lrs_ofp, "\nInconsistent linearities");
+ #endif
  		  return FALSE;
  		}
***************
*** 2458,2462 ****
    P1->depth = P->depth;
    P1->m = P->m;
!   P1->d = P->d;
    P1->lexflag = P->lexflag;
    P1->m_A = P->m_A;
--- 2468,2472 ----
    P1->depth = P->depth;
    P1->m = P->m;
!   P1->d = P1->d_orig = d;
    P1->lexflag = P->lexflag;
    P1->m_A = P->m_A;
***************
*** 3360,3364 ****
    dest->j = src->j;
    dest->m = m;
!   dest->d = d;
    dest->m_A  = src->m_A;
  
--- 3370,3374 ----
    dest->j = src->j;
    dest->m = m;
!   dest->d = dest->d_orig = d;
    dest->m_A  = src->m_A;
  
***************
*** 3481,3485 ****
  /* gmp variables cannot be cleared using free: use lrs_clear_mp* */
    lrs_dic *P1;
!   long d = P->d;
    long m_A = P->m_A;
  
--- 3491,3495 ----
  /* gmp variables cannot be cleared using free: use lrs_clear_mp* */
    lrs_dic *P1;
!   long d = P->d_orig;
    long m_A = P->m_A;
  
***************
*** 3616,3620 ****
  /* Initializations */
  
!   p->d = d;
    p->m = m;
    p->m_A  = m_A;
--- 3626,3630 ----
  /* Initializations */
  
!   p->d = p->d_orig = d;
    p->m = m;
    p->m_A  = m_A;
diff -r -C 2 lrslib-041/lrslib.h lrslib-041.patched/lrslib.h
*** lrslib-041/lrslib.h	Tue Jun 26 22:39:05 2001
--- lrslib-041.patched/lrslib.h	Thu May  2 18:31:01 2002
***************
*** 90,93 ****
--- 90,94 ----
      long m_A;           	/* =m or m-d if nonnegative flag set            */
      long d;			/* A has d+1 columns, col 0 is b-vector         */
+     long d_orig;		/* value of d as A was allocated  (E.G.)        */
      long lexflag;		/* true if lexmin basis for this vertex         */
      long depth;			/* depth of basis/vertex in reverse search tree */
***************
*** 110,114 ****
      lrs_mp objnum;		/* objective numerator value                    */
      lrs_mp objden;		/* objective denominator value                  */
! 
      char fname[100];		/* input file name from line 1 of input         */
  
--- 111,115 ----
      lrs_mp objnum;		/* objective numerator value                    */
      lrs_mp objden;		/* objective denominator value                  */
!     long unbounded;		/* lp unbounded */
      char fname[100];		/* input file name from line 1 of input         */
  
