Can a symmetric matrix AA^T be computed using matrix-vector operation?

1 回表示 (過去 30 日間)
Tarek Hajj Shehadi
Tarek Hajj Shehadi 2021 年 7 月 7 日
編集済み: Tarek Hajj Shehadi 2021 年 7 月 7 日
I am interested in computing which is a symmetric matrix where now there's nothing special about A and in the worst case all of its entries are non-zero. I have an idea in my mind to calculate using level-2 BLAS operation.
First the diagonal entries of C is nothing but the j-th row of A multiplied by the transpose of the j-th row of A so it should be like this:
C(j,j)=A(j,:)*A(j,:)';
Next, I will compute the last entries of C that is to say I will compute the lower triangular part of C afterwards I will say that the upper triangular part is equal to the lower triangular part due to symmetry. And this is where my question arises. Can I compute the lower triangular part using matrix-vector operation while avoiding unecessary multiplication such as multiplying elements located at the upper triangular of A?
From what I reached I have reached the following expression :
C(j+1:n,j)=A(j+1:n,j)*A(:,j);
C(j,j+1:n)=C(j+1:n,j);
The issue is that this is a vector-vector multiplication (level-1 BLAS). I would hope for some context on whether level-2 BLAS is possible
  2 件のコメント
Matt J
Matt J 2021 年 7 月 7 日
編集済み: Matt J 2021 年 7 月 7 日
Would it be naive to ask why you don't simply do,
C=A*A.'
explicitly?
Tarek Hajj Shehadi
Tarek Hajj Shehadi 2021 年 7 月 7 日
編集済み: Tarek Hajj Shehadi 2021 年 7 月 7 日
Hello Matt, the reason why I can't use any extremely optimized MATLAB built in function is because the course I am taking does not permit me to do so :( I have to wait a couple of months and then screw every non-effeciant algorithm I ever wrote!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by