This is a static copy of a profile report

Home

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

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
3
load('C:\mind_data06');
189.125 s99.5%
4
gs=set_gs_in_mods(theme,gs_in_...
180.031 s0.3%
19
end
110.016 s0.2%
15
to_g_ups=[];
120.000 s0.0%
8
content=[1,g];
60.000 s0.0%
Other lines & overhead  0 s0%
Totals  9.172 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
set_gs_in_modsM-function180.031 s0.3%
timercbM-function20.016 s0.2%
selectM-function260 s0%
ismemberM-function30 s0%
Self time (built-ins, overhead, etc.)  9.125 s99.5%
Totals  9.172 s100% 
M-Lint results
Line numberMessage
4Variable 'gs_in_mod' is used, but apparently is never set.
11Use of brackets [] is unnecessary. Use parentheses to group, if needed.
11The value assigned here to variable 'h' might never be used.
13Variable 'mod_transfer_inv' is used, but apparently is never set.
47Use && instead of & as the AND operator in (scalar) conditional statements.
47Variable 'mod_transfer' is used, but apparently is never set.
Coverage results
[ Show coverage for parent directory ]
Total lines in file53
Non-code lines (comments, blank lines)6
Code lines (lines that can run)47
Code lines that did run46
Code lines that did not run1
Coverage (did run/can run)97.87 %
Function listing
   time   calls  line
1 function [content,connector]=add_generator_up_Q(content,connector,theme)
2 %executes theme driven thinking upwards ideas
9.13 18 3 load('C:\mind_data06');
0.03 18 4 gs=set_gs_in_mods(theme,gs_in_mod);
18 5 Q(gs)=100000;
18 6 if isempty(content)
6 7 Q=Q./sum(Q);g=select(Q);
< 0.01 6 8 content=[1,g];
12 9 else
10 %select one of the gens in "content"
12 11 n=length(content(:,1));i=select([1:n]./n);h=content(i,1);g=content(i,2);...
< 0.01 12 12 mod=g_mod(g);
12 13 mod_ups=mod_transfer_inv{mod};
< 0.01 12 14 n_mod_ups=length(mod_ups);
< 0.01 12 15 to_g_ups=[];
16 %find generators up from which connection may be created
12 17 for m=1:n_mod_ups
11 18 to_g_ups=[to_g_ups,gs_in_mod{mod_ups(m)}];
0.02 11 19 end
20 %now try to connect up to each of these gens
< 0.01 12 21 n_to_g_ups=length(to_g_ups);
< 0.01 12 22 probs=[];
12 23 if isempty(to_g_ups)
4 24 return
8 25 else
8 26 end
27
8 28 for nu=1:n_to_g_ups
26 29 prob=Q(to_g_ups(nu))*mu/(n+1);prob= prob*A(g,to_g_ups(nu))^(1/T);probs=[probs,prob];
26 30 end
8 31 probs=[probs,1];
8 32 probs=probs./sum(probs);
8 33 nu=select(probs);
8 34 if nu==n_to_g_ups+1
4 35 return
36 end
4 37 new_h=max(content(:,1))+1;
< 0.01 4 38 g_to=to_g_ups(nu);
< 0.01 4 39 mod1=g_mod(g_to);
4 40 for j=1:3
< 0.01 12 41 h=content(i,1);
12 42 if isempty(connector)
2 43 connector=[connector;[new_h,h,j]];
10 44 else
10 45 is_old=any((connector(:,1)==new_h)&(connector(:,2)==h));
10 46 is_old=is_old|any((connector(:,1)==new_h)&(connector(:,3)==j));
10 47 if (~is_old)&ismember(mod,mod_transfer{mod1,j});
2 48 connector=[connector;[new_h,h,j]];
2 49 end
10 50 end
12 51 end
4 52 content=[content;[new_h,g_to]];
4 53 end