This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
maketform>affinesubfunction1721
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
334
if cond(A) > condlimit
17210.200 s55.6%
316
if N < 1 || size(A,2) ~= N ...
17210.040 s11.1%
323
if any(A(:,N+1) ~= [zeros(N,1)...
17210.030 s8.3%
302
if ~isa(A,'double') || ~isreal...
17210.020 s5.6%
320
switch transform_type
17210.010 s2.8%
All other lines  0.060 s16.7%
Totals  0.360 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
condfunction17210.160 s44.4%
maketform>condlimitsubfunction17210.020 s5.6%
Self time (built-ins, overhead, etc.)  0.180 s50.0%
Totals  0.360 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function38
Non-code lines (comments, blank lines)12
Code lines (lines that can run)26
Code lines that did run9
Code lines that did not run17
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.