Artifact 4748e38061b5d4c06410edfa080a276f99fa99ece3ccffdef8f10cacab3c4d4a:
- Executable file
r37/lisp/csl/html/r37_0151.html
— 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: 2638) [annotate] [blame] [check-ins using] [more...]
<A NAME=FACTORIZE> <TITLE>FACTORIZE</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>FACTORIZE</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P> <P> <P> <P> The <em>factorize</em> operator factors a given expression into a list of {factor,power} pairs. <P> <H3> syntax: </H3> <P> <P> <em>factorize</em>(<expression>) <P> <P> <P> <expression> should be a polynomial, otherwise an error will result. <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> fff := factorize(x^3 - y^3); 2 2 {{X + X*Y + Y ,1},{X - Y,1}} fac1 := first fff; 2 2 FAC1 := {{X + X*Y + Y ,1} factorize(x^15 - 1); 8 7 6 5 4 {{ X - X + X - X + X - X + 1,1}, 4 3 2 {X + X + X + X + 1,1}, 2 {X + X + 1,1}, {X - 1,1}} lastone := part(ws,length ws); LASTONE := {X - 1,1} setmod 2; 1 on modular; factorize(x^15 - 1); 4 3 2 {{X + X + X + X + 1,1}, 4 3 {X + X + 1,1}, 4 {X + X + 1,1}, 2 { X + X + 1,1}, {X + 1,1}} </TT></PRE><P>The <em>factorize</em> command returns the factor,power pairs as a <A HREF=r37_0053.html>list</A>. You can therefore use the usual list access methods ( <A HREF=r37_0046.html>first</A>, <A HREF=r37_0063.html>second</A>, <A HREF=r37_0066.html>third</A>, <A HREF=r37_0057.html>rest</A>, <A HREF=r37_0157.html>length</A> and <A HREF=r37_0169.html>part</A>) to extract these pairs. <P> <P> If the <expression> given to <em>factorize</em> is an integer, it will be factored into its prime components. To factor any integer factor of a non-numerical expression, the switch <A HREF=r37_0296.html>ifactor</A> should be turned on. Its default is off. <A HREF=r37_0296.html>ifactor</A> has effect only when factoring is explicitly done by <em>factorize</em>, not when factoring is automatically done with the <A HREF=r37_0287.html>factor</A> switch. If full factorization is not needed the switch <A HREF=r37_0301.html>limitedfactors</A> allows you to reduce the computing time of calls to <em>factorize</em>. <P> <P> Factoring can be done in a modular domain by calling <em>factorize</em> when <A HREF=r37_0305.html>modular</A> is on. You can set the modulus with the <A HREF=r37_0104.html>setmod</A> command. The last example above shows factoring modulo 2. <P> <P> For general comments on factoring, see comments under the switch <A HREF=r37_0287.html>factor</A>. <P> <P> <P>