Multiplication of a Sparse Matrix With Diagonal Matrices

조회 수: 2 (최근 30일)
Kamal Premaratne
Kamal Premaratne 2020년 6월 12일
I have a sparse m x m square matrix L (which is actually a Laplacian matrix of a large graph) and an m x1 vector d. I want to create a diaognal matrix D whose diagonal is populated with the entries in d and then generate
normL = D * L * D
Currently, I am creating a sparse diaognal matrix as
D = spdiags(d, 0, m, m)
and then I use D * L * D.
I wonder whether there is a more efficient way to do this given that the (i, j)-th elements of normL and L are related by
normL(i, j) = D(i) * D(j) * L(i, j).
Thank you very 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