This is a static copy of a profile report

Home

conn_comp (4 calls, 0.000 sec)
Generated 15-Mar-2007 12:01:54 using real time.
M-function in file c:\mind07\conn_comp.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
dom_thoughtM-function4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
55
v=h;
20.000 s72.6%
46
i=i+1;
80.000 s7.5%
12
if m~=n 'Not a Square Matrix',...
40.000 s5.3%
39
i=1;
20.000 s3.9%
52
j=j+1;
50.000 s3.7%
Other lines & overhead  0 s0%
Totals  0.000 s100% 
Children (called functions)
No children
M-Lint results
Line numberMessage
2WARNING('OFF',msgID) is faster than WARNING('OFF'). Search the MATLAB documentation for 'message identifiers'.
12Use newline, semicolon, or comma before this statement.
12Terminate statement with semicolon to suppress output.
17Use newline, semicolon, or comma before this statement.
20'>' produces a value that appears to be unused.
20The variable 'ans' can apparently be used before it is defined.
20Using ANS as a variable is not recommended as ANS is frequently overwritten by MATLAB.
20Use newline, semicolon, or comma before this statement.
26Use newline, semicolon, or comma before this statement.
31'>' produces a value that appears to be unused.
31Using ANS as a variable is not recommended as ANS is frequently overwritten by MATLAB.
31Use newline, semicolon, or comma before this statement.
34'>' produces a value that appears to be unused.
34Using ANS as a variable is not recommended as ANS is frequently overwritten by MATLAB.
36Use newline, semicolon, or comma before this statement.
36Using ANS as a variable is not recommended as ANS is frequently overwritten by MATLAB.
36Using ANS as a variable is not recommended as ANS is frequently overwritten by MATLAB.
Coverage results
[ Show coverage for parent directory ]
Total lines in file56
Non-code lines (comments, blank lines)20
Code lines (lines that can run)36
Code lines that did run36
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [c,v] = conn_comp(a,tol)
4 2 warning off
3 % Finds the strongly connected sets of vertices
4 % in the DI-rected G-raph of A
5 % c = 0-1 matrix displaying accessibility
6 % v = displays the equivalent classes
7
8 %make symmetric
4 9 a=(a+a')/2;
10
< 0.01 4 11 [m,n] = size(a);
< 0.01 4 12 if m~=n 'Not a Square Matrix', return, end
4 13 b=abs(a); o=ones(size(a)); x=zeros(1,n);
14 %msg='The Matrix is Irreducible !';
15 %v='Connected Directed Graph !';
4 16 v=zeros(1,m);v(1,:)=1:m; %???????????????????????????????????????????????????
4 17 if (nargin==1) tol=n*eps*norm(a,'inf'); end
18
19 % Create a companion matrix
4 20 b>tol*o; c=ans; if (c==o) return, end
21 % Compute accessibility in at most n-step paths
4 22 for k=1:n
16 23 for j=1:n
68 24 for i=1:n
25 % If index i accesses j, where can you go ?
304 26 if c(i,j) > 0 c(i,:) = c(i,:)+c(j,:); end
304 27 end
68 28 end
16 29 end
30 % Create a 0-1 matrix with the above information
4 31 c>zeros(size(a)); c=ans; if (c==o) return, end
32
33 % Identify equivalence classes
2 34 d=c.*c'+eye(size(a)); d>zeros(size(a)); d=ans;
2 35 v=zeros(size(a));
2 36 for i=1:n find(d(i,:)); ans(n)=0; v(i,:)=ans; end
37
38 % Eliminate displaying of identical rows
< 0.01 2 39 i=1;
2 40 while(i<n)
8 41 for k=i+1:n
20 42 if v(k,1) == v(i,1)
9 43 v(k,:)=x;
9 44 end
20 45 end
< 0.01 8 46 i=i+1;
8 47 end
< 0.01 2 48 j=1;
2 49 for i=1:n
10 50 if v(i,1)>0
5 51 h(j,:)=v(i,:);
< 0.01 5 52 j=j+1;
< 0.01 5 53 end
10 54 end
< 0.01 2 55 v=h;
56 %end