|
From: Bill H. <goo...@go...> - 2008-08-14 13:04:10
|
Hi Richard, Sorry I must have misunderstood what you meant when you mentioned this before. I personally don't have a problem with the extra factor, as you *have* returned factors after all. But some users may become confused by it. There are two ways to go. One is to make sure all factors are monic, then return the leading coefficient of the original polynomial as an extra unit factor (as an unsigned long). The other way is to multiply the leading coefficients of all the factors, invert the product mod p and multiply by the leading coefficient of the original polynomial and return this extra unit factor as an unsigned long. To me the former is the most logical. I think trying to get the algorithm to return the "right" factors in the first place is probably a lost cause, since this is not well-defined. Bill. To me the former makes the most sense. Bill. On 14/08/2008, Richard Howell-Peak <ric...@gm...> wrote: > I'm currently trying to fix the bug in the square_free algorithm which > results in returning factors which when multiplied together give a scalar > multiple of the original polynomial. My idea is to try and catch this > factor, and have the square-free algorithm return it as an unsigned long. > I know the input for square-free has to be monic (although I'm not entirely > sure why) so I wonder if when the recursion is called it might not be monic > and that could be causing a problem. The only other thing I could see as > being a problem is when gcd is called, is there something funny going on > since any scalar multiple of the gcd is also gcd? This shouldn't be a > problem because you divide by it anyway but I just wondered how the function > decides what polynomial to return. > > -- > Richard > |