Karim BELABAS on Fri, 29 Mar 2002 19:56:37 +0100 (MET)


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

Re: bug in bnfnarrow?


On 28 Mar 2002, John Jones wrote:
> I have tried this in several versions of gp 2 and they all produce the
> same error.
[...]
> ? 1 - 9*x + 14*x^2 + 28*x^3 - 7*x^4 - 12*x^5 + x^6 + x^7
> %1 = x^7 + x^6 - 12*x^5 - 7*x^4 + 28*x^3 + 14*x^2 - 9*x + 1
> ? bnfnarrow(bnfinit(%))
>   ***   non invertible matrix in gauss

An embarassing typo. It's fixed in all CVS branches now. Here's a minimal
patch (should apply to all 2.2 and 2.1 versions, I think). The right fix
is to dump the current bnfnarrow and have it call bnrinit. Unfortunately the
latter is currently much slower (for a number of bad reasons). I shall add
this explicitly to the TODO list.

RCS file: /home/megrez/cvsroot/pari/src/basemath/buch3.c,v
diff -c -r1.15.2.2 -r1.15.2.3
*** src/basemath/buch3.c        2001/11/20 14:05:47     1.15.2.2
--- src/basemath/buch3.c        2002/03/29 18:51:10     1.15.2.3
***************
*** 54,60 ****
        for (i=1; i<=rankmax; i++)
        vecsign[i] = (gsigne(gsubst(alpha,va,(GEN)rac[i])) > 0)? (long)_0
                                                                 : (long)_1;
!       v1 = concatsp(v, vecsign);
        if (rank(v1) == rankinit) avma=av1;
        else
        {
--- 54,60 ----
        for (i=1; i<=rankmax; i++)
        vecsign[i] = (gsigne(gsubst(alpha,va,(GEN)rac[i])) > 0)? (long)_0
                                                                 : (long)_1;
!       v1 = concat(v, vecsign);
        if (rank(v1) == rankinit) avma=av1;
        else
        {

    Karim.
-- 
Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathematiques, Bat. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas
--
PARI/GP Home Page: http://www.parigp-home.de/