Index: mttroot/mtt/bin/trans/cse2csm_r ================================================================== --- mttroot/mtt/bin/trans/cse2csm_r +++ mttroot/mtt/bin/trans/cse2csm_r @@ -12,48 +12,67 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 1998/07/13 09:56:31 peterg +## Back under RCS for major revision +## # Revision 1.1 1996/08/25 10:13:37 peter # Initial revision # ############################################################### # Inform user -echo Creating $1_csm.r +echo Creating $1_$2.r +case $2 in + csm) + rep=cse; + ;; + scsm) + rep=scse; + ;; + *) + echo Representation must be csm or scsm; + exit +esac # Remove the old log file rm -f cse2csm_r.log # Use reduce to accomplish the transformation reduce >cse2csm_r.log << EOF in "$1_def.r"; -in "$1_cse.r"; +in "$1_$rep.r"; in "$1_cr.r"; %%in "$1_sympar.r"; OFF Echo; OFF Nat; + +% Get rid of the old mttx and u - now use mkid instead +clear MTTx, MTTu; % Find MTTA : the A matrix matrix MTTA(MTTNx,MTTNx); FOR j := 1:MTTNx DO BEGIN - xj := MTTX(j,1); + %xj := MTTX(j,1); + xj := mkid(MTTx,j); FOR i := 1:MTTNx DO MTTA(i,j) := df(MTTEdx(i,1), xj, 1); END; % Find MTTB : the B matrix matrix MTTB(MTTNx,MTTNu); FOR j := 1:MTTNu DO BEGIN - uj := MTTU(j,1); + %uj := MTTU(j,1); + uj := mkid(MTTu,j); FOR i := 1:MTTNx DO MTTB(i,j) := df(MTTEdx(i,1), uj, 1); END; % Find MTTC : the C matrix @@ -60,29 +79,31 @@ matrix MTTC(MTTNy,MTTNx); FOR i := 1:MTTNy DO FOR j := 1:MTTNx DO BEGIN - xj := MTTX(j,1); + %xj := MTTX(j,1); + xj := mkid(MTTx,j); MTTC(i,j) := df(MTTY(i,1), xj, 1); END; % Find MTTD : the D matrix matrix MTTD(MTTNy,MTTNu); FOR i := 1:MTTNy DO FOR j := 1:MTTNu DO BEGIN - xj := MTTU(j,1); - MTTD(i,j) := df(MTTY(i,1), xj, 1); + uj := MTTU(j,1); + uj := mkid(MTTu,j); + MTTD(i,j) := df(MTTY(i,1), uj, 1); END; %Substitute the ss values in "$1_sspar.r"; %Create the output file -OUT "$1_csm.r"; +OUT "$1_$2.r"; %Write out the matrices. IF MTTNx>0 THEN BEGIN write "matrix MTTE(", MTTNx, ",", MTTNx, ");"; @@ -123,11 +144,11 @@ write "MTTD(", i, ",", j, ") := ", MTTD(i,j); END; write "END;"; -SHUT "$1_csm.r"; +SHUT "$1_$2.r"; EOF # Now invoke the standard error handling. mtt_error_r cse2csm_r.log