This is a static copy of a profile reportHome
build_thought (1 call, 0.531 sec)
Generated 15-Mar-2007 12:02:07 using real time.
M-function in file c:\mind07\build_thought.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Function Name | Function Type | Calls |
think1 | M-function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
5 | load C:\mind_data06 ; | 1 | 0.500 s | 94.1% |  |
13 | theme=THEMES{1,number,:}; | 1 | 0.016 s | 2.9% |  |
8 | [L1,L2,L3,L4]=get_levels(G); | 1 | 0.016 s | 2.9% |  |
71 | n=length(sampl1)+length(sampl2... | 1 | 0.000 s | 0.0% |  |
59 | prob_germ4=1./[1:1];prob_germ4... | 1 | 0.000 s | 0.0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.531 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
get_levels | M-function | 1 | 0.016 s | 2.9% |  |
select | M-function | 9 | 0 s | 0% |  |
set_gs_in_mods | M-function | 1 | 0 s | 0% |  |
intersect | M-function | 4 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.516 s | 97.1% |  |
Totals | | | 0.531 s | 100% | |
M-Lint results
Line number | Message |
13 | Variable 'THEMES' is used, but apparently is never set. |
19 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
24 | The value assigned here to variable 'level' might never be used. |
35 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
47 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
59 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
72 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
74 | Terminate statement with semicolon to suppress output. |
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 83 |
Non-code lines (comments, blank lines) | 31 |
Code lines (lines that can run) | 52 |
Code lines that did run | 43 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 82.69 % |
Function listing
time calls line
1 function [content,connector,Q_theme,number]=build_thought
2 % computes new thought from scratch according to Patterns of Thought
3 %executes theme driven associations
4 %NOTE: "connection_regular_new" has not yet been included
0.50 1 5 load C:\mind_data06 ;
6
7 %find gnerators in various levels
0.02 1 8 [L1,L2,L3,L4]=get_levels(G);
9
10 %select theme
11
1 12 number=select(ones(1,11)./11);
0.02 1 13 theme=THEMES{1,number,:};
14 %find generators in "theme"
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;
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
4 29 sample1=[sample1,select(Q1./sum(Q1))];
4 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
41 sample2=[sample2,select(Q2./sum(Q2))];
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)
64 for k=1:n_germ4
65 sample4=[sample4,select(Q4./sum(Q4))];
66 end
67 sampl4=gs4(sample4);
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