Changeset 2a4231 in git
 Timestamp:
 Jun 29, 2015, 4:40:07 PM (8 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 74dcead93fa7d8032514e5919362facbb50b1c0e
 Parents:
 8e18ccc9b499f7dc190d8295d0c3f12184a9f764
 Files:

 3 added
 4 edited
Legend:
 Unmodified
 Added
 Removed

Singular/maps_ip.cc
r8e18cc r2a4231 83 83 { 84 84 assume( nMap != NULL ); 85 86 85 number a = nMap((number)data, preimage_r>cf, currRing>cf); 87 86 if (nCoeff_is_Extension(currRing>cf)) … … 147 146 } 148 147 else 149 if ( (what==IMAP_CMD)  /*(*/ (what==FETCH_CMD) /*)*/) /* && (nMap!=nCopy)*/148 if ((what==IMAP_CMD)  ((what==FETCH_CMD) && (nMap!=ndCopyMap))) 150 149 { 151 150 for (i=R*C1;i>=0;i) 
Tst/Short/ok_s.lst
r8e18cc r2a4231 44 44 bug_tr707 45 45 bug_tr709 46 bug_tr723 46 47 bug_tr724 47 48 bug_genus_etc 
libpolys/polys/ext_fields/transext.cc
r8e18cc r2a4231 193 193 { 194 194 p_Test(den, ntRing); 195 196 195 if(p_IsConstant(den, ntRing) && (n_IsOne(pGetCoeff(den), ntCoeffs))) 197 196 { … … 199 198 return FALSE; 200 199 } 201 202 200 if( !n_GreaterZero(pGetCoeff(den), ntCoeffs) ) 203 201 { … … 205 203 return FALSE; 206 204 } 207 208 205 // test that den is over integers!? 209 210 }else206 } 207 else 211 208 { // num != NULL // den == NULL 212 213 209 // if( COM(t) != 0 ) 214 210 // { … … 343 339 if (IS0(a)) return NULL; 344 340 fraction f = (fraction)a; 345 poly g = p_Copy(NUM(f), ntRing); 346 poly h = NULL; if (!DENIS1(f)) h = p_Copy(DEN(f), ntRing); 347 fraction result = (fraction)omAllocBin(fractionObjectBin); 348 NUM(result) = g; 349 DEN(result) = h; 341 poly g = NUM(f); 342 poly h = NULL; 343 h =DEN(f); 344 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 345 NUM(result) = p_Copy(g,cf>extRing); 346 DEN(result) = p_Copy(h,cf>extRing); 350 347 COM(result) = COM(f); 351 348 ntTest((number)result); … … 384 381 if( !n_GreaterZero(g, ntCoeffs) ) 385 382 { 386 NUM (f) = p_Neg(NUM (f), ntRing); // Ugly :(((383 NUM (f) = p_Neg(NUM (f), ntRing); 387 384 g = n_InpNeg(g, ntCoeffs); 388 385 } … … 393 390 if( !n_IsOne(g, ntCoeffs) ) 394 391 { 395 DEN (f) = p_NSet(g, ntRing); // update COM(f)???392 DEN (f) = p_NSet(g, ntRing); 396 393 COM (f) ++; 397 394 assume( DEN (f) != NULL ); … … 1250 1247 1251 1248 if (IS0(a)) return; 1249 if (DENIS1(f)  NUMIS1(f)) { COM(f) = 0; return; } 1252 1250 if (!simpleTestsHaveAlreadyBeenPerformed) 1253 1251 { 1254 if (DENIS1(f)  NUMIS1(f)) { COM(f) = 0; return; }1255 1252 1256 1253 /* check whether NUM(f) = DEN(f), and  if so  replace 'a' by 1 */ … … 1260 1257 p_Delete(&DEN(f), ntRing); DEN(f) = NULL; 1261 1258 COM(f) = 0; 1262 ntTest(a); // !!!!1259 ntTest(a); 1263 1260 return; 1264 1261 } … … 1455 1452 //PrintS(" den=");p_wrp(DEN(a),ntRing);PrintLn(); 1456 1453 definiteGcdCancellation(a, cf, FALSE); 1457 fraction f=(fraction)a; 1458 if ((DEN(f)!=NULL) 1459 &&(!n_GreaterZero(pGetCoeff(DEN(f)),ntCoeffs))) 1460 { 1461 NUM(f)=p_Neg(NUM(f),ntRing); 1462 DEN(f)=p_Neg(DEN(f),ntRing); 1463 a=(number)f; 1454 if ((DEN((fraction)a)!=NULL) 1455 &&(!n_GreaterZero(pGetCoeff(DEN((fraction)a)),ntCoeffs))) 1456 { 1457 NUM((fraction)a)=p_Neg(NUM((fraction)a),ntRing); 1458 DEN((fraction)a)=p_Neg(DEN((fraction)a),ntRing); 1464 1459 } 1465 1460 } … … 1843 1838 fraction f = (fraction)a; 1844 1839 poly g = prMapR(NUM(f), nMap, rSrc, rDst); 1840 /* g may contain summands with coeff 0 */ 1841 poly hh=g; 1842 poly prev=NULL; 1843 while(hh!=NULL) 1844 { 1845 if (n_IsZero(pGetCoeff(hh),rDst>cf)) 1846 { 1847 if (prev==NULL) 1848 { 1849 g=p_LmFreeAndNext(g,rDst); 1850 hh=g; 1851 } 1852 else 1853 { 1854 prev>next=p_LmFreeAndNext(prev>next,rDst); 1855 hh=prev>next; 1856 } 1857 } 1858 else 1859 { 1860 prev=hh; 1861 pIter(hh); 1862 } 1863 } 1864 if (g==NULL) return NULL; 1845 1865 1846 1866 poly h = NULL; 1847 1867 1848 1868 if (!DENIS1(f)) 1869 { 1849 1870 h = prMapR(DEN(f), nMap, rSrc, rDst); 1871 /* h may contain summands with coeff 0 */ 1872 hh=h; 1873 prev=NULL; 1874 while(hh!=NULL) 1875 { 1876 if (n_IsZero(pGetCoeff(hh),rDst>cf)) 1877 { 1878 if (prev==NULL) 1879 { 1880 h=p_LmFreeAndNext(h,rDst); 1881 hh=h; 1882 } 1883 else 1884 { 1885 prev>next=p_LmFreeAndNext(prev>next,rDst); 1886 hh=prev>next; 1887 } 1888 } 1889 else 1890 { 1891 prev=hh; 1892 pIter(hh); 1893 } 1894 } 1895 if (h==NULL) WerrorS("mapping to */0"); 1896 } 1850 1897 1851 1898 fraction result = (fraction)omAllocBin(fractionObjectBin); 
libpolys/polys/monomials/p_polys.cc
r8e18cc r2a4231 3905 3905 PrintS("\np_PermPoly::p: "); p_Write(p, oldRing, oldRing); PrintLn(); 3906 3906 #endif 3907 3908 3907 const int OldpVariables = rVar(oldRing); 3909 3908 poly result = NULL; … … 3911 3910 poly aq = NULL; /* the map coefficient */ 3912 3911 poly qq; /* the mapped monomial */ 3913 3914 3912 assume(dst != NULL); 3915 3913 assume(dst>cf != NULL); 3916 3917 3914 while (p != NULL) 3918 3915 { … … 3922 3919 qq = p_Init(dst); 3923 3920 assume( nMap != NULL ); 3924 3925 3921 number n = nMap(p_GetCoeff(p, oldRing), oldRing>cf, dst>cf); 3926 3927 3922 n_Test (n,dst>cf); 3928 3929 3923 if ( nCoeff_is_algExt(dst>cf) ) 3930 3924 n_Normalize(n, dst>cf); 3931 3932 3925 p_GetCoeff(qq, dst) = n;// Note: n can be a ZERO!!! 3933 // coef may be zero:3934 // p_Test(qq, dst);3935 3926 } 3936 3927 else 3937 3928 { 3938 3929 qq = p_One(dst); 3939 3940 3930 // aq = naPermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing); // no dst??? 3941 3931 // poly n_PermNumber(const number z, const int *par_perm, const int P, const ring src, const ring dst) 3942 3932 aq = n_PermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing, dst); 3943 3944 3933 p_Test(aq, dst); 3945 3946 3934 if ( nCoeff_is_algExt(dst>cf) ) 3947 3935 p_Normalize(aq,dst); 3948 3949 3936 if (aq == NULL) 3950 3937 p_SetCoeff(qq, n_Init(0, dst>cf),dst); // Very dirty trick!!! 3951 3952 3938 p_Test(aq, dst); 3953 3939 } 3954 3955 3940 if (rRing_has_Comp(dst)) 3956 3941 p_SetComp(qq, p_GetComp(p, oldRing), dst); 3957 3958 3942 if ( n_IsZero(pGetCoeff(qq), dst>cf) ) 3959 3943 { … … 3981 3965 assume( dst>cf>extRing == NULL ); 3982 3966 number ee = n_Param(1, dst); 3983 3984 3967 number eee; 3985 3968 n_Power(ee, e, &eee, dst>cf); //nfDelete(ee,dst); 3986 3987 3969 ee = n_Mult(c, eee, dst>cf); 3988 3970 //nfDelete(c,dst);nfDelete(eee,dst); … … 3993 3975 const int par = perm[i]; 3994 3976 assume( par > 0 ); 3995 3996 3977 // WarnS("longalg missing 3"); 3997 3978 #if 1 3998 3979 const coeffs C = dst>cf; 3999 3980 assume( C != NULL ); 4000 4001 3981 const ring R = C>extRing; 4002 3982 assume( R != NULL ); 4003 4004 3983 assume( par <= rVar(R) ); 4005 4006 3984 poly pcn; // = (number)c 4007 4008 3985 assume( !n_IsZero(c, C) ); 4009 4010 3986 if( nCoeff_is_algExt(C) ) 4011 3987 pcn = (poly) c; 4012 3988 else // nCoeff_is_transExt(C) 4013 3989 pcn = NUM((fraction)c); 4014 4015 3990 if (pNext(pcn) == NULL) // c>z 4016 3991 p_AddExp(pcn, perm[i], e, R); … … 4020 3995 p_SetExp(mmc, perm[i], e, R); 4021 3996 p_Setm(mmc, R); 4022 4023 3997 number nnc; 4024 3998 // convert back to a number: number nnc = mmc; … … 4027 4001 else // nCoeff_is_transExt(C) 4028 4002 nnc = ntInit(mmc, C); 4029 4030 4003 p_GetCoeff(qq, dst) = n_Mult((number)c, nnc, C); 4031 4004 n_Delete((number *)&c, C); 4032 4005 n_Delete((number *)&nnc, C); 4033 4006 } 4034 4035 4007 mapped_to_par=1; 4036 4008 #endif … … 4075 4047 if (aq!=NULL) 4076 4048 qq=p_Mult_q(aq,qq,dst); 4077 4078 4049 aq = qq; 4079 4080 4050 while (pNext(aq) != NULL) pIter(aq); 4081 4082 4051 if (result_last==NULL) 4083 4052 { … … 4096 4065 } 4097 4066 } 4098 4099 4067 result=p_SortAdd(result,dst); 4100 4068 #else … … 4127 4095 #endif 4128 4096 p_Test(result,dst); 4129 4130 4097 #if 0 4131 4098 p_Test(result,dst);
Note: See TracChangeset
for help on using the changeset viewer.