This is a static copy of a profile reportHome
classifyBoundsOnVars (860 calls, 0.186 sec)
Generated 05-Aug-2011 13:03:54 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/optim/optim/classifyBoundsOnVars.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
fmincon | function | 860 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
33 | xIndices.fixed = equalFloat(lb... | 860 | 0.109 s | 58.8% |  |
39 | xIndices.finiteLb = ~xIndices.... | 860 | 0.011 s | 5.9% |  |
27 | if any(lb(:) == ub(:) & is... | 860 | 0.011 s | 5.9% |  |
23 | if any(ub == -Inf) | 860 | 0.011 s | 5.9% |  |
16 | if any(isnan(lb)) || any(isnan... | 860 | 0.011 s | 5.9% |  |
All other lines | | | 0.033 s | 17.6% |  |
Totals | | | 0.186 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
classifyBoundsOnVars>equalFloat | subfunction | 860 | 0.055 s | 29.4% |  |
Self time (built-ins, overhead, etc.) | | | 0.131 s | 70.6% |  |
Totals | | | 0.186 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 40 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 25 |
Code lines that did run | 10 |
Code lines that did not run | 15 |
Coverage (did run/can run) | 40.00 % |
Function listing
time calls line
1 function xIndices = classifyBoundsOnVars(lb,ub,nVar,findFixedVar)
2 %classifyBoundsOnVars Helper function that identifies variables
3 % that are fixed, and that have finite bounds.
4
5 % Copyright 2007-2009 The MathWorks, Inc.
6 % $Revision: 1.1.6.3 $ $Date: 2010/10/08 17:13:03 $
7
8 % Set empty vector bounds to vectors of +Inf or -Inf
860 9 if isempty(lb)
10 lb = -Inf(nVar,1);
11 end
0.01 860 12 if isempty(ub)
13 ub = Inf(nVar,1);
14 end
15 % Check for NaN
0.01 860 16 if any(isnan(lb)) || any(isnan(ub))
17 error(message('optim:classifyBoundsOnVars:NaNBounds'))
18 end
19 % Check for +Inf lb and -Inf ub
860 20 if any(lb == Inf)
21 error(message('optim:classifyBoundsOnVars:PlusInfLb'))
22 end
0.01 860 23 if any(ub == -Inf)
24 error(message('optim:classifyBoundsOnVars:MinusInfUb'))
25 end
26 % Check for fixed variables equal to Inf or -Inf
0.01 860 27 if any(lb(:) == ub(:) & isinf(lb(:)))
28 error(message('optim:classifyBoundsOnVars:FixedVarsAtInf'))
29 end
30
31 % Fixed variables
860 32 if findFixedVar
0.11 860 33 xIndices.fixed = equalFloat(lb,ub,eps);
34 else % Do not attempt to detect fixed variables
35 xIndices.fixed = false(nVar,1);
36 end
37
38 % Finite lower and upper bounds; exclude fixed variables
0.01 860 39 xIndices.finiteLb = ~xIndices.fixed & isfinite(lb(:));
860 40 xIndices.finiteUb = ~xIndices.fixed & isfinite(ub(:));
Other subfunctions in this file are not included in this listing.