This is a static copy of a profile reportHome
maketform>composite (1721 calls, 0.561 sec)
Generated 05-Nov-2014 07:53:04 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 Name | Function Type | Calls |
maketform | function | 1721 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
514 | t = assigntform(tdata(N).ndims... | 1721 | 0.140 s | 25.0% |  |
475 | if ~istform(tdata) | 1721 | 0.130 s | 23.2% |  |
493 | if any(ndims_in(1:N-1) ~= ndim... | 1721 | 0.060 s | 10.7% |  |
498 | if any(cellfun('isempty',{tdat... | 1721 | 0.040 s | 7.1% |  |
491 | ndims_in = [tdata.ndims_in]; | 1721 | 0.030 s | 5.4% |  |
All other lines | | | 0.160 s | 28.6% |  |
Totals | | | 0.561 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
images/private/istform | function | 1721 | 0.090 s | 16.1% |  |
maketform>assigntform | subfunction | 1721 | 0.070 s | 12.5% |  |
Self time (built-ins, overhead, etc.) | | | 0.401 s | 71.4% |  |
Totals | | | 0.561 s | 100% | |
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 59 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 44 |
Code lines that did run | 22 |
Code lines that did not run | 22 |
Coverage (did run/can run) | 50.00 % |
Function listing
time calls line
457 function t = composite( varargin )
458
459 % Construct COMPOSITE transformation structure.
460
461 % Create TDATA as a TFORM structure array.
0.02 1721 462 if nargin == 0
463 error(message('images:maketform:tooFewTformStructs'))
1721 464 elseif nargin == 1
0.02 1721 465 if length(varargin{1}) == 1
466 % One TFORM input, just copy to t
467 t = varargin{1};
468 if ~istform(t)
469 error(message('images:maketform:invalidTformStruct'))
470 end
471 return;
1721 472 else
473 % An array of TFORMs
1721 474 tdata = varargin{1};
0.13 1721 475 if ~istform(tdata)
476 error(message('images:maketform:invalidTformStructArray'))
477 end
1721 478 end
479 else
480 % A list of TFORMs
481 for k = 1:nargin
482 if ~istform(varargin{k}) || length(varargin{k}) ~= 1
483 error(message('images:maketform:invalidTformsInArray'))
484 end
485 end
486 tdata = [varargin{:}];
487 end
488
489 % Check for consistency of dimensions
1721 490 N = length(tdata);
0.03 1721 491 ndims_in = [tdata.ndims_in];
1721 492 ndims_out = [tdata.ndims_out];
0.06 1721 493 if any(ndims_in(1:N-1) ~= ndims_out(2:N))
494 error(message('images:maketform:tFormsDoNotHaveSameDimension'))
495 end
496
497 % Check existence of forward and inverse function handles
0.04 1721 498 if any(cellfun('isempty',{tdata.forward_fcn}))
499 forward_fcn = [];
0.01 1721 500 else
0.02 1721 501 forward_fcn = @fwd_composite;
0.01 1721 502 end
503
0.01 1721 504 if any(cellfun('isempty',{tdata.inverse_fcn}))
505 inverse_fcn = [];
0.01 1721 506 else
0.01 1721 507 inverse_fcn = @inv_composite;
0.01 1721 508 end
509
0.01 1721 510 if (isempty(forward_fcn) && isempty(inverse_fcn))
511 error(message('images:maketform:invalidForwardOrInverseFunction'))
512 end
513
0.14 1721 514 t = assigntform(tdata(N).ndims_in, tdata(1).ndims_out, ...
1721 515 forward_fcn, inverse_fcn, tdata);
Other subfunctions in this file are not included in this listing.