loop_summary

PURPOSE ^

LOOP_SUMMARY Compute the counts of a feedback loop list

SYNOPSIS ^

function[tab]=loop_summary(fbl_loop_tab,col_val)

DESCRIPTION ^

 LOOP_SUMMARY Compute the counts of a feedback loop list

 The loop list could be output e.g. from find_loops() and should be a
 table with columns named 'length' and 'sign' that are used to determine
 the counts.

 TAB = LOOP_SUMMARY(LOOP_LIST) returns a table TAB with the counts of the loops
 in  LOOP_LIST subdivided in three rows capturing
 the sign of the loops (all, positive, negative) and their
 lengths (1 to maximal length) in the columns

 TAB = LOOP_SUMMARY(LOOP_LIST,COL_VAL) allows for choosing the
 value that is spread over the columns. For COL_VAL being 'length', the
 same output as above is obtained, for COL_VAL being 'sign', the table is
 transposed.

 See also: find_loops(), find_loops_noscc(), find_loops_vset()

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function[tab]=loop_summary(fbl_loop_tab,col_val)
0002 % LOOP_SUMMARY Compute the counts of a feedback loop list
0003 %
0004 % The loop list could be output e.g. from find_loops() and should be a
0005 % table with columns named 'length' and 'sign' that are used to determine
0006 % the counts.
0007 %
0008 % TAB = LOOP_SUMMARY(LOOP_LIST) returns a table TAB with the counts of the loops
0009 % in  LOOP_LIST subdivided in three rows capturing
0010 % the sign of the loops (all, positive, negative) and their
0011 % lengths (1 to maximal length) in the columns
0012 %
0013 % TAB = LOOP_SUMMARY(LOOP_LIST,COL_VAL) allows for choosing the
0014 % value that is spread over the columns. For COL_VAL being 'length', the
0015 % same output as above is obtained, for COL_VAL being 'sign', the table is
0016 % transposed.
0017 %
0018 % See also: find_loops(), find_loops_noscc(), find_loops_vset()
0019 
0020 if nargin<2
0021     col_val='length';
0022 end
0023 
0024 %maximal loop length
0025 max_loop_length=max(fbl_loop_tab.length);
0026 tab=zeros(3,max_loop_length);
0027 
0028 
0029 %for each loop length
0030 for i=1:max_loop_length
0031     tab(2,i)=sum(fbl_loop_tab.sign(fbl_loop_tab.length==i)==-1); %negative loops of length i
0032     tab(3,i)=sum(fbl_loop_tab.sign(fbl_loop_tab.length==i)==1);%positive loops of length i
0033     tab(1,i)=sum(fbl_loop_tab.length==i); %total loops of length i
0034 end
0035 %generate length description
0036 for k = 1:max_loop_length
0037     col_name_tab{k} = sprintf('%s_%d','length',k);
0038 end
0039 
0040 if strcmp(col_val,'length') %variables will be length
0041     tab=array2table(int64(tab),'VariableNames',col_name_tab,'RowNames',{'total' 'negative' 'positive'});
0042 end
0043 if strcmp(col_val,'sign') %variable will be sign
0044     tab=array2table(int64(tab'),'VariableNames',{'total' 'negative' 'positive'},'RowNames',col_name_tab);
0045 end
0046 
0047 end
0048

Generated on Wed 24-Jun-2020 09:38:33 by m2html © 2005