spielwiese
Last change
on this file since f7a975 was
a4081e5,
checked in by Hans Schoenemann <hannes@…>, 13 years ago
|
polys1.cc removed, p_Invers, p_Series ->monomials/p_polys.cc
|
-
Property mode set to
100644
|
File size:
940 bytes
|
Line | |
---|
1 | /*2 |
---|
2 | *returns TRUE if p1 is a skalar multiple of p2 |
---|
3 | *assume p1 != NULL and p2 != NULL |
---|
4 | */ |
---|
5 | BOOLEAN pComparePolys(poly p1,poly p2) |
---|
6 | { |
---|
7 | number n,nn; |
---|
8 | pAssume(p1 != NULL && p2 != NULL); |
---|
9 | |
---|
10 | if (!pLmEqual(p1,p2)) //compare leading mons |
---|
11 | return FALSE; |
---|
12 | if ((pNext(p1)==NULL) && (pNext(p2)!=NULL)) |
---|
13 | return FALSE; |
---|
14 | if ((pNext(p2)==NULL) && (pNext(p1)!=NULL)) |
---|
15 | return FALSE; |
---|
16 | if (pLength(p1) != pLength(p2)) |
---|
17 | return FALSE; |
---|
18 | #ifdef HAVE_RINGS |
---|
19 | if (rField_is_Ring(currRing)) |
---|
20 | { |
---|
21 | if (!nDivBy(pGetCoeff(p1), pGetCoeff(p2))) return FALSE; |
---|
22 | } |
---|
23 | #endif |
---|
24 | n=nDiv(pGetCoeff(p1),pGetCoeff(p2)); |
---|
25 | while ((p1 != NULL) /*&& (p2 != NULL)*/) |
---|
26 | { |
---|
27 | if ( ! pLmEqual(p1, p2)) |
---|
28 | { |
---|
29 | nDelete(&n); |
---|
30 | return FALSE; |
---|
31 | } |
---|
32 | if (!nEqual(pGetCoeff(p1),nn=nMult(pGetCoeff(p2),n))) |
---|
33 | { |
---|
34 | nDelete(&n); |
---|
35 | nDelete(&nn); |
---|
36 | return FALSE; |
---|
37 | } |
---|
38 | nDelete(&nn); |
---|
39 | pIter(p1); |
---|
40 | pIter(p2); |
---|
41 | } |
---|
42 | nDelete(&n); |
---|
43 | return TRUE; |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.