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);
|
︙ | | | ︙ | |