FLOPS in Complex Array Multiplication

13 ビュー (過去 30 日間)
nauman
nauman 2016 年 6 月 4 日
コメント済み: Walter Roberson 2016 年 6 月 5 日
Hi all
I have two complex number arrays of size N. If i do element by element multiplication of these two arrays, how can i calculate total no of "FLOPs" for this array multiplication?
Kindly help me. Thanks

採用された回答

Roger Stafford
Roger Stafford 2016 年 6 月 5 日
I count six floating point operations per complex multiplication. If your matrix is N-by-N, that would be a total of 6*N^2 flops for an element-by-element multiplication.
  3 件のコメント
Roger Stafford
Roger Stafford 2016 年 6 月 5 日
編集済み: Roger Stafford 2016 年 6 月 5 日
It depends on what you mean by "N size". If you mean N-by-1 or 1-by-N, then 6*N is correct. The fundamental fact is that a multiplication of one complex number by another complex number takes six flops, consisting of four floating point multiplications and two floating point additions.
Walter Roberson
Walter Roberson 2016 年 6 月 5 日
If the arrays have N elements then Yes.
a .* b = complex( real(a).*real(b) - imag(a).*imag(b), real(a).*imag(b) + imag(a).*real(b) )
2 multiplications and one addition (or subtraction) on each side, for a total of 6 operations.

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

その他の回答 (1 件)

Adam
Adam 2016 年 6 月 4 日
doc timeit
Put the multiplication in a function, use timeit and divide the number of floating point operations (easy to calculate) by the time you get.
  1 件のコメント
nauman
nauman 2016 年 6 月 5 日
Hi Adam Thanks for help. Actually i need to theoretically calculate FLOPs for N size complex arrays multiplication

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by