Changeset aaeb98 in git
 Timestamp:
 Oct 8, 2009, 10:38:31 AM (15 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '45e267b9942dec9429fe249ce3e5e44ab80a6a3a')
 Children:
 967a9d48cc1d702f106bf47d327d87adbaf6833c
 Parents:
 bedecea1bbe3e8a1d0e5a820d4d446733ede75b9
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/longalg.cc
rbedece raaeb98 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.5 4 20091008 08:30:14Singular Exp $ */4 /* $Id: longalg.cc,v 1.55 20091008 08:38:31 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 31 31 napoly naMinimalPoly; 32 32 #define naParNames (currRing>parameter) 33 #define napNormalize(p) p_Normalize(p,nacRing)34 33 static int naIsChar0; 35 34 static ring naMapRing; … … 219 218 qq = (napoly)p_Init(nacRing); 220 219 pNext(qq) = NULL; 221 napNormalize(g);222 napNormalize(f);220 p_Normalize(g, nacRing); 221 p_Normalize(f, nacRing); 223 222 a = f; 224 223 do … … 231 230 h = napCopy(g); 232 231 napMultT(h, qq); 233 napNormalize(h);232 p_Normalize(h,nacRing); 234 233 nacDelete(&pGetCoeff(qq),nacRing); 235 234 a = napAdd(a, h); … … 249 248 qq = (napoly)p_Init(nacRing); 250 249 pNext(qq) = b = NULL; 251 napNormalize(g);252 napNormalize(f);250 p_Normalize(g,nacRing); 251 p_Normalize(f,nacRing); 253 252 a = f; 254 253 do … … 262 261 h = napCopy(g); 263 262 napMultT(h, qq); 264 napNormalize(h);263 p_Normalize(h,nacRing); 265 264 nacDelete(&pGetCoeff(qq),nacRing); 266 265 a = napAdd(a, h); … … 312 311 napMultN(qa, t); 313 312 nacDelete(&t,nacRing); 314 napNormalize(qa);313 p_Normalize(qa,nacRing); 315 314 p_Delete(&x,nacRing); 316 315 p_Delete(&r,nacRing); … … 331 330 t = nacInvers(pGetCoeff(r)); 332 331 napMultN(q, t); 333 napNormalize(q);332 p_Normalize(q,nacRing); 334 333 nacDelete(&t,nacRing); 335 334 p_Delete(&x,nacRing); … … 360 359 //nacNormalize(t); 361 360 napMultN(q, t); 362 napNormalize(q);361 p_Normalize(q,nacRing); 363 362 nacDelete(&t,nacRing); 364 363 p_Delete(&x,nacRing); … … 1662 1661 { 1663 1662 if (pNext(x>z)!=NULL) 1664 result>z = napCopy(x>z);1663 result>z = p_Copy(x>z, r>algring); 1665 1664 else 1666 1665 result>z = napGcd0(x>z, y>z); … … 1677 1676 napoly rz=napGcd(x>z, y>z); 1678 1677 CanonicalForm F, G, R; 1679 R=convSingPFactoryP(rz, nacRing);1680 napNormalize(x>z);1681 F=convSingPFactoryP(x>z, nacRing)/R;1682 napNormalize(y>z);1683 G=convSingPFactoryP(y>z, nacRing)/R;1678 R=convSingPFactoryP(rz,r>algring); 1679 p_Normalize(x>z,nacRing); 1680 F=convSingPFactoryP(x>z,r>algring)/R; 1681 p_Normalize(y>z,nacRing); 1682 G=convSingPFactoryP(y>z,r>algring)/R; 1684 1683 F = gcd( F, G ); 1685 1684 if (F.isOne()) … … 1687 1686 else 1688 1687 { 1689 p_Delete(&rz, nacRing);1690 result>z=convFactoryPSingP( F*R, nacRing );1691 napNormalize(result>z);1688 p_Delete(&rz,r>algring); 1689 result>z=convFactoryPSingP( F*R,r>algring ); 1690 p_Normalize(result>z,nacRing); 1692 1691 } 1693 1692 } … … 1979 1978 naTest(la); 1980 1979 naTest(lb); 1981 napoly x = napCopy(a>z);1980 napoly x = p_Copy(a>z, r>algring); 1982 1981 number t = napLcm(b>z); // get all denom of b>z 1983 1982 if (!nacIsOne(t)) 1984 1983 { 1985 number bt, r ;1984 number bt, rr; 1986 1985 napoly xx=x; 1987 1986 while (xx!=NULL) 1988 1987 { 1989 bt = nacGcd(t, pGetCoeff(xx), nacRing);1990 r = nacMult(t, pGetCoeff(xx));1991 nacDelete(&pGetCoeff(xx), nacRing);1992 pGetCoeff(xx) = nacDiv(r , bt);1988 bt = nacGcd(t, pGetCoeff(xx), r>algring); 1989 rr = nacMult(t, pGetCoeff(xx)); 1990 nacDelete(&pGetCoeff(xx),r>algring); 1991 pGetCoeff(xx) = nacDiv(rr, bt); 1993 1992 nacNormalize(pGetCoeff(xx)); 1994 nacDelete(&bt, nacRing);1995 nacDelete(&r ,nacRing);1993 nacDelete(&bt,r>algring); 1994 nacDelete(&rr,r>algring); 1996 1995 pIter(xx); 1997 1996 } 1998 1997 } 1999 nacDelete(&t, nacRing);1998 nacDelete(&t,r>algring); 2000 1999 result>z = x; 2001 2000 #ifdef HAVE_FACTORY … … 2003 2002 { 2004 2003 result>z=singclap_alglcm(result>z,b>n); 2005 p_Delete(&x, nacRing);2004 p_Delete(&x,r>algring); 2006 2005 } 2007 2006 #endif
Note: See TracChangeset
for help on using the changeset viewer.