This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
slvblkfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
62
nbo = nb;
4040.010 s25.0%
29
blocks = reshape(blokmat(3+2*n...
4040.010 s25.0%
26
rows = blokmat(2+(1:nb));
4040.010 s25.0%
63
end
4040 s0%
61
else
4040 s0%
All other lines  0.010 s25.0%
Totals  0.040 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function63
Non-code lines (comments, blank lines)26
Code lines (lines that can run)37
Code lines that did run10
Code lines that did not run27
Coverage (did run/can run)27.03 %
Function listing
   time   calls  line
1 function [nbo,rows,ncols,last,blocks] = bkbrk(blokmat)
2 %BKBRK Part(s) of an almost block-diagonal matrix.
3 %
4 % [NB,ROWS,NCOLS,LAST,BLOCKS] = BKBRK(BLOKMAT)
5 %
6 % returns the details of the almost block diagonal matrix contained
7 % in BLOKMAT, with ROWS and LAST NB-vectors, and BLOCKS a matrix
8 % of size SUM(ROWS)-by-NCOLS.
9 %
10 % BKBRK(BLOKMAT)
11 %
12 % returns nothing, but all parts are printed.
13 %
14 % See also SPCOL, SLVBLK.
15
16 % Copyright 1987-2010 The MathWorks, Inc.
17 % $Revision: 1.1.6.2 $
18
404 19 if blokmat(1)==41 % data type number for the spline block format is 41
20 % Here are the details of this particular sparse format:
21 % The matrix is sum(ROWS)-by-sum(LAST).
22 % There are NB blocks. The i-th block has ROWS(i) rows and NCOLS columns.
23 % The first column of the (i+1)st block is exactly LAST(i) columns to the
24 % right of the first column of the i-th block.
404 25 nb = blokmat(2);
0.01 404 26 rows = blokmat(2+(1:nb));
404 27 ncols = blokmat(2+nb+1);
404 28 last = blokmat(3+nb+(1:nb));
0.01 404 29 blocks = reshape(blokmat(3+2*nb+(1:sum(rows)*ncols)),sum(rows),ncols);
30
31 elseif blokmat(1)==40 % data type number for general almost block diagonal
32 % format is 40;
33 nb = blokmat(2);
34 rows = blokmat(2+(1:nb));
35 cols = blokmat(2+nb+(1:nb));
36 last = blokmat(2+2*nb+(1:nb));
37 row = cumsum([0,rows]);
38 ne = sum(rows);ncols = max(cols);
39 len = rows.*cols;
40 index = cumsum([2+3*nb len]);
41 blocks = zeros(ne,ncols);
42 for j=1:nb
43 block = reshape(blokmat(index(j)+(1:len(j))),rows(j),cols(j));
44 blocks(row(j)+(1:row(j+1)),(1:cols(j))) = block;
45 end
46 else
47 error(message('SPLINES:BKBRK:unknownarg'))
48 end
49
404 50 if nargout==0 % print out the blocks
51 if blokmat(1)==41 % generate COLS
52 temp = cumsum([0 last]); temp = temp(nb+1)-temp;
53 cols = min(temp(1:nb),ncols);
54 end
55 rowsum = cumsum([0 rows]);
56 for j=1:nb
57 fprintf( 'Block %s has %s row(s)\n', int2str(j), int2str(rows(j)) );
58 disp(blocks(rowsum(j)+(1:rows(j)),1:cols(j)))
59 fprintf( 'Next block is shifted over %s column(s)\n\n', int2str(last(j)) );
60 end
404 61 else
0.01 404 62 nbo = nb;
404 63 end