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,13 @@ ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ + ## ## Revision 1.41 1999/08/19 21:12:33 peterg + ## ## Tidied and started implementaation of vector junctions + ## ## ## ## Revision 1.40 1999/08/19 05:39:55 peterg ## ## Put into octave format ## ## ## ## Revision 1.39 1999/08/19 05:22:16 peterg ## ## To RCS prior to inplementing vector junctions @@ -231,15 +234,31 @@ ## We now have a list (comp_near_bond) of the component(s) at each end ## of each bond ## Now do a list of the bonds on each component - unsorted at this stage. ## Also expand aliases using the alias list for each component - components = []; + components = []; + i_vector=0; # Counter for vector components for i = 1:n_components ##Get component type eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); +# ## Vector 0 and 1 +# n_vector = 1; # Default to scalar component +# if (comp_type(1)=='0')||(comp_type(1)=='1') +# n_name = length(comp_type); +# if n_name>1 +# n_vector = str2num(comp_type(2:n_name)); +# endif +# endif +# n_vector + + ## Create scalar versions of vector components + for new_comp=2:n_vector + i_vector++; + endfor + ## There are n_comp_bonds bonds on this component with corresponding index [index,n_comp_bonds] = getindex(comp_near_bond,i); if index(1,1)==0 mtt_error(sprintf("Component %s (%s) has no bonds", comp_name, @@ -486,19 +505,20 @@ for i = 1:n_components disp('-----------------'); ##Get component type eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); - ##Convert junction names & get order of vector ports - + + ##Convert junction names if comp_type(1)=='0' comp_type = 'zero'; - end + endif + if comp_type(1)=='1' comp_type = 'one'; - end + endif ## Find the (unsorted) bond list on this component signed_bond_list = nozeros(components(i,:)); n_comp_bonds = length(signed_bond_list); direction = sign(signed_bond_list);