This is a static copy of a profile report

Home

spparms (35 calls, 0.011 sec)
Generated 05-Aug-2011 13:00:54 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/sparfun/spparms.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
splinefunction21
spparmsfunction14
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
189
elseif nargin == 1 && ...
350.011 s100.0%
267
return;
140 s0%
266
spparms(newvalues);
140 s0%
265
end
140 s0%
261
if ~found
140 s0%
All other lines  0 s0%
Totals  0.011 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
spparmsfunction140 s0%
Self time (built-ins, overhead, etc.)  0.011 s100.0%
Totals  0.011 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function272
Non-code lines (comments, blank lines)122
Code lines (lines that can run)150
Code lines that did run53
Code lines that did not run97
Coverage (did run/can run)35.33 %
Function listing
   time   calls  line
1 function [return1,return2] = spparms(arg1,arg2)
2 %SPPARMS Set parameters for sparse matrix routines.
3 % SPPARMS('key',value) sets one or more of the "tunable" parameters
4 % used in the sparse routines, particularly sparse / and \.
5 %
6 % SPPARMS, by itself, prints a description of the current settings.
7 %
8 % If no input argument is present, values = SPPARMS returns a
9 % vector whose components give the current settings.
10 % [keys,values] = SPPARMS returns that vector, and also returns
11 % a character matrix whose rows are the keywords for the parameters.
12 %
13 % SPPARMS(values), with no output argument, sets all the parameters
14 % to the values specified by the argument vector.
15 %
16 % value = SPPARMS('key') returns the current setting of one parameter.
17 %
18 % SPPARMS('default') sets all the parameters to their default settings.
19 % SPPARMS('tight') sets the minimum degree ordering parameters to their
20 % "tight" settings, which may lead to orderings with less fill-in, but
21 % which makes the ordering functions themselves use more execution time.
22 %
23 % The parameters with the default and "tight" values are:
24 %
25 % keyword default tight
26 %
27 % values(1) 'spumoni' 0
28 % values(2) 'thr_rel' 1.1 1.0
29 % values(3) 'thr_abs' 1.0 0.0
30 % values(4) 'exact_d' 0 1
31 % values(5) 'supernd' 3 1
32 % values(6) 'rreduce' 3 1
33 % values(7) 'wh_frac' 0.5 0.5
34 % values(8) 'autommd' 1
35 % values(9) 'autoamd' 1
36 % values(10) 'piv_tol' 0.1
37 % values(11) 'bandden' 0.5
38 % values(12) 'umfpack' 1
39 % values(13) 'sym_tol' 0.001
40 % values(14) 'ldl_tol' 0.01
41 %
42 % The meanings of the parameters are
43 %
44 % spumoni: The Sparse Monitor Flag controls diagnostic output;
45 % 0 means none, 1 means some, 2 means too much.
46 % thr_rel,
47 % thr_abs: Minimum degree threshold is thr_rel*mindegree + thr_abs.
48 % exact_d: Nonzero to use exact degrees in minimum degree,
49 % Zero to use approximate degrees.
50 % supernd: If > 0, MMD amalgamates supernodes every supernd stages.
51 % rreduce: If > 0, MMD does row reduction every rreduce stages.
52 % wh_frac: Rows with density > wh_frac are ignored in COLMMD.
53 % autommd: Nonzero to use SYMMMD and COLMMD orderings with \ and /.
54 % autoamd: Nonzero to use AMD or COLAMD ordering with CHOLMOD, UMFPACK,
55 % and SuiteSparseQR in \ and /.
56 % piv_tol: Pivot tolerance used by LU-based (UMFPACK) \ and /.
57 % bandden: Backslash uses band solver if band density is > bandden.
58 % If bandden = 1.0, never use band solver.
59 % If bandden = 0.0, always use band solver.
60 % umfpack: Nonzero to use UMFPACK instead of the v4 LU-based solver
61 % in \ and /.
62 % sym_tol: Symmetric pivot tolerance used by UMFPACK. See LU for
63 % more information about the role of the symmetric pivot
64 % tolerance.
65 % ldl_tol: Pivot tolerance used by LDL-based (MA57) \ and /.
66 %
67 % Note:
68 % Solving symmetric positive definite matrices within \ and /:
69 % The CHOLMOD CHOL-based solver uses AMD.
70 % Solving general square matrices within \ and /:
71 % The UMFPACK LU-based solver uses either AMD or a modified COLAMD.
72 % The v4 LU-based solver uses COLMMD.
73 % Solving rectangular matrices within \ and /:
74 % The SuiteSparseQR QR-based solver uses COLAMD.
75 % All of these algorithms respond to SPPARMS('autoamd') except for the
76 % v4 LU-based, which responds to SPPARMS('autommd').
77 %
78 % See also AMD, COLAMD, SYMAMD.
79
80 % Copyright 1984-2009 The MathWorks, Inc.
81 % $Revision: 5.14.4.17 $ $Date: 2010/08/23 23:12:46 $
82
83 % The following are "constants".
84
35 85 allkeys = ['spumoni'
86 'thr_rel'
87 'thr_abs'
88 'exact_d'
89 'supernd'
90 'rreduce'
91 'wh_frac'
92 'autommd'
93 'autoamd'
94 'piv_tol'
95 'bandden'
96 'umfpack'
97 'sym_tol'
98 'ldl_tol'
99 'cholmod'
100 'usema57'
101 'usespqr'
102 'chmodsp'];
35 103 nparms = size(allkeys,1);
35 104 spuparmrange = 1:1; % Which parameters pertain to SPUMONI?
35 105 mmdparmrange = 2:7; % Which parameters pertain to minimum degree?
35 106 bslparmrange = 8:17; % Which parameters pertain to sparse backslash?
35 107 cspparmrange = 18:18;
35 108 defaultparms = [0 1.1 1.0 0 3 3 0.5 1 1 0.1 0.5 1 0.001 0.01 1 1 1 0]';
35 109 tightmmdparms = [1.0 0.0 1 1 1 0.5]';
110
111 % First find out what the current parameters are.
112
35 113 oldvalues = zeros(nparms,1);
35 114 oldvalues(spuparmrange) = sparsfun('spumoni');
35 115 oldvalues(mmdparmrange) = sparsfun('mmdset');
35 116 oldvalues(bslparmrange) = sparsfun('slashset');
35 117 oldvalues(cspparmrange) = sparsfun('chmodsp');
118
119 % No input args, no output args: Describe current settings.
35 120 if nargin == 0 && nargout == 0
121 a = num2str(oldvalues(1));
122 if oldvalues(1)
123 fprintf('SParse MONItor output level %s.\n', a);
124 else
125 fprintf('No SParse MONItor output.\n');
126 end
127 a = num2str(oldvalues(2));
128 b = num2str(oldvalues(3));
129 fprintf('mmd: threshold = %s * mindegree + %s,\n', a, b);
130 if oldvalues(4)
131 fprintf(' using exact degrees in A''*A,\n');
132 else
133 fprintf(' using approximate degrees in A''*A,\n');
134 end
135 s = int2str(oldvalues(5));
136 if oldvalues(5)
137 fprintf(' supernode amalgamation every %s stages,\n', s);
138 else
139 fprintf(' no supernode amalgamation,');
140 end
141 s = int2str(oldvalues(6));
142 if oldvalues(6)
143 fprintf(' row reduction every %s stages,\n', s);
144 else
145 fprintf(' no row reduction,\n');
146 end
147 a = num2str(100*oldvalues(7));
148 if oldvalues(7)
149 fprintf(' withhold rows at least %s%% dense in colmmd.\n', a);
150 else
151 fprintf(' no row withholding in colmmd.\n');
152 end
153 if oldvalues(8)
154 fprintf('Minimum degree orderings used with v4 chol, lu, and qr in \\ and /.\n');
155 else
156 fprintf('No automatic orderings used with v4 chol, lu, and qr in \\ and /.\n');
157 end
158 if oldvalues(9)
159 fprintf('Approximate minimum degree orderings used with CHOLMOD and UMFPACK in \\ and /.\n');
160 else
161 fprintf('No automatic orderings used with CHOLMOD and UMFPACK in \\ and /.\n');
162 end
163 a = num2str(oldvalues(10));
164 fprintf('Pivot tolerance of %s used by UMFPACK in \\ and /.\n', a);
165 a = num2str(oldvalues(11));
166 fprintf('Backslash uses band solver if band density is > %s\n', a);
167 if oldvalues(12)
168 fprintf('UMFPACK used for lu in \\ and /.\n');
169 else
170 fprintf('v4 algorithm used for lu in \\ and /.\n');
171 end
172 a = num2str(oldvalues(13));
173 fprintf('Symmetric pivot tolerance of %s used by UMFPACK in \\ and /.\n', a);
174 a = num2str(oldvalues(14));
175 fprintf('Pivot tolerance of %s used by MA57 in \\ and /.\n', a);
176 return;
177
178 % No input args, one or two output args: Return current settings.
35 179 elseif nargin == 0 && nargout > 0
180 if nargout <= 1
181 return1 = oldvalues;
182 else
183 return1 = allkeys;
184 return2 = oldvalues;
185 end
186 return;
187
188 % One input arg of suitable size: Reset all parameters.
0.01 35 189 elseif nargin == 1 && length(arg1) == nparms && min(size(arg1)) == 1
14 190 if nargout > 0
191 error (message('MATLAB:spparms:TooManyOutputs'))
192 end
14 193 sparsfun('spumoni',arg1(spuparmrange));
14 194 sparsfun('mmdset',arg1(mmdparmrange));
14 195 sparsfun('slashset',arg1(bslparmrange));
14 196 sparsfun('chmodsp',arg1(cspparmrange));
14 197 return;
198
199 % Input arg 'tight': Reset minimum degree parameters.
21 200 elseif nargin == 1 && strcmpi(arg1,'tight')
201 if nargout > 0
202 error (message('MATLAB:spparms:TooManyOutputs'))
203 end
204 newvalues = oldvalues;
205 newvalues(mmdparmrange) = tightmmdparms;
206 spparms(newvalues);
207 return;
208
209 % Input arg 'default': Reset all parameters.
21 210 elseif nargin == 1 && strcmpi(arg1,'default')
211 if nargout > 0
212 error (message('MATLAB:spparms:TooManyOutputs'))
213 end
214 spparms(defaultparms);
215 return;
216
217 % One input arg: Return one current setting.
21 218 elseif (nargin == 1)
7 219 if ~ischar(arg1)
220 error (message('MATLAB:spparms:OptionNotString'))
221 end
7 222 if nargout > 1
223 error (message('MATLAB:spparms:TooManyOutputs'))
224 end
7 225 if size(arg1,1) > 1
226 error (message('MATLAB:spparms:TooManyParamsPerKeyword'))
227 end
7 228 key = lower(arg1);
7 229 for i = 1:nparms
56 230 if strcmp (key, allkeys(i,:))
7 231 return1 = oldvalues(i);
7 232 return;
233 end
49 234 end
235 error ('MATLAB:spparms:UnknownKeyword', ...
236 'Unknown keyword parameter "%s".', key);
237
238 % Two input args: Reset some parameters.
14 239 elseif (nargin == 2)
14 240 if ~ischar(arg1)
241 error (message('MATLAB:spparms:OptionNotString'));
242 end
14 243 if nargout > 0
244 error (message('MATLAB:spparms:TooManyOutputs'));
245 end
14 246 if size(arg1,1) ~= length(arg2)
247 error (message('MATLAB:spparms:ParamsMismatchKeywords'));
248 end
14 249 newvalues = oldvalues;
14 250 for k = 1:size(arg1,1)
14 251 key = lower(arg1(k,:));
14 252 value = arg2(k);
14 253 found = 0;
14 254 for i = 1:nparms
112 255 if strcmp (key, allkeys(i,:))
14 256 newvalues(i) = value;
14 257 found = 1;
14 258 break
259 end
98 260 end
14 261 if ~found
262 warning('MATLAB:spparms:UnknownKeyword', ...
263 'Unknown keyword parameter "%s" in SPPARMS.', key);
264 end
14 265 end
14 266 spparms(newvalues);
14 267 return;
268
269 % No error is possible here.
270 else
271 error (message('MATLAB:spparms:InvalidArgs'))
272 end