필터 지우기
필터 지우기

Using flops_div() from the lightspeed toolbox by tom minka..

조회 수: 8 (최근 30일)
Gina DiCarlo
Gina DiCarlo 2016년 9월 26일
댓글: Walter Roberson 2016년 9월 27일
I'm using the Lightspeed toolbox created by Tom Minka to find the FLOP count for a project I'm using. For multiplication I used: addflops(flops_mul(matrix1, matrix2)); But for division (flops_div) it doesn't allow any input arguments, has anyone else used this toolbox and know how to properly use this function?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 9월 26일
Multiply the results of flops_div by the number of scalars you are dividing.
flops_div is for scalar division, not for matrix algebra division.
  댓글 수: 3
Gina DiCarlo
Gina DiCarlo 2016년 9월 26일
Or by the number of scalars do you mean the length of the number, so in this case it would be 2 (2 and 0) and the answer would be 16?
Walter Roberson
Walter Roberson 2016년 9월 27일
For the case of A ./ B
div_count = max(numel(A),numel(B)) * flops_div
This covers the case where one of the two might be a scalar, and also covers the case where the two are the same size. The case where the two are non-scalars of different size is an error for the ./ operator.
For the case of A / B then if B is a scalar then the operation is the same as A ./ B . For the case of A / B where B is not a scalar then that is matrix algebra division and flops_div does not cover that.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by