Annotation of OpenXM/src/k097/junk.k, Revision 1.1
1.1 ! maekawa 1: def Init_w(f,vars,weight) {
! 2: local w,top,ans,wtop;
! 3: if (f == Poly("0")) return( Poly("0") );
! 4: top = sm1(f, " init ");
! 5: w = Exponent(top,vars) * weight ;
! 6: wtop = w;
! 7: ans = top;
! 8: f = f-top;
! 9: while(true) {
! 10: if ( f == Poly("0")) sm1(" exit ");
! 11: top = sm1(f, " init ");
! 12: w = Exponent(top,vars) * weight ;
! 13: if (w < wtop) sm1(" exit ");
! 14: ans = ans + top;
! 15: f = f-top;
! 16: /* Println(ans); */
! 17: }
! 18: return(ans);
! 19: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>