- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to multiply two large non-square matrices that will not fit in memory. The result is a square matrix that will fit in memory. I am looking for sample code that shows how to do a blocked matrix multiply. I note this from Wikipedia.
"By decomposing one or both of the input matrices into block matrices, GEMM can be used repeatedly on the smaller blocks to build up a result for the full matrix. This is one of the motivations for including the parameter, so the results of previous blocks can be accumulated"
Googling has not turned up anything so far....
"By decomposing one or both of the input matrices into block matrices, GEMM can be used repeatedly on the smaller blocks to build up a result for the full matrix. This is one of the motivations for including the parameter, so the results of previous blocks can be accumulated"
Googling has not turned up anything so far....
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is an example in Numerical recipes which does this - the computational load is better too - N^2.7 rather than N^3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That would be the third edition , I assume, as I see no reference to blocked matrix multiply in the earlier editions. Do you know if the blocked multiply they implement can handle non-square blocks in the source matrices?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately that NR section was not useful at all as they are only talking in the most general terms and do not provide a concrete example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found what I needed. Google search for "The Science of Programming Matrix Computations"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just incase it helps anyone... Numerical recipes in C second edition, page 102, section heading is "is matrix inversion an N^3 process", and in this section it gives Strassen formula for matrix multiply which is blocked, and also slightly faster than the normal approach.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page