Ticket #2204: hnf.patch

File hnf.patch, 0.6 KB (added by mabshoff, 2 years ago)

This patch needs to be applied to the pari.spkg

  • src/basemath/alglin2.c

     
    30823082    for (i=h[j]; i; i--) 
    30833083    { 
    30843084      a = gcoeff(A,i,j); 
    3085       if (!signe(a)) continue; 
    3086  
    30873085      k = c[i]; 
    3088       ZV_elem(a,gcoeff(A,i,k), A,B, j,k); 
    3089       ZM_reduce(A,B, i,k); 
     3086      if (signe(a)) ZV_elem(a,gcoeff(A,i,k), A,B, j,k); 
     3087      ZM_reduce(A,B, i,k); /* ensure non-negative entries, even if a = 0 */ 
    30903088      if (low_stack(lim, stack_lim(av1,1))) 
    30913089      { 
    30923090        if (DEBUGMEM>1) pari_warn(warnmem,"hnfall[3], j = %ld", j);