source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/flops_spadd.m
@
177
Last change on this file since 177 was 37, checked in by , 15 years ago | |
---|---|
File size: 326 bytes |
Line | |
---|---|
1 | function 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 | |
9 | nza = (a ~= 0); |
10 | nzb = (b ~= 0); |
11 | f = sum(sum(nza & nzb)); |
Note: See TracBrowser
for help on using the repository browser.