Changeset c5a888 in git for Singular/spolys0.cc
- Timestamp:
- May 4, 1998, 7:18:23 PM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 386c6bc814514586879cb19ec90ecaa64971b294
- Parents:
- e54eb45c84188f8b4408403f6b00d223ab8140c0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/spolys0.cc
re54eb4 rc5a888 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: spolys0.cc,v 1.1 0 1998-03-18 14:28:54obachman Exp $ */4 /* $Id: spolys0.cc,v 1.11 1998-05-04 17:18:23 obachman Exp $ */ 5 5 6 6 /* … … 844 844 } 845 845 846 /*2847 * creates the last term of the S-polynomial of p1 and p2848 * in order to compute the ecart849 * do not destroy p1 and p2850 * remarks:851 * 1. the coefficient is undefined852 * 2. see above853 */854 /*855 *static poly spGSpolyLast(poly p1, poly p2)856 *{857 * poly a1 = pNext(p1), a2 = pNext(p2);858 * poly m, b, L1, L2;859 * number ta,tb,t;860 * int c;861 *862 * m = pNew();863 * b = pNew();864 * spMemcpy(m,p2);865 * spMonSub(m,p1);866 * pSetComp(b,pGetComp(p1));867 * if (a2)868 * {869 * while (pNext(a2))870 * pIter(a2);871 * }872 * if (a1)873 * {874 * while (pNext(a1))875 * pIter(a1);876 * spMemcpy(b,a1);877 * spMonAdd(b,m);878 * }879 * else880 * {881 * spShort2(b,a2,m);882 * return b;883 * }884 * if(!a2)885 * {886 * spShort1(b,a1,m);887 * return b;888 * }889 * for (; ; )890 * {891 * c = pComp0(b, a2);892 * if (c == -1)893 * {894 * spShort1(b,a1,m);895 * return b;896 * }897 * else if (c == 1)898 * {899 * spShort2(b,a2,m);900 * return b;901 * }902 * else903 * {904 * if (nIsOne(pGetCoeff(p1)))905 * {906 * if (nIsOne(pGetCoeff(p2)))907 * t = nSub(pGetCoeff(a2), pGetCoeff(a1));908 * else909 * {910 * ta = nMult(pGetCoeff(a1), pGetCoeff(p2));911 * t = nSub(ta, pGetCoeff(a2));912 * nDelete(&ta);913 * }914 * }915 * else916 * {917 * if (nIsOne(pGetCoeff(p2)))918 * {919 * ta = nMult(pGetCoeff(a2), pGetCoeff(p1));920 * t = nSub(ta, pGetCoeff(a1));921 * }922 * else923 * {924 * ta = nMult(pGetCoeff(a1), pGetCoeff(p2));925 * tb = nMult(pGetCoeff(a2), pGetCoeff(p1));926 * t = nSub(ta, tb);927 * nDelete(&tb);928 * }929 * nDelete(&ta);930 * }931 * if (!nIsZero(t))932 * {933 * nDelete(&t);934 * spShort1(b,a1,m);935 * return b;936 * }937 * nDelete(&t);938 * if (a1 != pNext(p1))939 * {940 * L1 = a1;941 * a1 = pNext(p1);942 * while (pNext(a1) != L1)943 * pIter(a1);944 * spMemcpy(b,a1);945 * spMonAdd(b,m);946 * }947 * if (a2 != pNext(p2))948 * {949 * L2 = a2;950 * a2 = pNext(p2);951 * while (pNext(a2) != L2)952 * pIter(a2);953 * }954 * }955 * }956 *}957 */958 /*2959 * creates the leading term of the S-polynomial of p1 and p2960 * and computes the ecart under the assumtion that961 * the last term of the S-polynomial is the greatest962 * do not destroy p1 and p2963 */964 /*965 *poly spGSpolyShortMora(poly p1, poly p2, int *ecart)966 *{967 * poly p, q;968 *969 * p = spGSpolyShortBba(p1, p2, ecart);970 * *ecart = 0;971 * if(p)972 * {973 * if(spNoether==NULL)974 * {975 * q = spGSpolyLast(p1, p2);976 * *ecart = pFDeg(q) - pFDeg(p);977 * pFree1(q);978 * return p;979 * }980 * if (pComp(p, spNoether) == -1)981 * {982 * pFree1(p);983 * return NULL;984 * }985 * q = spGSpolyLast(p1, p2);986 * if (pComp(q, spNoether) == -1)987 * *ecart = pFDeg(spNoether) - pFDeg(p);988 * else989 * *ecart = pFDeg(q) - pFDeg(p);990 * pFree1(q);991 * }992 * return p;993 *}994 */
Note: See TracChangeset
for help on using the changeset viewer.