Changeset be56124 in git
- Timestamp:
- Aug 28, 2013, 12:36:11 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 8f761ae82f2bae65cb1dee517949807fa5bea8bb
- Parents:
- fa601bae3b282a1d9ecb0b4cd31ebb37b467e9a42e416bb313f3d70371bd9a38ab5c86e29244f713
- Files:
-
- 3 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Tst/New.lst
rfa601b rbe56124 1 1 New/algext_numbers.tst 2 2 New/bigints.tst 3 New/finduni.tst 3 4 New/gf_coeff_short.tst 4 5 New/gf_fetch.tst -
libpolys/coeffs/shortfl.cc
rfa601b rbe56124 441 441 mpf_init(e); 442 442 mpf_set_z(e,z); 443 int sign= mpf_sgn(e); 444 mpf_abs (e, e); 443 445 444 446 /* if number was an integer, we are done*/ … … 453 455 signed long int exp; 454 456 basis = mpf_get_d_2exp(&exp, e); 455 float f= mpf_sgn(e)*ldexp(basis,exp);457 float f= sign*ldexp(basis,exp); 456 458 mpf_clear(e); 457 459 return nf(f).N(); … … 479 481 signed long int exp; 480 482 basis = mpf_get_d_2exp(&exp, q); 481 float f = mpf_sgn(e)*ldexp(basis,exp);483 float f = sign*ldexp(basis,exp); 482 484 mpf_clear(e); 483 485 mpf_clear(d); -
libpolys/polys/clapconv.cc
rfa601b rbe56124 323 323 324 324 // test if denominator is constant 325 if (!p_IsConstantPoly(DEN (p_GetCoeff (p,r)),r ) && !errorreported)325 if (!p_IsConstantPoly(DEN (p_GetCoeff (p,r)),r->cf->extRing) && !errorreported) 326 326 WerrorS("conversion error: denominator!= 1"); 327 327 -
libpolys/polys/ext_fields/transext.cc
rfa601b rbe56124 1156 1156 1157 1157 if (IS0(a)) return; 1158 if (NUM(f)!=NULL) p_Normalize(NUM(f), ntRing); 1159 if (DEN(f)!=NULL) p_Normalize(DEN(f), ntRing); 1158 1160 if (!simpleTestsHaveAlreadyBeenPerformed) 1159 1161 { 1160 p_Normalize(NUM(f), ntRing);1161 if (DEN(f)!=NULL) p_Normalize(DEN(f), ntRing);1162 //p_Normalize(NUM(f), ntRing); 1163 //if (DEN(f)!=NULL) p_Normalize(DEN(f), ntRing); 1162 1164 if (DENIS1(f) || NUMIS1(f)) { COM(f) = 0; return; } 1163 1165 … … 1172 1174 } 1173 1175 } 1174 if (rField_is_Q(ntRing))1176 /*if (rField_is_Q(ntRing)) 1175 1177 { 1176 1178 number c=n_Copy(pGetCoeff(NUM(f)),ntCoeffs); … … 1224 1226 } 1225 1227 } 1226 } 1228 }*/ 1227 1229 1228 1230 #ifdef HAVE_FACTORY … … 1231 1233 pGcd = singclap_gcd_r(NUM(f), DEN(f), ntRing); 1232 1234 if (p_IsConstant(pGcd, ntRing) 1233 //&& n_IsOne(p_GetCoeff(pGcd, ntRing), ntCoeffs)1235 && n_IsOne(p_GetCoeff(pGcd, ntRing), ntCoeffs) 1234 1236 ) 1235 1237 { /* gcd = 1; nothing to cancel; … … 1400 1402 poly pb = p_Copy(DEN(fb), ntRing); 1401 1403 1404 poly pGcd; 1405 if (nCoeff_is_Q(ntCoeffs)) 1406 { 1407 if (p_IsConstant(pa,ntRing) && p_IsConstant(pb,ntRing)) 1408 { 1409 pGcd = pa; 1410 p_SetCoeff (pGcd, n_Gcd (pGetCoeff(pGcd), pGetCoeff(pb), ntCoeffs), ntRing); 1411 } 1412 else 1413 { 1414 number contentpa, contentpb, tmp; 1415 1416 contentpb= p_GetCoeff(pb, ntRing); 1417 pIter(pb); 1418 while (pb != NULL) 1419 { 1420 tmp = n_Gcd(contentpb, p_GetCoeff(pb, ntRing) , ntCoeffs); 1421 n_Delete(&contentpb, ntCoeffs); 1422 contentpb = tmp; 1423 pIter(pb); 1424 } 1425 1426 contentpa= p_GetCoeff(pa, ntRing); 1427 pIter(pa); 1428 while (pa != NULL) 1429 { 1430 tmp = n_Gcd(contentpa, p_GetCoeff(pa, ntRing), ntCoeffs); 1431 n_Delete(&contentpa, ntCoeffs); 1432 contentpa = tmp; 1433 pIter(pa); 1434 } 1435 1436 tmp= n_Gcd (contentpb, contentpa, ntCoeffs); 1437 n_Delete(&contentpa, ntCoeffs); 1438 n_Delete(&contentpb, ntCoeffs); 1439 contentpa= tmp; 1440 p_Delete(&pb, ntRing); 1441 p_Delete(&pa, ntRing); 1442 1443 /* singclap_gcd destroys its arguments; we hence need copies: */ 1444 pGcd = singclap_gcd(p_Copy(NUM(fa),ntRing), p_Copy(DEN(fb),ntRing), ntRing); 1445 pGcd= p_Mult_nn (pGcd, contentpa, ntRing); 1446 n_Delete(&contentpa, ntCoeffs); 1447 } 1448 } 1449 else 1450 pGcd = singclap_gcd(pa, pb, cf->extRing); 1451 1402 1452 /* Note that, over Q, singclap_gcd will remove the denominators in all 1403 1453 rational coefficients of pa and pb, before starting to compute 1404 1454 the gcd. Thus, we do not need to ensure that the coefficients of 1405 1455 pa and pb live in Z; they may well be elements of Q\Z. */ 1406 poly pGcd = singclap_gcd(pa, pb, ntRing); 1456 1407 1457 if (p_IsConstant(pGcd, ntRing) && 1408 1458 n_IsOne(p_GetCoeff(pGcd, ntRing), ntCoeffs)) … … 1442 1492 fraction fa = (fraction)a; 1443 1493 fraction fb = (fraction)b; 1444 /* singclap_gcd destroys its arguments; we hence need copies: */ 1494 1445 1495 poly pa = p_Copy(NUM(fa), ntRing); 1446 1496 poly pb = p_Copy(NUM(fb), ntRing); 1447 1497 1498 poly pGcd; 1499 if (nCoeff_is_Q(ntCoeffs)) 1500 { 1501 if (p_IsConstant(pa,ntRing) && p_IsConstant(pb,ntRing)) 1502 { 1503 pGcd = pa; 1504 p_SetCoeff (pGcd, n_Gcd (pGetCoeff(pGcd), pGetCoeff(pb), ntCoeffs), ntRing); 1505 } 1506 else 1507 { 1508 number contentpa, contentpb, tmp; 1509 1510 contentpb= p_GetCoeff(pb, ntRing); 1511 pIter(pb); 1512 while (pb != NULL) 1513 { 1514 tmp = n_Gcd(contentpb, p_GetCoeff(pb, ntRing) , ntCoeffs); 1515 n_Delete(&contentpb, ntCoeffs); 1516 contentpb = tmp; 1517 pIter(pb); 1518 } 1519 1520 contentpa= p_GetCoeff(pa, ntRing); 1521 pIter(pa); 1522 while (pa != NULL) 1523 { 1524 tmp = n_Gcd(contentpa, p_GetCoeff(pa, ntRing), ntCoeffs); 1525 n_Delete(&contentpa, ntCoeffs); 1526 contentpa = tmp; 1527 pIter(pa); 1528 } 1529 1530 tmp= n_Gcd (contentpb, contentpa, ntCoeffs); 1531 n_Delete(&contentpa, ntCoeffs); 1532 n_Delete(&contentpb, ntCoeffs); 1533 contentpa= tmp; 1534 p_Delete(&pb, ntRing); 1535 p_Delete(&pa, ntRing); 1536 1537 /* singclap_gcd destroys its arguments; we hence need copies: */ 1538 pGcd = singclap_gcd(p_Copy(NUM(fa),ntRing), p_Copy(NUM(fb),ntRing), ntRing); 1539 pGcd= p_Mult_nn (pGcd, contentpa, ntRing); 1540 n_Delete(&contentpa, ntCoeffs); 1541 } 1542 } 1543 else 1544 pGcd = singclap_gcd(pa, pb, cf->extRing); 1448 1545 /* Note that, over Q, singclap_gcd will remove the denominators in all 1449 1546 rational coefficients of pa and pb, before starting to compute 1450 1547 the gcd. Thus, we do not need to ensure that the coefficients of 1451 1548 pa and pb live in Z; they may well be elements of Q\Z. */ 1452 poly pGcd = singclap_gcd(pa, pb, cf->extRing); 1549 1453 1550 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 1454 1551 NUM(result) = pGcd; -
libpolys/polys/monomials/p_polys.cc
rfa601b rbe56124 2172 2172 n_Delete(&h,r->cf->extRing->cf); 2173 2173 } 2174 else2174 /*else 2175 2175 { 2176 2176 // special handling for rat. functions.: … … 2196 2196 } 2197 2197 /* hzz contains the gcd of all numerators in f*/ 2198 h=n_Invers(hzz,r->cf->extRing->cf);2198 /*h=n_Invers(hzz,r->cf->extRing->cf); 2199 2199 n_Delete(&hzz,r->cf->extRing->cf); 2200 2200 n_Normalize(h,r->cf->extRing->cf); … … 2211 2211 } 2212 2212 n_Delete(&h,r->cf->extRing->cf); 2213 } 2213 }*/ 2214 2214 } 2215 2215 }
Note: See TracChangeset
for help on using the changeset viewer.