This is a static copy of a profile report

Home

fnbrk (3 calls, 0.020 sec)
Generated 05-Nov-2014 07:53:26 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/curvefit/splines/fnbrk.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
fnvalfunction1
sp2ppfunction1
spvalfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
167
[varargout{:}] = ffbrk(fn,vara...
30.010 s50.0%
97
if ~isstruct(fn)    % this bra...
30.010 s50.0%
166
if nargin>1
30 s0%
160
case {'B-','BB'}, ffbrk = @spb...
30 s0%
159
case 'st',        ffbrk = @stb...
30 s0%
All other lines  0 s0%
Totals  0.020 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
spbrkfunction30.010 s50.0%
Self time (built-ins, overhead, etc.)  0.010 s50.0%
Totals  0.020 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function175
Non-code lines (comments, blank lines)109
Code lines (lines that can run)66
Code lines that did run13
Code lines that did not run53
Coverage (did run/can run)19.70 %
Function listing
   time   calls  line
1 function varargout = fnbrk(fn,varargin)
2 %FNBRK Name or part(s) of form.
3 %
4 % FNBRK(FN,PART) returns the specified PART of the function in FN.
5 % For most choices of PART, this is some piece of information about the
6 % function in FN. For some choices of PART, it is the form of some function
7 % related to the function in FN.
8 % If PART is a string, then only the beginning character(s) of the
9 % relevant string need be specified.
10 %
11 % Regardless of the form of FN, PART may be
12 %
13 % 'dimension' for the dimension of the function's target
14 % 'variables' for the dimension of the function's domain
15 % 'coefficients' for the coefficients in the particular form
16 % 'interval' for the basic interval of the function
17 % 'form' for the form used to describe the function in FN
18 % [A B], with A and B scalars, for getting a description of the
19 % univariate function in FN in the same form, but
20 % on the interval [A .. B], and with the basic interval
21 % changed to [A .. B]. For an m-variate function, this
22 % specification must be in the form of a cell-array
23 % with m entries of the form [A B].
24 % [] returns FN unchanged (of use when FN is an m-variate function).
25 %
26 % Depending on the form of FN, additional parts may be asked for.
27 %
28 % If FN is in B-form (or BBform, or rBform), then PART may also be
29 %
30 % 'knots' for the knot sequence
31 % 'coefficients' for the B-spline coefficients
32 % 'number' for the number of coefficients
33 % 'order' for the polynomial order of the spline
34 % 'breaks' for the corresponding break sequence
35 %
36 % If FN is in ppform (or rpform), then PART may also be
37 %
38 % 'breaks' for the break sequence
39 % 'coefficients' for the local polynomial coefficients
40 % 'pieces' for the number of polynomial pieces
41 % 'order' for the polynomial order of the spline
42 % an integer, j, for the ppform of the j-th polynomial piece
43 %
44 % If FN is in stform, then PART may also be
45 %
46 % 'centers' for the centers
47 % 'coefficients' for the coefficients
48 % 'number' for the number of coefficients
49 % 'type' for the type of stform
50 %
51 % If FN contains an m-variate tensor-product spline with m>1 and
52 % PART is not a string, then it must be a cell-array, of length m .
53 %
54 % [OUT1, ..., OUTo] = FNBRK(FN, PART1, ..., PARTi) returns, in OUTj, the part
55 % requested by PARTj, j=1:o, provided o<=i.
56 %
57 % FNBRK(FN) returns nothing, but prints the 'form' along with all the parts
58 % if available.
59 %
60 % Examples:
61 %
62 % coefs = fnbrk( fn, 'coef' );
63 %
64 % returns the coefficients (from its B-form or its ppform) of the spline
65 % in fn.
66 %
67 % p1 = fn2fm(spline(0:4,[0 1 0 -1 1]),'B-');
68 % p2 = fnrfn(spmak(augknt([0 4],4),[-1 0 1 2]),2);
69 % p1plusp2 = spmak( fnbrk(p1,'k'), fnbrk(p1,'c')+fnbrk(p2,'c') );
70 %
71 % provides the (pointwise) sum of the two functions p1 and p2 , and this
72 % works since they are both splines of the same order, with the same
73 % knot sequence, and the same target dimension.
74 %
75 % x = 1:10; y = -2:2; [xx, yy] = ndgrid(x,y);
76 % pp = csapi({x,y},sqrt((xx -4.5).^2+yy.^2));
77 % ppp = fnbrk(pp,{4,[-1 1]});
78 %
79 % gives the spline that agrees with the spline in pp on the rectangle
80 % [b4,b5] x [-1,1] , where b4, b5 are the 4th and 5th point in the
81 % break sequence for the first variable.
82 %
83 % See also SPMAK, PPMAK, RSMAK, RPMAK, STMAK, SPBRK, PPBRK, RSBRK, RPBRK, STBRK.
84
85 % Copyright 1987-2010 The MathWorks, Inc.
86 % $Revision: 1.1.6.3 $
87
3 88 if nargin>1
3 89 np = max(1,nargout); % FNBRK(FN,PART) may be part of an expression
3 90 if np <= length(varargin)
3 91 varargout = cell(1,np);
92 else
93 error(message('SPLINES:FNBRK:moreoutthanin'))
94 end
3 95 end
96
0.01 3 97 if ~isstruct(fn) % this branch should eventually be abandoned
98 switch fn(1)
99 %
100 % curves:
101 %
102 case 10, fnform = 'ppform, univariate, array format';
103 case 11, fnform = 'B-form, univariate, array format';
104 case 12, fnform = 'BBform, univariate, array format';
105 case 15, fnform = 'polynomial in Newton form';
106 %
107 % surfaces:
108 %
109 case 20, fnform = 'ppform, bivariate tensor product, array format';
110 case 21, fnform = 'B-form, bivariate tensor product, array format';
111 case 22, fnform = 'BBform, bivariate, array format';
112 case 24, fnform = 'polynomial in shifted power form, bivariate';
113 case 25, fnform = 'thin-plate spline, bivariate';
114 %
115 % matrices:
116 %
117 case 40, fnform = 'almost block diagonal form';
118 case 41, fnform = 'spline version of almost block diagonal form';
119 % 42 = 'factorization of spline version of almost block diagonal form'
120 % (not yet implemented)
121
122 %
123 % multivariate:
124 %
125 case 94, fnform = ...
126 'polynomial in shifted normalized power form, multivariate';
127 otherwise
128 error(message('SPLINES:FNBRK:unknownform'))
129 end
130
131 if nargin>1 % return some parts if possible
132 switch fn(1)
133 case 10, [varargout{:}] = ppbrk(fn,varargin{:});
134 case {11,12}, [varargout{:}] = spbrk(fn,varargin{:});
135 otherwise
136 error(message('SPLINES:FNBRK:unknownpart', fnform))
137 end
138 else % print available information
139 if nargout
140 error(message('SPLINES:FNBRK:partneeded'))
141 else
142 fprintf( 'The input describes a %s\n\n', fnform )
143 switch fn(1)
144 case 10, ppbrk(fn);
145 case {11,12}, spbrk(fn);
146 otherwise
147 fprintf('Its parts are not (yet) available.\n')
148 end
149 end
150 end
151 return
152 end
153
154 % we reach this point only if FN is a structure.
155
3 156 switch fn.form(1:2)
3 157 case 'pp', ffbrk = @ppbrk;
3 158 case 'rp', ffbrk = @rpbrk;
3 159 case 'st', ffbrk = @stbrk;
3 160 case {'B-','BB'}, ffbrk = @spbrk;
161 case 'rB', ffbrk = @rsbrk;
162 otherwise
163 error(message('SPLINES:FNBRK:unknownform'))
164 end
165
3 166 if nargin>1
0.01 3 167 [varargout{:}] = ffbrk(fn,varargin{:});
168 else
169 if nargout
170 error(message('SPLINES:FNBRK:partneeded'))
171 else
172 fprintf( 'The input describes a %s form\n\n', fn.form(1:2) )
173 ffbrk(fn)
174 end
175 end