This is a static copy of a profile reportHome
maketform>validate_matrix (1721 calls, 0.360 sec)
Generated 05-Nov-2014 07:53:00 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/maketform.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 |
334 | if cond(A) > condlimit | 1721 | 0.200 s | 55.6% |  |
316 | if N < 1 || size(A,2) ~= N ... | 1721 | 0.040 s | 11.1% |  |
323 | if any(A(:,N+1) ~= [zeros(N,1)... | 1721 | 0.030 s | 8.3% |  |
302 | if ~isa(A,'double') || ~isreal... | 1721 | 0.020 s | 5.6% |  |
320 | switch transform_type | 1721 | 0.010 s | 2.8% |  |
All other lines | | | 0.060 s | 16.7% |  |
Totals | | | 0.360 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cond | function | 1721 | 0.160 s | 44.4% |  |
maketform>condlimit | subfunction | 1721 | 0.020 s | 5.6% |  |
Self time (built-ins, overhead, etc.) | | | 0.180 s | 50.0% |  |
Totals | | | 0.360 s | 100% | |
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 38 |
Non-code lines (comments, blank lines) | 12 |
Code lines (lines that can run) | 26 |
Code lines that did run | 9 |
Code lines that did not run | 17 |
Coverage (did run/can run) | 34.62 % |
Function listing
time calls line
299 function A = validate_matrix( A, transform_type )
300
301 % Make sure A is double and real-valued.
0.02 1721 302 if ~isa(A,'double') || ~isreal(A)
303 error(message('images:maketform:invalidAValue'))
304 end
305
306 % Make sure A is finite.
0.01 1721 307 if ~all(isfinite(A))
308 error(message('images:maketform:aContainsInfs'))
309 end
310
311 % Make sure A is (N + 1)-by-(N + 1). Append a column if needed for 'affine'.
1721 312 N = size(A,1) - 1;
0.01 1721 313 if strcmp(transform_type,'affine') && size(A,2) == N
314 A(:,N+1) = [zeros(N,1); 1];
315 end
0.04 1721 316 if N < 1 || size(A,2) ~= N + 1
317 error(message('images:maketform:invalidASize'))
318 end
319
0.01 1721 320 switch transform_type
1721 321 case 'affine'
322 % Validate the final column of A.
0.03 1721 323 if any(A(:,N+1) ~= [zeros(N,1); 1])
324 error(message('images:maketform:invalidAForAffine'))
325 end
326
327 case 'projective'
328 % Validate lower right corner of A
329 if abs(A(N+1,N+1)) <= 100 * eps * norm(A)
330 warning(message('images:maketform:lastElementInANearZero'))
331 end
332 end
333
0.20 1721 334 if cond(A) > condlimit
335 warning(message('images:maketform:conditionNumberofAIsHigh', num2str( cond( A ) )))
336 end
Other subfunctions in this file are not included in this listing.