source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/flops_spadd.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 326 bytes
Line 
1function f = flops_spadd(a,b)
2% FLOPS_SPADD   Flops for sparse matrix addition.
3% FLOPS_SPADD(a,b) returns the number of flops for a+b, where addition of zero
4% doesn't count.
5% For example:
6%   flops_spadd(0,4) is 0.
7%   flops_spadd(eye(3), ones(3)) is 3.
8
9nza = (a ~= 0);
10nzb = (b ~= 0);
11f = sum(sum(nza & nzb));
Note: See TracBrowser for help on using the repository browser.