This is a static copy of a profile report

Home

build_thought_2 (1 call, 0.641 sec)
Generated 15-Mar-2007 12:01:44 using real time.
M-function in file c:\mind07\build_thought_2.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
think3M-function1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
5
load C:\mind_data06 ;
10.531 s82.9%
25
gs1=intersect(gs,L1);
10.063 s9.8%
8
[L1,L2,L3,L4]=get_levels(G);
10.031 s4.9%
15
gs=set_gs_in_mods(theme,gs_in_...
10.016 s2.4%
71
n=length(sampl1)+length(sampl2...
10.000 s0.0%
Other lines & overhead  0 s0%
Totals  0.641 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
intersectM-function40.047 s7.3%
get_levelsM-function10.031 s4.9%
selectM-function80 s0%
set_gs_in_modsM-function10 s0%
Self time (built-ins, overhead, etc.)  0.563 s87.8%
Totals  0.641 s100% 
M-Lint results
Line numberMessage
12Variable 'THEMES' is used, but apparently is never set.
19Use of brackets [] is unnecessary. Use parentheses to group, if needed.
24The value assigned here to variable 'level' might never be used.
35Use of brackets [] is unnecessary. Use parentheses to group, if needed.
47Use of brackets [] is unnecessary. Use parentheses to group, if needed.
59Use of brackets [] is unnecessary. Use parentheses to group, if needed.
72Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
[ Show coverage for parent directory ]
Total lines in file83
Non-code lines (comments, blank lines)31
Code lines (lines that can run)52
Code lines that did run48
Code lines that did not run4
Coverage (did run/can run)92.31 %
Function listing
   time   calls  line
1 function [content,connector,Q_theme]=build_thought_2
2 % computes new thought from scratch (enpty "content") according to PRINIPLES
3 %executes theme driven associations
4 %NOTE: "connection_regular_new" has not yet been included
0.53 1 5 load C:\mind_data06 ;
6
7 %find gnerators in various levels
0.03 1 8 [L1,L2,L3,L4]=get_levels(G);
9
10 %select theme
1 11 number=select(ones(1,11)./11);
1 12 theme=THEMES{1,number,:};
13
14 %find generators in "theme"
0.02 1 15 gs=set_gs_in_mods(theme,gs_in_mod);content=[];connector=[];
1 16 Q(gs)=100000;Q_theme=Q;
17
18 %thinking power defined in terms of size of "thought_germ"
1 19 prob_germ1=1./[1:4];prob_germ1=prob_germ1./sum(prob_germ1);
1 20 n_germ1=select(prob_germ1);
21
22
23 %form sample of size "n_germ" on level 1
< 0.01 1 24 level = 1;
0.06 1 25 gs1=intersect(gs,L1);
1 26 sample1=[];Q1=Q(gs1);sampl1=[];
1 27 if ~isempty(gs1)
1 28 for k=1:n_germ1
2 29 sample1=[sample1,select(Q1./sum(Q1))];
2 30 end
1 31 sampl1=gs1(sample1);
1 32 end
33
34 %now level 2
1 35 prob_germ2=1./[1:4];prob_germ2=prob_germ2./sum(prob_germ2);
1 36 n_germ2=select(prob_germ2)-1;
1 37 gs2=intersect(gs,L2);
1 38 sample2=[];Q2=Q(gs2);sampl2=[];
1 39 if ~isempty(gs2)
1 40 for k=1:n_germ2
1 41 sample2=[sample2,select(Q2./sum(Q2))];
1 42 end
1 43 sampl2=gs2(sample2);
1 44 end
45
46 %now level 3
1 47 prob_germ3=3./[1:2];prob_germ3=prob_germ3./sum(prob_germ3);
1 48 n_germ3=select(prob_germ3)-1;
1 49 gs3=intersect(gs,L3);
1 50 sample3=[];Q3=Q(gs3);sampl3=[];
1 51 if ~isempty(gs3)
1 52 for k=1:n_germ3
53 sample3=[sample3,select(Q3./sum(Q3))];
54 end
1 55 sampl3=gs3(sample3);
1 56 end
57
58 %now level 4
< 0.01 1 59 prob_germ4=1./[1:1];prob_germ4=prob_germ4./sum(prob_germ4);
1 60 n_germ4=select(prob_germ4)-1;
1 61 gs4=intersect(gs,L4);
1 62 sample4=[];Q4=Q(gs4);sampl4=[];
1 63 if ~isempty(gs4)
1 64 for k=1:n_germ4
65 sample4=[sample4,select(Q4./sum(Q4))];
66 end
1 67 sampl4=gs4(sample4);
1 68 end
69
70
< 0.01 1 71 n=length(sampl1)+length(sampl2)+length(sampl3)+length(sampl4);
1 72 content(:,1)=[1:n]';
1 73 if ~isempty(content)
1 74 content(:,2)=[sampl1,sampl2,sampl3,sampl4]';
1 75 end
76
77
78
79
80
81
82
83