Your skill will accomplishwhat the force of many cannot PerlMonks

### Strassen's Algorithm for Matrix Multiplication

by cormanaz (Chaplain)
 on Apr 13, 2013 at 15:01 UTC 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

Replies are listed 'Best First'.
Re: Strassen's Algorithm for Matrix Multiplication
by LanX (Chancellor) 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)

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.

Create A New User
Node Status?
node history
Node Type: perlquestion [id://1028525]
Approved by Old_Gray_Bear
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-08-22 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Who is your favorite scientist and why?

Results (329 votes). Check out past polls.

Notices?