Bill Allombert on Tue, 24 Feb 2004 20:47:45 +0100

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

Re: Pattern Match within PARI/GP

On Tue, Feb 24, 2004 at 10:55:29AM -0800, Paulo Ney de Souza wrote:
> There is a subtle difference between the two problems, you see the 
> Human Genome data is static, generated by some sequencing machines,
> it stays put, and written to a disk after it is found. You can then
> go there with any tools and try to find patterns, etc ... Our example
> problem here is "dynamic" in the sense that I want to generate the 
> first 1 million digits and depending on the sequences found, go look
> a bit further in the "second" million digit set, etc ...

Well, computing 1 million digits of Pi with PARI is likely to take
several minutes on a fast box.

> That going in between PARI and Perl and then back to PARI is exactly
> what is breaking my neck in terms of speed... and my reason to try
> to do this inside PARI.

Then you should probably try Math::PARI which is a PARI interface for perl.
This way you can do everything inside of perl.

Another alternative is to write your custom C plug-in to PARI and
install() them under GP, so you can call your new functions inside of GP.
such custom C plug-in could use a regexp library like libpcre to make
the test. It is easy to implement.