Speeding up matrix operations

조회 수: 7 (최근 30일)
federico nutarelli
federico nutarelli 2022년 12월 2일
댓글: federico nutarelli 2022년 12월 2일
Hi all,
say A and B are big matrices and u,s,v are the svd decomposition of another big matrix. Now, is there a way to speed up the following operation?
mat=(A-u*s*v').*B
I have read that MATLAB has a tool called BLAS but have not understood how to use it and if it is useful in this case.
Thank you
  댓글 수: 2
Matt J
Matt J 2022년 12월 2일
편집: Matt J 2022년 12월 2일
What are the dimensions of all the matrices? Are they all square? Are any of the singular values zero?
federico nutarelli
federico nutarelli 2022년 12월 2일
So the matrices are 1000x700. Singular values decay after a lot of time. There are but I would say they are a 10% of the entire singular value matrix.

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

답변 (1개)

Jan
Jan 2022년 12월 2일
Matlab calls optimized libraries to solve linear algebra operations. These libraries are based on BLAS and LAPACK, but modern versions as ATLAS and MKL are tune automatically to improve the performance.
These functions are called automatically if you apply a matrix multiplication or SVD, and inversion or LU or QR decomposition. You do not have to call these functions manually. This was the purpose of designing Matlab.
If u,s,v is the SVD decomposition of another matrix C, wouldn't it be more efficient to use
(A - C) .* B
instead of:
(A - u*s*v') .* B

카테고리

Help CenterFile Exchange에서 Matrix Decomposition에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by