How to add a submatrix to a sparse matrix in parfor efficiently?

2 ビュー (過去 30 日間)
Florian
Florian 2016 年 4 月 21 日
コメント済み: Arnab Sen 2016 年 4 月 27 日
Hi,
I currently have some speed issues with a parfor loop. In the loop I calculate submatrices, which added up are the global Matrix. The code from the profiler (changed the parfor to a for loop) is below.
The submatrices are size 6x6 and consist of 4 3x3 matrices. Compared to the other computations adding these submatrices to the global matrix is extremely slow. Has andybody an idea how to speed this up?
Thank you!
0.08 366600 49 k_l_e = auge * (f/L0(i)) + k_u;
50
2.24 366600 51 k = sparse(dof,dof);
10.37 366600 52 k_l(elementDof,elementDof) = [k_l_e -k_l_e; -k_l_e k_l_e];
53
28.70 366600 54 K = K + k_l; end
  1 件のコメント
Arnab Sen
Arnab Sen 2016 年 4 月 27 日
Can you provide a sample code to reproduce the issue?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by