This is a static copy of a profile reportHome
maketform>affine (1721 calls, 0.801 sec)
Generated 05-Nov-2014 07:53:01 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 |
167 | A = validate_matrix( A, 'affin... | 1721 | 0.401 s | 50.0% |  |
177 | t = assigntform(N, N, @fwd_aff... | 1721 | 0.180 s | 22.5% |  |
171 | tdata.Tinv = inv(A); | 1721 | 0.100 s | 12.5% |  |
153 | if ~isempty(msgstruct) | 1721 | 0.030 s | 3.8% |  |
175 | tdata.Tinv(end,end) = 1; | 1721 | 0.020 s | 2.5% |  |
All other lines | | | 0.070 s | 8.8% |  |
Totals | | | 0.801 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
152 | NARGCHK will be removed in a future release. Use NARGINCHK instead. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 30 |
Non-code lines (comments, blank lines) | 11 |
Code lines (lines that can run) | 19 |
Code lines that did run | 13 |
Code lines that did not run | 6 |
Coverage (did run/can run) | 68.42 % |
Function listing
time calls line
148 function t = affine( varargin )
149
150 % Build an affine TFORM struct.
151
0.02 1721 152 msgstruct = nargchk(1,2,nargin,'struct'); %#ok<NCHK>
0.03 1721 153 if ~isempty(msgstruct)
154 error(message('images:maketform:invalidNumInputsForAffine', msgstruct.message));
155 end
156
1721 157 if nargin == 2
158 % Construct a 3-by-3 2-D affine transformation matrix A
159 % that maps the three points in X to the three points in U.
160 U = varargin{1};
161 X = varargin{2};
162 A = construct_matrix( U, X, 'affine' );
163 A(:,3) = [0 0 1]'; % Clean up noise before validating A.
1721 164 else
1721 165 A = varargin{1};
1721 166 end
0.40 1721 167 A = validate_matrix( A, 'affine' );
168
1721 169 N = size(A,2) - 1;
0.02 1721 170 tdata.T = A;
0.10 1721 171 tdata.Tinv = inv(A);
172
173 % In case of numerical noise, coerce the inverse into the proper form.
0.02 1721 174 tdata.Tinv(1:end-1,end) = 0;
0.02 1721 175 tdata.Tinv(end,end) = 1;
176
0.18 1721 177 t = assigntform(N, N, @fwd_affine, @inv_affine, tdata);
Other subfunctions in this file are not included in this listing.