This is a static copy of a profile reportHome
classifyBoundsOnVars>equalFloat (860 calls, 0.055 sec)
Generated 05-Aug-2011 13:03:54 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/optim/optim/classifyBoundsOnVars.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
49 | finiteRange_idx = isfinite(v1(... | 860 | 0.022 s | 40.0% |  |
53 | isEqual_idx = finiteRange_idx ... | 860 | 0.011 s | 20.0% |  |
54 | abs(v1(:)-v2(:)) <= toleran... | 860 | 0 s | 0% |  |
All other lines | | | 0.022 s | 40.0% |  |
Totals | | | 0.055 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 12 |
Non-code lines (comments, blank lines) | 9 |
Code lines (lines that can run) | 3 |
Code lines that did run | 3 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
43 function isEqual_idx = equalFloat(v1,v2,tolerance)
44 %equalFloat Helper function that compares two vectors
45 % using a relative difference and returns a boolean
46 % vector.
47
48 % Indices for which both v1 and v2 are finite
0.02 860 49 finiteRange_idx = isfinite(v1(:)) & isfinite(v2(:));
50
51 % Indices at which v1 and v2 are (i) finite and (ii) equal in a
52 % floating point sense
0.01 860 53 isEqual_idx = finiteRange_idx & ...
860 54 abs(v1(:)-v2(:)) <= tolerance*max( 1,max(abs(v1(:)),abs(v2(:))) );