=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/lib/weight,v retrieving revision 1.8 retrieving revision 1.14 diff -u -p -r1.8 -r1.14 --- OpenXM_contrib2/asir2000/lib/weight 2003/11/20 10:41:12 1.8 +++ OpenXM_contrib2/asir2000/lib/weight 2003/12/11 15:12:35 1.14 @@ -1,33 +1,135 @@ load("solve")$ load("gr")$ -def junban(A,B){ +def nonzerovec(A){ + for(I=0;IB ? -1:0))$ } def worder(A,B){ - return (A[0]B[0] ? -1:0))$ } -def wsort(A,B,C){ +def bsort(A){ - D=newvect(length(B))$ - for(I=0;I=0){ + J=-1$ + for(I=1;I<=K;I++) + if(A[I-1][0]0){ + TMP=perm(I-1,P,TMP)$ + for(J=I-1;J>=0;J--){ + T=P[I]$ + P[I]=P[J]$ + P[J]=T$ + TMP=perm(I-1,P,TMP)$ + T=P[I]$ + P[I]=P[J]$ + P[J]=T$ + } + + return TMP$ + } + else{ + for(TMP0=[],K=0;K