Changeset dc4782 in git for Singular/iparith.cc
- Timestamp:
- Nov 25, 2013, 4:49:42 PM (10 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 98e588265496a69b639a1e37bf39d39134a6df5f
- Parents:
- 7bb7da5db82ebe13b1923654fb861e84c6c3ec65
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r7bb7da5 rdc4782 68 68 #include <Singular/linearAlgebra_ip.h> 69 69 70 #ifdef HAVE_FACTORY71 70 # include <factory/factory.h> 72 71 # include <polys/clapsing.h> … … 74 73 # include <kernel/fglm.h> 75 74 # include <Singular/fglm.h> 76 #endif /* HAVE_FACTORY */77 75 78 76 #include <Singular/interpolation.h> … … 1215 1213 { /* This means that q != 0 consists of at least two terms. 1216 1214 Moreover, currRing is over a field. */ 1217 #ifdef HAVE_FACTORY1218 1215 if(pGetComp(p)==0) 1219 1216 { … … 1253 1250 res->data=(void *)p; 1254 1251 } 1255 #else /* HAVE_FACTORY */1256 WerrorS("division only by a monomial");1257 return TRUE;1258 #endif /* HAVE_FACTORY */1259 1252 } 1260 1253 else … … 1297 1290 if (pNext(q)!=NULL) 1298 1291 { 1299 #ifdef HAVE_FACTORY1300 1292 MATELEM(mm,i,j) = singclap_pdivide( MATELEM(m,i,j) , 1301 1293 q /*(poly)(v->Data())*/, currRing ); 1302 #else /* HAVE_FACTORY */1303 WerrorS("division only by a monomial");1304 return TRUE;1305 #endif /* HAVE_FACTORY */1306 1294 } 1307 1295 else … … 1645 1633 return FALSE; 1646 1634 } 1647 #ifdef HAVE_FACTORY1648 1635 static BOOLEAN jjCHINREM_BI(leftv res, leftv u, leftv v) 1649 1636 { … … 1669 1656 return FALSE; 1670 1657 } 1671 #endif1672 1658 #if 0 1673 1659 static BOOLEAN jjCHINREM_P(leftv res, leftv u, leftv v) … … 1733 1719 } 1734 1720 #endif 1735 #ifdef HAVE_FACTORY1736 1721 static BOOLEAN jjCHINREM_ID(leftv res, leftv u, leftv v) 1737 1722 { … … 1867 1852 return FALSE; 1868 1853 } 1869 #endif1870 1854 static BOOLEAN jjCOEF(leftv res, leftv u, leftv v) 1871 1855 { … … 2118 2102 return FALSE; 2119 2103 } 2120 #ifdef HAVE_FACTORY2121 2104 static BOOLEAN jjEXTGCD_P(leftv res, leftv u, leftv v) 2122 2105 { … … 2205 2188 return FALSE; 2206 2189 } 2207 #endif /* HAVE_FACTORY */2208 2190 static BOOLEAN jjFAREY_BI(leftv res, leftv u, leftv v) 2209 2191 { … … 2367 2349 static BOOLEAN jjGCD_BI(leftv res, leftv u, leftv v) 2368 2350 { 2369 #ifdef HAVE_FACTORY2370 2351 number n1 = (number) u->CopyD(); 2371 2352 number n2 = (number) v->CopyD(); … … 2377 2358 res->data = g; 2378 2359 return FALSE; 2379 #else2380 number a=(number) u->Data();2381 number b=(number) v->Data();2382 if (n_IsZero(a,coeffs_BIGINT))2383 {2384 if (n_IsZero(b,coeffs_BIGINT)) res->data=(char *)n_Init(1,coeffs_BIGINT);2385 else res->data=(char *)n_Copy(b,coeffs_BIGINT);2386 }2387 else2388 {2389 if (n_IsZero(b,coeffs_BIGINT)) res->data=(char *)n_Copy(a,coeffs_BIGINT);2390 else res->data=(char *)n_Gcd(a, b, coeffs_BIGINT);2391 }2392 return FALSE;2393 #endif2394 2360 } 2395 2361 static BOOLEAN jjGCD_N(leftv res, leftv u, leftv v) … … 2409 2375 return FALSE; 2410 2376 } 2411 #ifdef HAVE_FACTORY2412 2377 static BOOLEAN jjGCD_P(leftv res, leftv u, leftv v) 2413 2378 { … … 2416 2381 return FALSE; 2417 2382 } 2418 #endif /* HAVE_FACTORY */2419 2383 static BOOLEAN jjHILBERT2(leftv res, leftv u, leftv v) 2420 2384 { … … 3330 3294 return FALSE; 3331 3295 } 3332 #ifdef HAVE_FACTORY3333 3296 extern int singclap_factorize_retry; 3334 3297 static BOOLEAN jjSQR_FREE2(leftv res, leftv u, leftv dummy) … … 3379 3342 return FALSE; 3380 3343 } 3381 #endif3382 3344 static BOOLEAN jjSTATUS2(leftv res, leftv u, leftv v) 3383 3345 { … … 3824 3786 else if (rField_is_Zp_a(r) && (r->cf->type==n_algExt)) 3825 3787 { 3826 #ifdef HAVE_FACTORY3827 3788 extern int ipower ( int b, int n ); /* factory/cf_util */ 3828 3789 elems=ipower(r->cf->ch,r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing)); 3829 #else3830 elems=(int)pow((double) r->cf->ch,(double)r->cf->extRing->pFDeg(r->cf->extRing->qideal->m[0],r->cf->extRing));3831 #endif3832 3790 } 3833 3791 res->data = (char *)(long)elems; … … 3920 3878 } 3921 3879 3922 3923 3924 3925 #ifdef HAVE_FACTORY3926 3880 static BOOLEAN jjDET(leftv res, leftv v) 3927 3881 { … … 3983 3937 return FALSE; 3984 3938 } 3985 #endif3986 3939 static BOOLEAN jjDIM(leftv res, leftv v) 3987 3940 { … … 4055 4008 return yyparse(); 4056 4009 } 4057 #ifdef HAVE_FACTORY4058 4010 static BOOLEAN jjFACSTD(leftv res, leftv v) 4059 4011 { … … 4112 4064 return FALSE; 4113 4065 } 4114 #endif4115 4066 static BOOLEAN jjGETDUMP(leftv, leftv v) 4116 4067 { … … 5010 4961 return FALSE; 5011 4962 } 5012 #ifdef HAVE_FACTORY5013 4963 static BOOLEAN jjSQR_FREE(leftv res, leftv u) 5014 4964 { … … 5027 4977 return FALSE; 5028 4978 } 5029 #endif5030 4979 #if 1 5031 4980 static BOOLEAN jjSYZYGY(leftv res, leftv v) … … 5357 5306 case (int)jjidElem: dArith1[i].p=(proc1)idElem; break; 5358 5307 case (int)jjidVec2Ideal: dArith1[i].p=(proc1)idVec2Ideal; break; 5359 #ifndef HAVE_FACTORY5360 5308 case (int)jjmpDetBareiss: dArith1[i].p=(proc1)mpDetBareiss; break; 5361 #endif5362 5309 case (int)jjidFreeModule: dArith1[i].p=(proc1)idFreeModule; break; 5363 5310 case (int)jjrCharStr: dArith1[i].p=(proc1)rCharStr; break; … … 7536 7483 optional: all 4 optional args 7537 7484 (The defaults are xIndex = 1, yIndex = 2, f0 and g0 polynomials as found 7538 by singclap_factorize in the case that HAVE_FACTORY is definedand h(0, y)7485 by singclap_factorize and h(0, y) 7539 7486 has exactly two distinct monic factors [possibly with exponent > 1].) 7540 7487 result: … … 7625 7572 if (factorsGiven == 0) 7626 7573 { 7627 #ifdef HAVE_FACTORY7628 7574 poly h0 = pSubst(pCopy(h), xIndex, NULL); 7629 7575 intvec* v = NULL; … … 7644 7590 g0 = pPower(pCopy(i->m[2]), (*v)[2]); 7645 7591 idDelete(&i); 7646 #else7647 WerrorS("cannot factorize h(0,y) due to missing module 'factory'");7648 return TRUE;7649 #endif7650 7592 } 7651 7593
Note: See TracChangeset
for help on using the changeset viewer.