Bill Allombert on Wed, 03 Jun 2015 17:23:00 +0200


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

Re: Struggling with ellisogeny() and variable priorities


On Wed, Jun 03, 2015 at 05:11:16PM +0200, Jeroen Demeyer wrote:
> OK, thanks.
> 
> I got confused because the variable number no longer indicates the
> priority. May I suggest a patch to help debugging? See attachment.

Note that you can use variable() to see the current priority.

> diff --git a/src/language/es.c b/src/language/es.c
> index 0f9c720..bba4770 100644
> --- a/src/language/es.c
> +++ b/src/language/es.c
> @@ -2068,10 +2068,10 @@ dbg(GEN x, long nb, long bl)
>    if (tx == t_PADIC)
>      pari_printf("(precp=%ld,valp=%ld):", precp(x), valp(x));
>    else if (tx == t_POL)
> -    pari_printf("(%c,varn=%ld):", vsigne(x), varn(x));
> +    pari_printf("(%c,varn=%ld,pri=%ld):", vsigne(x), varn(x), varpriority[varn(x)]);
>    else if (tx == t_SER)
> -    pari_printf("(%c,varn=%ld,prec=%ld,valp=%ld):",
> -               vsigne(x), varn(x), lg(x)-2, valp(x));
> +    pari_printf("(%c,varn=%ld,pri=%ld,prec=%ld,valp=%ld):",
> +               vsigne(x), varn(x), varpriority[varn(x)], lg(x)-2, valp(x));

Alas, this will cause a SEGV if varn(x) is somehow outside varpriority.

Cheers,
Bill