How can I do a memory efficient sparse matrix multiplication?
1 view (last 30 days)
Show older comments
I have a sparse matrix A (dimension 4000000 x 1000000) and I want to calculate the matrix product:
B = A * A'
This results in: "Out of memory. Type HELP MEMORY for your options."
2 Comments
Answers (1)
Matt J
on 5 Nov 2013
Edited: Matt J
on 5 Nov 2013
If you only plan to use A*A' in matrix multiplication, you might be able to use my ProdCascade class
>> A=sprand(4e6, 1e6,1e-5); c=rand(4e6,1);
>> tic; B=A*A'; B*c; toc;
Out of memory. Type HELP MEMORY for your options.
>> tic; B=ProdCascade({A,A.'}); B*c; toc;
Elapsed time is 7.531522 seconds.
8 Comments
See Also
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!