OreTools[Euclidean] - perform right or left Euclidean algorithm
|
Calling Sequence
|
|
Euclidean['right'](Poly1, Poly2, A, 'c1', 'c2')
Euclidean(Poly1, Poly2, A, 'c1', 'c2')
Euclidean['left'](Poly1, Poly2, A, 'c1', 'c2')
|
|
Parameters
|
|
Poly1, Poly2
|
-
|
nonzero Ore polynomials; to define an Ore polynomial, use the OrePoly structure.
|
A
|
-
|
Ore algebra; to define an Ore algebra, use the SetOreRing function.
|
'c1', 'c2'
|
-
|
(optional) unevaluated names
|
|
|
|
|
Description
|
|
•
|
The Euclidean['right'](Poly1, Poly2, A) or Euclidean(Poly1, Poly2, A) calling sequence returns a list [m, S] where m is a positive integer and S is an array with m nonzero Ore polynomials such that:
|
|
In addition, Remainder['right'](S[m-1], S[m], A) = 0. S is called the right Euclidean polynomial remainder sequence of Poly1 and Poly2.
|
•
|
If the fourth argument c1 of Euclidean['right'] or Euclidean is specified, it is assigned the first co-sequence of Poly1 and Poly2 so that:
|
|
and c1[m+1] Poly1 is a least common left multiple (LCLM) of Poly1 and Poly2.
|
•
|
If the fifth argument c2 of Euclidean['right'] or Euclidean is specified, it is assigned the second co-sequence of Poly1 and Poly2 so that:
|
|
and is an LCLM of Poly1 and Poly2.
|
•
|
The Euclidean['left'](Poly1, Poly2, A) calling sequence returns a list [m, S] where m is a positive integer and S is an array with m nonzero Ore polynomials such that:
|
|
In addition, . S is called the left Euclidean polynomial remainder sequence of Poly1 and Poly2.
|
•
|
If the fourth argument c1 of Euclidean['left'] is specified, it is assigned the first co-sequence of Poly1 and Poly2 so that:
|
|
and Poly1 c1[m+1] is a least common right multiple (LCRM) of Poly1 and Poly2.
|
•
|
If the fifth argument c2 of Euclidean['left'] is is specified, it is assigned the second co-sequence of Poly1 and Poly2 so that:
|
|
and Poly1 c1[m+1]= - Poly2 c2[m+1] is an LCRM of Poly1 and Poly2.
|
|
|
Examples
|
|
Perform the right Euclidean algorithm.
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
![m := U[1]](/support/helpjp/helpview.aspx?si=7362/file02446/math285.png)
|
| (5) |
>
|
|
![vector([OrePoly(1, 3*x, x^2-1-x, 23*x+1), OrePoly(x, x, x^2+x+1), OrePoly(-x*(-x^3-49*x^2-7*x+20+x^4)/(x^2+x+1)^2, (2*x^5-17*x^4+32*x^3-14*x^2-20*x-1)/(x^2+x+1)^2), OrePoly((-5*x+981*x^2+5*x^11+598*x^9+1451*x^8+2135*x^7-200*x^10+1781*x^6+1343*x^5+1850*x^4+1420*x^3-20+x^12)/(2*x^5-17*x^4+32*x^3-14*x^2-20*x-1)^2)])](/support/helpjp/helpview.aspx?si=7362/file02446/math299.png)
| (6) |
Check the co-sequences.
>
|
![for i to m do W1 := Multiply(c1[i], Ore1, A); W2 := Multiply(c2[i], Ore2, A); W := Add(W1, W2); C := Minus(W, S[i]); print(C) end do](/support/helpjp/helpview.aspx?si=7362/file02446/math305.png)
|
| (7) |
Check the LCLM.
>
|
|
>
|
|
>
|
|
| (8) |
Perform the left Euclidean algorithm.
>
|
|
| (9) |
>
|
![m := U[1]](/support/helpjp/helpview.aspx?si=7362/file02446/math347.png)
|
| (10) |
>
|
|
![vector([OrePoly(1, 3*x, x^2-1-x, 23*x+1), OrePoly(x, x, x^2+x+1), OrePoly(-(18*x^5+99*x^4-12*x^3+x^7-1059*x^2-955*x-51)/(x^2+x+1)^3, (-21*x^4+20*x^3-17*x^2-289*x+2*x^5-136)/(x^2+x+1)^2), OrePoly((12308+39236*x+x^12+44*x^10+x^11+1037*x^8+1941*x^7+11909*x^6+556*x^9+36562*x^5+72548*x^4+88995*x^3+76169*x^2)/(-21*x^4+20*x^3-17*x^2-289*x+2*x^5-136)^2)])](/support/helpjp/helpview.aspx?si=7362/file02446/math361.png)
| (11) |
Check the co-sequences.
>
|
![for i to m do W1 := Multiply(Ore1, c1[i], A); W2 := Multiply(Ore2, c2[i], A); W := Add(W1, W2); C := Minus(W, S[i]); print(C) end do](/support/helpjp/helpview.aspx?si=7362/file02446/math367.png)
|
| (12) |
Check the LCRM.
>
|
|
>
|
|
>
|
|
| (13) |
|
|