Index: mttroot/mtt/bin/trans/m/rbg2abg.m ================================================================== --- mttroot/mtt/bin/trans/m/rbg2abg.m +++ mttroot/mtt/bin/trans/m/rbg2abg.m @@ -5,10 +5,14 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.38 1999/03/12 00:58:06 peterg +% %% Now gets portlist from the _abg.m file NOT the _rbg.m file +% %% - this allows expansion of vector SS ports. +% %% % %% Revision 1.37 1998/07/28 19:06:43 peterg % %% Still some bugs (vector SS ports)?? % %% % %% Revision 1.36 1998/07/28 10:30:50 peterg % %% Implemented vector SS ports. @@ -561,11 +565,11 @@ # [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list); # if m_unsorted_ports==0 # n_unsorted_ports = 0; # end; - % Junctions or no lables(order of ports unimportant) + % Junctions (order of ports unimportant) if strcmp(comp_type,'zero')|strcmp(comp_type,'one') for j = 1:n_comp_bonds components(i,j) = signed_bond_list(j); end else %Order of ports is important @@ -573,10 +577,16 @@ if n_unsorted_ports==0 mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile); end; %Write out the signed bond list in the correct order unsorted_port_list +[n_list,m_list] = size(unsorted_port_list); +if n_list!=n_comp_bonds + error(sprintf("Component %s (%s) has %i bonds but %i port lables",\ + comp_name, comp_type, n_comp_bonds, n_list)) +endif + for j = 1:n_comp_bonds j name_k = unsorted_port_list(j,:) k = name_in_list(name_k, port_list); % Check that it only appears once in port list