in reply to Re^8: OT: Finding Factor Closest To Square Root
in thread OT: Finding Factor Closest To Square Root

That second arrayref would be a perfect list of counts to be handing to Algorithm::Loops::NestedLoops though. :)

Yeah. One day soon the penny will drop for me regarding NestedLoops(). :(

but in general I've found the two forms equally easy to work with for most things.

Manipulating an array of pairs is easy using for, map etc. Manipulating pairs of parallel arrays is much fussier. I ended up writing a little sub to transpose them. There is probably a way using the built in matrix manipulations to do that if I could find it. Also, if I understood how to use the Pari looping constructs, there may be no need, and a performance advantage, to *not* manipulating the vectors manually in the Perl code--but that a ways up the learning curve right now.

I'm blown away by the performance of Math::Pari. Not just the C -v- Perl thing, but it's collation of so much research into a single package. Of course, much of it is way over my head, and it is quite complex to use, especially if your trying to get the best from it.

The documentation could do with a few clarifications. Even if simple things like the explanation of

Note that a and b must be in R.

where there is no 'R' mentioned anywhere else in the parameters. I assume they mean a "Real numbers" (or "drawn from the set of real numbers"), and maybe that's obvious for those who's formal math is more recent than mine--but it threw me through a loop when I first read it.

A few working examples of using stuff like the fordiv from Perl would help. They show an example of using it in conjunction with some kind of interpreter (GP?), but as it is mentioned in the POD, I assume they be used from within Perl?

I guess I need to seek out some non-trivial example Perl code that uses the more esoteric features.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.