Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Strassen's Algorithm for Matrix Multiplication

by cormanaz (Chaplain)
on Apr 13, 2013 at 15:01 UTC ( #1028525=perlquestion: print w/ replies, xml ) Need Help??
cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

Good day bros. Does anyone know where I can find example code in PERL for Strassen's matrix multiplication algorithm? I found something in MCE samples but that seems to be for fixed size, static matrices to test timing. I'm looking for something that will multiply any-sized (conformable, of course) matrices with actual data.

Comment on Strassen's Algorithm for Matrix Multiplication
Re: Strassen's Algorithm for Matrix Multiplication
by LanX (Canon) on Apr 13, 2013 at 15:11 UTC
    Porting the C-code in WP:Strassen_algorithm#Source_code seems straightforward!

    Don't you think you should at least provide some links in the OP?

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      My bad re missing link.

      That seems to be what they've done in the MCE code example. What I don't get is this argument $tam (used both in perl and C). It says in the C code this has something to do with the "length of the matrix" but a matrix has two dimensions, so I'm not sure what they mean by "length." This is what made me think they were setting up some kind of fixed size test data.

        Strassen's algorithm only works for square matrices of a dimenstion that is a power of two I believe. At least a superficial scan of the Wikipedia article seems to confirm that. It also mentions padding non-square matrices.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1028525]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2014-08-27 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (243 votes), past polls