Kurt Starsinic on Tue, 4 Feb 2003 22:08:18 -0500


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

Re: matrices


On Feb 04, Jeff Abrahamson wrote:
> I've been looking at matrix packages. Looks like Math::Matrix is the
> one to use, but it's not very mature. Worse, performance is
> aweful.
> 
> I tried the following comparison with newmat (a C++ library) compiled
> without optimization. I loaded a 500 x 500 matrix with random values
> and then computed the first eleven powers (a^2, a^3, ..., a^11). The
> profile of the two is
> 
>     C++:  0 seconds to load, 15 seconds to multiply
>     perl: 1 second to load, ---
> 
> (600 seconds later, the perl version still hadn't finished, so I tried
> just a single multiplication: 161 seconds)
> 
> 
> Has anyone here tried doing anything with matrix multiplication in
> perl? Based on the above, it doesn't seem like a reasonable thing to
> do. I was ready for a factor of two speed hit, but not two orders of
> magnitude.

    Both PDL and Math::Pari do an excellent job.  I find that Math::Pari
beats out PDL on raw matrix performance most of the time, but it's not
as easy to build and install.  If you already know Octave (www.octave.org),
Inline::Octave does a good job, but the Perl interface is inelegant.

    - Kurt

-
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**


  • References:
    • matrices
      • From: Jeff Abrahamson <jeff@purple.com>