필터 지우기
필터 지우기

Eigen Decomposition of Hermitian symmetric matrix using MATLAB Coder

조회 수: 5 (최근 30일)
AJ
AJ 2022년 6월 5일
댓글: AJ 2022년 6월 8일
I'm planning to implement the eig function as part of a MATLAB coder project.
The input matrix is complex, and Hermitian symmetric and positive definite.
My worry is about timing, how long the algorithm requires, since I'll be calling it a lot.
My assumption is that the C-code implementation will employ the "full-blown" eigen decompsition, without considering that the problem could simplified using the knowledge of the matrix properties. For example, all the eigen-values will be positive and real-valued.
I have not yet looked into BLAS or LAPACK, etc., to see of there is a special case of eig for symmetric, positive definite matrices.
Any ideas?
  댓글 수: 2
Bruno Luong
Bruno Luong 2022년 6월 5일
Your decription is confused:
  • Hermitian is not symmetric if the matrix is complex (not pure real).
  • Symmetric is not positive in general, one cannot even speak about positiveness since x'*H*x is complex.
AJ
AJ 2022년 6월 5일
Yes, I (perhaps wrongly) use the term "Hermitian Symmetric" meaning "Hermitian" when the real parts are symmetric and the imaginary parts are "anti-symmetric", i.e. the matrix is its own conjugate transpose.
The matrix is also positive definite, due to the way it is generated; think sample covariance matrix.

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

채택된 답변

Steven Lord
Steven Lord 2022년 6월 5일
According to the Extended Capabilities section of the documentation page for the eig function it already supports C/C++ code generation with MATLAB Coder.
  댓글 수: 5
Christine Tobler
Christine Tobler 2022년 6월 6일
The coder version of EIG does not support special branches for the Hermitian case. In fact, it will treat most simple eigenvalue problems as if they were generalized eigenvalue problems, in the implementation.
See the Extended Capabilities section, which notes
"For the standard eigenvalue problem, [V,D] = eig(A), when A is Hermitian or skew-Hermitian, code generation uses schur to calculate V and D. Otherwise, the results of [V,D] = eig(A) are similar to the results obtained by using [V,D] = eig(A,eye(size(A)),'qz') in MATLAB, except that the columns of V are normalized."
Note there are differences in behavior based on whether you specify the LAPACK library callback class.
AJ
AJ 2022년 6월 8일
schur sounds like the ticket for me. Thank you, Christine Tobler, and to others who responded.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by