This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
legacyM-function3
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
3
load('c:\mind_data06');
31.469 s100.0%
11
g=content(i_del,2);
30.000 s0.0%
40
l_down=length(j_down);
10.000 s0.0%
30
product=n/(mu*Q(g));
10.000 s0.0%
29
l_above=length(j_above);
10.000 s0.0%
Other lines & overhead  0 s0%
Totals  1.469 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
selectM-function40 s0%
setdiffM-function10 s0%
Self time (built-ins, overhead, etc.)  1.469 s100.0%
Totals  1.469 s100% 
M-Lint results
Line numberMessage
34Logical indexing is usually faster than FIND.
34Logical indexing is usually faster than FIND.
44Logical indexing is usually faster than FIND.
44Logical indexing is usually faster than FIND.
53Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
[ Show coverage for parent directory ]
Total lines in file59
Non-code lines (comments, blank lines)12
Code lines (lines that can run)47
Code lines that did run32
Code lines that did not run15
Coverage (did run/can run)68.09 %
Function listing
   time   calls  line
1 function [content,connector]=delete_generator_connections(content,connector)
2 %this program deletes generator and associated connections
1.47 3 3 load('c:\mind_data06');
3 4 if isempty(content)
5 return
3 6 else
3 7 n=length(content(:,1));
8 %select generator
9
3 10 i_del=select(ones(1,n)./(n));%in i-coordiantes
< 0.01 3 11 g=content(i_del,2);
3 12 if i_del>=n
2 13 return
14 end
15
1 16 if isempty(connector)
17 prob_del=(n/mu)/Q(g); %check this!
18 prob_del=prob_del/(1+prob_del);
19 if select([prob_del,1-prob_del])
20 content=content([1:i_del-1,i_del+1],:);
21 return
22 end
1 23 else
1 24 m=length(connector(:,1));
25
26 %bonds down to this generator from others above
< 0.01 1 27 h=content(i_del,1);
1 28 j_above=find(connector(:,2)==h);%in j-coordinates
< 0.01 1 29 l_above=length(j_above);
< 0.01 1 30 product=n/(mu*Q(g));
1 31 for j=1:l_above
32 j=j_above(j);h1=connector(j,1);
33 i1=find(content(:,1)==h1);i2=find(content(:,1)==h);
34 g1=content(i1,2);g2=content(i2,2);
35 product=product*(A(g1,g2))^(-1/T);
36 end
37
38 %bonds up to this generator from others below
1 39 j_down=find(connector(:,1)==h);%in j-doordinates
< 0.01 1 40 l_down=length(j_down);
1 41 for j=1:l_down
< 0.01 2 42 j=j_down(j);h2=connector(j,2);
2 43 i1=find(content(:,1)==h);i2=find(content(:,1)==h2);
2 44 g1=content(i1,2);g2=content(i2,2);
2 45 product=product*(A(g1,g2))^(-1/T);
2 46 end
47
1 48 prob_del=product;%check this!
1 49 prob_del=prob_del/(1+prob_del);
1 50 answer=select([prob_del,1-prob_del]);
1 51 if answer==1
1 52 content=content([1:i_del-1,i_del+1:n],:);
1 53 connector=connector(setdiff([1:m],[j_above',j_down']),:);
54
55 else
56 end
1 57 end
1 58 end
59