This is a static copy of a profile report

Home

checkoptionsize (860 calls, 0.033 sec)
Generated 05-Aug-2011 13:03:54 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/shared/optimlib/checkoptionsize.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
fminconfunction860
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
22
if prod(optionsize) ~= numvars
8600.011 s33.3%
20
switch lower(option)
8600.011 s33.3%
21
case 'typicalx'
8600 s0%
All other lines  0.011 s33.3%
Totals  0.033 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function43
Non-code lines (comments, blank lines)24
Code lines (lines that can run)19
Code lines that did run3
Code lines that did not run16
Coverage (did run/can run)15.79 %
Function listing
   time   calls  line
1 function checkoptionsize(option, optionsize, numvars, numfunelts)
2 %CHECKOPTIONSIZE Verify problem size dependent options
3 % CHECKOPTIONSIZE('OPTION', OPTIONSIZE, NUMVARS) verifies that the
4 % specified option is of the correct size. Valid values for 'OPTION' are
5 % 'TypicalX' and 'HessPattern'. OPTIONSIZE is the size of the specified
6 % OPTION. NUMVARS specifies the number of free variables (normally
7 % numel(X0)).
8 %
9 % CHECKOPTIONSIZE('JacobPattern', OPTIONSIZE, NUMVARS, NUMFUNELTS)
10 % verifies that the option 'JacobPattern' is of the correct size.
11 % NUMFUNELTS is the number of elements in the vector (or matrix) returned
12 % by FUN.
13 %
14 % This is a helper function for the Optimization Toolbox.
15
16 % Copyright 2008 The MathWorks, Inc.
17 % $Revision: 1.1.6.1 $ $Date: 2008/02/29 13:09:38 $
18
19 % Perform size checks
0.01 860 20 switch lower(option)
860 21 case 'typicalx'
0.01 860 22 if prod(optionsize) ~= numvars
23 ME = MException('optimlib:checkoptionsize:InvalidSizeOfTypicalX', ...
24 'TypicalX must have the same number of elements as X0.');
25 throwAsCaller(ME);
26 end
27 case 'hesspattern'
28 expsize = [numvars numvars];
29 if ~isequal(optionsize, expsize)
30 ME = MException('optimlib:checkoptionsize:InvalidSizeOfHessPattern', ...
31 ['User-defined Hessian pattern is not the correct size:\n' ...
32 'the matrix HessPattern should be %d-by-%d.'],numvars,numvars);
33 throwAsCaller(ME);
34 end
35 case 'jacobpattern'
36 expsize = [numfunelts numvars];
37 if ~isequal(optionsize, expsize)
38 ME = MException('optimlib:checkoptionsize:InvalidSizeOfJacobPattern', ...
39 ['User-defined Jacobian pattern is not the correct size:\n' ...
40 'the matrix JacobPattern should be %d-by-%d.'],numfunelts,numvars);
41 throwAsCaller(ME);
42 end
43 end

Other subfunctions in this file are not included in this listing.