Artifact 05f903f6f654fb66883962d019baa48dcbba352d33f9c304b05248e1f5afe757:
- Executable file
r37/packages/dipoly/dipprint.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1210) [annotate] [blame] [check-ins using] [more...]
module dipprint; %/* printing routines for distributive polynomials*/ %/*Authors: R. Gebauer, A. C. Hearn, H. Kredel*/ fluid '(dipvars!*); expr procedure diplprint u; % /* Prints a list of distributive polynomials using dipprint*/ for each v in u do dipprint v; expr procedure dipprint u; % /* Prints a distributive polynomial in infix form*/ <<terpri(); dipprint1(u,nil); terpri(); terpri()>>; expr procedure dipprint1(u,v); % /* Prints a distributive polynomial in infix form. % U is a distributive form. V is a flag which is true if a term % has preceded current form*/ if dipzero!? u then if null v then dipprin2 0 else nil else begin scalar bool,w; w := diplbc u; if bcminus!? w then <<bool := t; w := bcneg w>>; if bool then dipprin2 " - " else if v then dipprin2 " + "; (if not bcone!? w or evzero!? x then <<bcprin w; dipevlpri(x,t)>> else dipevlpri(x,nil)) where x = dipevlmon u; dipprint1(dipmred u,t) end; expr procedure dipprin2 u; % /* Prints u, preceding by two EOL's if we have reached column 70*/ <<if posn()>69 then <<terpri(); terpri()>>; prin2 u>>; endmodule; end;