On 06/04/2014 11:55 AM, Ralf Hemmecke wrote:
> Waldek,
> 
> What type do you expect p1u and p2u to have in your test?
> 
> https://github.com/fricas/fricas/blob/master/src/input/pgcd.input#L16
> 
> Ralf
> 
> 
> (1) -> p1:=x*(y+1)
> 
>    (1)  x y + x
>                                                     Type:
> Polynomial(Integer)
> (2) -> p2:=y+1
> 
>    (2)  y + 1
>                                                     Type:
> Polynomial(Integer)
> (3) -> pu1 := univariate(p1,x)
> 
>    (3)  (y + 1)?
>                         Type:
> SparseUnivariatePolynomial(Polynomial(Integer))
> (4) -> p2u := univariate(p2, x)
> 
>    (4)  y + 1
>                         Type:
> SparseUnivariatePolynomial(Polynomial(Integer))
> (5) -> gcd(pu1,pu2)
> 
>    (5)  1
>                         Type:
> SparseUnivariatePolynomial(Polynomial(Integer))
> (6) -> gcd(p1,p2)
> 
>    (6)  y + 1
>                                                     Type:
> Polynomial(Integer)
> 

Actually, I don't understand why (5) returns 1, since we have

(9) -> Polynomial Integer has GcdDomain

   (9)  true

and AFAIU the code, this is what triggers recursive calls as in the
following.

Ralf

(1) -> Uy ==> UnivariatePolynomial('y, Integer)
                                                                   Type:
Void
(2) -> Uyx ==> UnivariatePolynomial('x, Uy)
                                                                   Type:
Void
(3) -> p1: Uyx := x*(y+1)

   (3)  (y + 1)x
                Type:
UnivariatePolynomial(x,UnivariatePolynomial(y,Integer))
(4) -> p2:Uyx := y+1

   (4)  y + 1
                Type:
UnivariatePolynomial(x,UnivariatePolynomial(y,Integer))
(5) -> gcd(p1,p2)

   (5)  y + 1
                Type:
UnivariatePolynomial(x,UnivariatePolynomial(y,Integer))
(6) -> pu1 := univariate p1

   (6)  (y + 1)?
            Type:
SparseUnivariatePolynomial(UnivariatePolynomial(y,Integer))
(7) -> pu2 := univariate p2

   (7)  y + 1
            Type:
SparseUnivariatePolynomial(UnivariatePolynomial(y,Integer))
(8) -> gcd(pu1,pu2)

   (8)  y + 1
            Type:
SparseUnivariatePolynomial(UnivariatePolynomial(y,Integer))

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to