]>
Factored creates a domain whose objects are kept in factored form as long as possible. Thus certain operations like * (multiplication) and gcdgcdFactored are relatively easy to do. Others, such as addition, require somewhat more work, and the result may not be completely factored unless the argument domain R provides a factorfactorFactored operation. Each object consists of a unit and a list of factors, where each factor consists of a member of R (the base), an exponent, and a flag indicating what is known about the base. A flag may be one of ``nil'', ``sqfr'', ``irred'' or ``prime'', which mean that nothing is known about the base, it is square-free, it is irreducible, or it is prime, respectively. The current restriction to factored objects of integral domains allows simplification to be performed without worrying about multiplication order.
In this section we will work with a factored integer.
Let's begin by decomposing g into pieces. The only possible units for integers are 1 and -1.
There are three factors.
We can make a list of the bases, ...
and the exponents, ...
and the flags. You can see that all the bases (factors) are prime.
A useful operation for pulling apart a factored object into a list of records of the components is factorListfactorListFactored.
If you don't care about the flags, use factorsfactorsFactored.
Neither of these operations returns the unit.
Recall that we are working with this factored integer.
To multiply out the factors with their multiplicities, use expandexpandFactored.
If you would like, say, the distinct factors multiplied together but with multiplicity one, you could do it this way.
We're still working with this factored integer.
We'll also define this factored integer.
Operations involving multiplication and division are particularly easy with factored objects.
If we use addition and subtraction things can slow down because we may need to compute greatest common divisors.
Test for equality with 0 and 1 by using zero?zero?Factored and one?one?Factored, respectively.
Another way to get the zero and one factored objects is to use package calling (see ugTypesPkgCallPage in Section ugTypesPkgCallNumber ).
The mapmapFactored operation is used to iterate across the unit and bases of a factored object. See FactoredFunctionsTwoXmpPage for a discussion of mapmapFactored.
The following four operations take a base and an exponent and create a factored object. They differ in handling the flag component.
This factor has no associated information.
This factor is asserted to be square-free.
This factor is asserted to be irreducible.
This factor is asserted to be prime.
A partial inverse to factorListfactorListFactored is makeFRmakeFRFactored.
The first argument is the unit and the second is a list of records as returned by factorListfactorListFactored.
Some of the operations available for polynomials are also available for factored polynomials.
You can differentiate with respect to a variable.