Bill Allombert on Wed, 18 Jan 2006 18:23:16 +0100


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

Re: Two suggestions:


On Wed, Jan 18, 2006 at 03:36:14PM +0000, Prof. J. E. Cremona wrote:
> (1) As Bill has reported, although ellsearch() allows one to take from
> the database all elliptic curves with a given conductor, it is
> inefficient to do this in a loop, say from N=N1 to N=N2, since each call
> to ellsearch() causes the entire relevant database file to be read in.
> 
> I suggest adding a function of the form
> 
> forell(E,N1,N2, seq ) which would execute seq for all elliptic curves E
> in the database with N1 <= cond(E) <= N2;  which would only read each
> file once.

I will have a look at it.

> That's my first wish-list suggestion (of 2006).
> 
> (2) The elliptic curve databes holds each curve's id as a string, for
> example "20160cy2".  It would be convenient to be able to simply split
> this into 3 components, for example [20160,"cy",2].  With Bill's help I
> have written a gp function to do this:
> 
> {
> code2seq(code)=local(v,N=0,num=0,i=1,i1,class);
> v=Vecsmall(code);
> while(v[i]<58,N=10*N+v[i]-48;i++);
> i1=i;
> while(v[i]>57,i++);
> class=Strchr(vector(i-i1,j,v[i1+j-1]));
> while(i<=length(v),num=10*num+v[i]-48;i++);
> [N,class,num]
> }
> 
> But this direct manipulation of the vector of ASCII codes is rather
> awkward.   Surely there would be other places in which some string
> manipulation would be helpful?  Can we add this to the wish-list please?

Well there are about 3 ways to solve that:

1) change ellsearch (etc.) to return curve names in the form
[N,class,num] instead of "Nclassnum".

2) Add a GP function ellparsename that convert "Nclassnum" to
[N,class,num]

3) Add a more generic string manipulation functions that allow
to do the same as code2seq but much simpler.

It depends on how much usage each formats has.

Cheers,
Bill.