필터 지우기
필터 지우기

Incomplete factorization is too slow

조회 수: 2 (최근 30일)
Daniel Lara
Daniel Lara 2021년 3월 15일
답변: Rashed Mohammed 2021년 3월 18일
Hi, I'm doing my project of numerical analysis and I have this code to Incomplete Cholesky factorization but for matrix of 625x625 is too slow I tried to use parfor but this don't help. Does anyone have any idea?
function [L]=CholeskyInc(A)
[n,m]=size(A);
if n~= m; error('error');
else
L=speye(n,n);
for k=1:n
L(k,k)=sqrt(A(k,k));
for i=k+1:n
if A(i,k)~=0
L(i,k)=A(i,k)/A(k,k);
end
end
for j=k+1:n
for i=j:n
if (A(i,j))~=0
L(i,j)=A(i,j)-A(i,k)*A(j,k);
end
end
end
end
end

답변 (1개)

Rashed Mohammed
Rashed Mohammed 2021년 3월 18일
Hi Daniel,
You can use the MATLAB builtin ichol function for Incomplete Cholesky factorization. However, if you want to optimize your implementation for performance, I suggest you to go through https://www.mathworks.com/help/matlab/matlab_prog/techniques-for-improving-performance.html. It outlines best practices while writing MATLAB code aimed at performance.
Hope this helps

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by