필터 지우기
필터 지우기

Is there an efficient way to create a 3 dimensional sparse matrix?

조회 수: 6 (최근 30일)
Jason
Jason 2016년 10월 28일
댓글: Jason 2016년 11월 7일
Hello, all ! I have some 2 dimensional large sparse matrix (may be more than 102,400,000 * 102,400,000) and want them to generate a 3 dimensional sparse matrix. I have tried the ndSparse function, but through profile report, it occupies lots of time. I am wandering if there are some other more efficient methods are slove this problem ! Thank you very much!
  댓글 수: 3
Matt J
Matt J 2016년 10월 28일
I have some 2 dimensional large sparse matrix (may be more than 102,400,000 * 102,400,000) and want them to generate a 3 dimensional sparse matrix
You mean you want to stack them to create a sparse array of size 102400000 x 102400000 x N? What is the density of these arrays (percentage of of nonzeros) and what will you do with them?
Jason
Jason 2016년 11월 7일
Hi, Matt! your understand is right, I want creat a 3 dimensional matrix, each page is a 2 dimensional sparse matrix. The percentage of nonzeros is varied with the size of the sparse matrix. Because I used Spdiags function to creat the sparse matrix, which covers six diagonals of it.
I want repmat the sparse matrix to creat a 3 dimensional matrix, such as N*N*A. For each page of matrix, it multiply a vextor, such as N*1.Then, I need to find the munimum value and column number of each row.

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

채택된 답변

Jan
Jan 2016년 10월 28일
A solution depends on what you want to do with the data:
All sparse methods I know are optimized for 2D array manipulations. Therefore I assume, that the creation of the 3D-sparse array will not be the bottleneck for the complete program. If you do not need optimized 2D matrix manipulation methods, you can store the data in a cell array of 2d sparse matrices also, or in one 2D sparse array using a conversion of the indices.

추가 답변 (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