File: ssmultsym.m

package info (click to toggle)
suitesparse 1%3A5.8.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 152,716 kB
  • sloc: ansic: 774,385; cpp: 24,213; makefile: 6,310; fortran: 1,927; java: 1,826; csh: 1,686; ruby: 725; sh: 535; perl: 225; python: 209; sed: 164; awk: 60
file content (41 lines) | stat: -rw-r--r-- 1,573 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function s = ssmultsym (A,B)                                                %#ok
%SSMULTSYM computes nnz(C), memory, and flops to compute C=A*B; A and B sparse.
% s = ssmultsym (A,B) returns a struct s with the following fields:
%
%   s.nz            nnz (A*B), assuming no numerical cancelation
%   s.flops         flops required to compute C=A*B
%   s.memory        memory required to compute C=A*B, including C itself.
%
% Either A or B, or both, can be complex.  Only matrices of class "double" are
% supported.  If i is the size of an integer (4 bytes on 32-bit MATLAB, 8 bytes
% on 64-bit MATLAB) and x is the size of an entry (8 bytes if real, 16 if
% complex), and [m n]=size(C), then the memory usage of SSMULT is
% (i+x)*nnz(C) + i*(n+1) for C itself, and (i+x)*m for temporary workspace.
% SSMULTSYM itself does not compute C, and uses only i*m workspace.
%
% Example:
%   load west0479
%   A = west0479 ;
%   B = sprand (west0479) ;
%   C = A*B ;
%   D = ssmult (A,B) ;
%   C-D
%   ssmultsym (A,B)
%   nnz (C)
%   whos ('C')
%   [m n] = size (C)
%   mem = 12*nnz(C) + 4*(n+1) + (12*m)          % assuming real, 32-bit MATLAB
%
% This function can also compute the statistics for any of the 64 combinations
% of C = op (op(A) * op(B)) where op(A) is A, A', A.', or conj(A).  The general
% form is
%
%   C = ssmultsym (A,B, at,ac, bt,bc, ct,cc)
%
% See ssmult for a description of the at,ac, bt,bc, and ct,cc arguments.
%
% See also ssmult, mtimes.

% Copyright 2007-2009, Timothy A. Davis, http://www.suitesparse.com

error ('ssmultsym mexFunction not found') ;