Overview
Comment:Fixed sorting bug: now puts the jth component from the unsorted list
into the kth component of the sorted list .. not vice versa!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 518cabdfbde9cd430a2d26b927af2fc020f526c815e1b69df325444475818d96
User & Date: gawthrop@users.sourceforge.net on 1997-08-07 16:12:36
Other Links: branch diff | manifest | tags
Context
1997-08-08
08:11:04
Suppress compoment trace. check-in: 96d016903b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-08-07
16:12:36
Fixed sorting bug: now puts the jth component from the unsorted list
into the kth component of the sorted list .. not vice versa!
check-in: 518cabdfbd user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:10:13
Move the if status .. to the beginning of the main loop. check-in: cf8931efd8 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [308be301b1] to [590cc1717c].

1
2
3
4
5
6
7





8
9
10
11
12
13
14
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$





% %% Revision 1.14  1997/08/04 14:18:55  peterg
% %% If no ports labels at all, just use the default component list.
% %%
% %% Revision 1.13  1997/08/04 12:50:39  peterg
% %% Many bug fixes to the named port version + tied up the logic and
% %% supporting comments.
% %%







>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.15  1997/08/06  21:43:19  peterg
% %% Corrected error in creating component list: the kth component of the
% %% list is given by the jth component of the original list NOT vice
% %% versa.
% %%
% %% Revision 1.14  1997/08/04 14:18:55  peterg
% %% If no ports labels at all, just use the default component list.
% %%
% %% Revision 1.13  1997/08/04 12:50:39  peterg
% %% Many bug fixes to the named port version + tied up the logic and
% %% supporting comments.
% %%
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;
    end;

    % One port defaults:
    if (n_comp_ports==1)&(n_unsorted_ports==0)
      if direction(1)<0 % Wrong way for default
        mtt_info(['One-port ', comp_name, ' (', comp_type, ') has the sign pointing the wrong way '], infofile);
      end;
      unsorted_port_list = port_list;
    end;
    
    %Two port defaults
    if (n_comp_ports==2)&(n_unsorted_ports==0)







|







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;
    end;

    % One port defaults:
    if (n_comp_ports==1)&(n_unsorted_ports==0)
      if (direction(1)<0) & ~strcmp(comp_type,'SS') % Wrong way for default
        mtt_info(['One-port ', comp_name, ' (', comp_type, ') has the sign pointing the wrong way '], infofile);
      end;
      unsorted_port_list = port_list;
    end;
    
    %Two port defaults
    if (n_comp_ports==2)&(n_unsorted_ports==0)
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
    % Recompute the number of unsorted ports
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;
    end;
    
    % Junctions or no lables(order of ports unimportant)
    if (comp_type=='zero')|(comp_type=='one')
      for j = 1:n_comp_ports
        components(i,j) = signed_bond_list(j);
      end
    else %Order of ports is important
      unsorted_port_list, port_list
      if n_unsorted_ports==0
        mtt_info(['Component ', comp_name, ' (', comp_type, ') has no labeled ports:  '], infofile); 







|







227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
    % Recompute the number of unsorted ports
    [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
    if m_unsorted_ports<2
      n_unsorted_ports = 0;
    end;
    
    % Junctions or no lables(order of ports unimportant)
    if strcmp(comp_type,'zero')|strcmp(comp_type,'one')
      for j = 1:n_comp_ports
        components(i,j) = signed_bond_list(j);
      end
    else %Order of ports is important
      unsorted_port_list, port_list
      if n_unsorted_ports==0
        mtt_info(['Component ', comp_name, ' (', comp_type, ') has no labeled ports:  '], infofile); 
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267

        if k==0
          mtt_info(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], infofile); 
        else
          components(i,k) = signed_bond_list(j);     
        end;
      end;
      disp(comp_name);
      components(i,:),signed_bond_list
    end;
  end;
end;


% Deduce causality from the strokes (if any).
causality = zeros(n_bonds,2);







<
<







257
258
259
260
261
262
263


264
265
266
267
268
269
270

        if k==0
          mtt_info(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], infofile); 
        else
          components(i,k) = signed_bond_list(j);     
        end;
      end;


    end;
  end;
end;


% Deduce causality from the strokes (if any).
causality = zeros(n_bonds,2);


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]