필터 지우기
필터 지우기

How large can a sparse matrix be?

조회 수: 11 (최근 30일)
Patrick Mboma
Patrick Mboma 2015년 7월 22일
댓글: Patrick Mboma 2015년 7월 23일
Hi,
I thought I could exploit the fact that a matrix is sparse to build a big matrix. I would like to build a sparse matrix of size 46 times 8153726976. The matrix itself is very big but only has approximately 60,000 non-zero entries. I have not succeeded even in creating a completely sparse matrix of the same size. Is there any solution to this problem?
Thanks,

채택된 답변

Steven Lord
Steven Lord 2015년 7월 22일
The larger the number of columns in a sparse matrix, the more memory it consumes. Try creating a tall but thin sparse matrix instead of a short and wide matrix.
S = spalloc(8153726976, 46, 60000);
  댓글 수: 7
Titus Edelhofer
Titus Edelhofer 2015년 7월 23일
Hi Patrick,
then the result C should be relatively small. Did you try the obvious, namely
C = A' * B;
I'm not sure, but it guess that MATLAB identifies the pattern and computes the multiplication without "computing" the transpose before ...
Titus
Patrick Mboma
Patrick Mboma 2015년 7월 23일
Titus, I have checked that what you suggested works. Matlab somehow avoids transposing the matrix before doing the multiplication. Wahoo! Now the only thing I have to make sure of is that matrix B is not too wide.
To all, Thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by