1function s = ssmultsym (A,B) %#ok 2%SSMULTSYM computes nnz(C), memory, and flops to compute C=A*B; A and B sparse. 3% s = ssmultsym (A,B) returns a struct s with the following fields: 4% 5% s.nz nnz (A*B), assuming no numerical cancelation 6% s.flops flops required to compute C=A*B 7% s.memory memory required to compute C=A*B, including C itself. 8% 9% Either A or B, or both, can be complex. Only matrices of class "double" are 10% supported. If i is the size of an integer (4 bytes on 32-bit MATLAB, 8 bytes 11% on 64-bit MATLAB) and x is the size of an entry (8 bytes if real, 16 if 12% complex), and [m n]=size(C), then the memory usage of SSMULT is 13% (i+x)*nnz(C) + i*(n+1) for C itself, and (i+x)*m for temporary workspace. 14% SSMULTSYM itself does not compute C, and uses only i*m workspace. 15% 16% Example: 17% load west0479 18% A = west0479 ; 19% B = sprand (west0479) ; 20% C = A*B ; 21% D = ssmult (A,B) ; 22% C-D 23% ssmultsym (A,B) 24% nnz (C) 25% whos ('C') 26% [m n] = size (C) 27% mem = 12*nnz(C) + 4*(n+1) + (12*m) % assuming real, 32-bit MATLAB 28% 29% This function can also compute the statistics for any of the 64 combinations 30% of C = op (op(A) * op(B)) where op(A) is A, A', A.', or conj(A). The general 31% form is 32% 33% C = ssmultsym (A,B, at,ac, bt,bc, ct,cc) 34% 35% See ssmult for a description of the at,ac, bt,bc, and ct,cc arguments. 36% 37% See also ssmult, mtimes. 38 39% Copyright 2007-2009, Timothy A. Davis, http://www.suitesparse.com 40 41error ('ssmultsym mexFunction not found') ; 42