Using flops_div() from the lightspeed toolbox by tom minka..
1 回表示 (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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 件のコメント
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 Center および File Exchange で Create System Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!