This is a static copy of a profile reportHome
tformarray>fullsizes (1721 calls, 0.821 sec)
Generated 05-Nov-2014 07:52:55 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/tformarray.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
tformarray | function | 1721 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
551 | osize = fsize_A(~ismember(1:fd... | 1721 | 0.360 s | 43.9% |  |
561 | isT_B = ismember(1:fdims_B, td... | 1721 | 0.280 s | 34.1% |  |
562 | padding = ones(1,fdims_B - (le... | 1721 | 0.030 s | 3.7% |  |
548 | fsize_A = [size_A ones(1,fdims... | 1721 | 0.030 s | 3.7% |  |
540 | fdims_A = max([ndims_A max(tdi... | 1721 | 0.020 s | 2.4% |  |
All other lines | | | 0.100 s | 12.2% |  |
Totals | | | 0.821 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
ismember | function | 3442 | 0.551 s | 67.1% |  |
Self time (built-ins, overhead, etc.) | | | 0.270 s | 32.9% |  |
Totals | | | 0.821 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 57 |
Non-code lines (comments, blank lines) | 42 |
Code lines (lines that can run) | 15 |
Code lines that did run | 15 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
510 function [fsize_A, fsize_B, osize] = fullsizes(size_A, tsize_B, tdims_A, tdims_B)
511
512 % Constructs row vectors indicating the full sizes of A and B (FSIZE_A and
513 % FSIZE_B), including trailing singleton dimensions. Also constructs a row
514 % vector (OSIZE) listing (in order) the sizes of the non-transform
515 % dimensions of both A and B.
516 %
517 % There are two ways for trailing singletons to arise: (1) values in
518 % TDIMS_A exceed the length of SIZE_A or values in TDIMS_B exceed the
519 % length of TSIZE_B plus the number on non-transform dimensions of A and
520 % (2) all dimensions of A are transform dimensions (e.g., A is a grayscale
521 % image) -- in this case a trailing singleton is added to A and then
522 % transferred to B.
523 %
524 % Example:
525 %
526 % [fsize_A, fsize_B] = ...
527 % fullsizes( [7 512 512 512 3 20 ], [200 300], [2 3 4], [1 2] );
528 %
529 % returns fsize_A = [ 7 512 512 512 3 20]
530 % and fsize_B = [200 300 7 3 20]
531 % and osize = [ 7 3 20].
532
533 % Actual dimensionality of input array
0.01 1721 534 ndims_A = length(size_A);
535
536 % 'Full' dimensionality of input array --
537 % Increase ndims(A) as needed, to allow for the largest
538 % transform dimensions as specified in tdims_A, then
539 % make sure there is at least one non-transform dimension.
0.02 1721 540 fdims_A = max([ndims_A max(tdims_A)]);
0.01 1721 541 if fdims_A == length(tdims_A)
1721 542 fdims_A = fdims_A + 1;
1721 543 end
544
545 % 'Full' size of input array --
546 % Pad size_A with ones (as needed) to allow for values
547 % in tdims_A that are higher than ndims(A):
0.03 1721 548 fsize_A = [size_A ones(1,fdims_A - ndims_A)];
549
550 % The non-transform sizes of A and B:
0.36 1721 551 osize = fsize_A(~ismember(1:fdims_A,tdims_A));
552
553 % The minimum ndims of B:
0.01 1721 554 ndims_B = length(osize) + length(tdims_B);
555
556 % Increase ndims_B as needed, to allow for the largest
557 % transform dimensions as specified in tdims_B:
0.01 1721 558 fdims_B = max(ndims_B, max(tdims_B));
559
560 % The full size of B, including possible padding:
0.28 1721 561 isT_B = ismember(1:fdims_B, tdims_B);
0.03 1721 562 padding = ones(1,fdims_B - (length(osize) + length(tsize_B)));
0.01 1721 563 [~, index] = sort(tdims_B);
0.01 1721 564 fsize_B = zeros(size(isT_B));
0.01 1721 565 fsize_B( isT_B) = tsize_B(index);
0.01 1721 566 fsize_B(~isT_B) = [osize padding];
Other subfunctions in this file are not included in this listing.