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일

1 개 추천

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

nauman
nauman 2016년 6월 5일
Hi Roger Thanks. It means if i multiply two N size complex arrays, "element by element", total no of flops would be 6N. Am i right?
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.
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일

0 개 추천

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

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

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2016년 6월 4일

댓글:

2016년 6월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by