Different stuff

October 22, 2007

PARI-Python intnum

Filed under: Uncategorized — Anton @ 10:26 am

This is how intnum works with my module:

>>> import pari
>>> def f(x):
...     return x^2
...
>>> pari.intnum(0,1,f)
0.3333333333333333333333333333

Actually it works faster than in the standard PARI shell. The reason, I think, is that every time PARI wants to compute the value of the function we integrate it parses the string defining the function. In my case I simply do a function call which is faster.

About these ads

1 Comment »

  1. Hi Anton,

    I just stumbled on your blog through an unrelated Google search. The reason
    you give for PARI’s intnum slowness *was* correct. The current ‘testing’
    release, aka ‘development’, aka ‘unstable’, include a standard parser,
    bytecode compiler / evaluator. So I suspect it is no longer the case.

    Nice to see Fermigier’s work being revived in a different guise,
    with different goals and scope than SAGE. I’ll link to it.

    It would be nice if everything “just worked”. Let me know if current
    ‘testing’ releases break something. (They probably do.)

    Cheers.

    Comment by K.B — November 26, 2008 @ 9:35 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: