laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I was asking this the other day, here's what I found out. I wanted to know how to use Math::Pari to declare and then use a new function written in GP. After a brief exchange with the author, I discovered that the only problem was that Math::Pari hiccups on braces and spaces - and these are in any case not needed (at least for dealing with numbers), they are pure "syntactic sugar". So I knocked up a local function: .. and was then able to use it to write nice clean GP function declarations:
I don't yet have a good solution for passing arguments in. You can interpolate them: .. but it is distressingly inefficient to convert large numbers to string and back. I've done some experiments with setting up a PARIvar, but haven't worked out yet if it is possible to assign to such a variable from perl space. I'd welcome any other tips and tricks for getting the most out of perl/PARI hybrid code. Hugo In reply to Using GP with Math::Pari by hv
|
|