Changeset 1629ab in git
- Timestamp:
- Aug 14, 2009, 7:14:30 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- a2787db38eefc1420adf5a8707671c1901ead89f
- Parents:
- 1a76b926417798b97d4f503af69e8a461bb9ce4a
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/mpsr_GetPoly.cc
r1a76b9 r1629ab 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_GetPoly.cc,v 1.3 5 2005-05-18 15:59:36Singular Exp $ */5 /* $Id: mpsr_GetPoly.cc,v 1.36 2009-08-14 17:13:42 Singular Exp $ */ 6 6 7 7 /*************************************************************** … … 320 320 321 321 failr(GetAlgNumberNumber(link, &(napGetCoeff(a)))); 322 mp_failr(IMP_GetSint32Vector(link, (MP_Sint32_t **) &gTa, naNumbOfPar));323 for (i=0; i< naNumbOfPar; i++)322 mp_failr(IMP_GetSint32Vector(link, (MP_Sint32_t **) &gTa, rPar(currRing))); 323 for (i=0; i<rPar(currRing); i++) 324 324 napSetExp(a,i+1,gTa[i]); 325 325 326 326 for (j=1; j<nm; j++) 327 327 { 328 napNext(a) = napNew();329 napIter(a);328 pNext(a) = napNew(); 329 pIter(a); 330 330 failr(GetAlgNumberNumber(link, &(napGetCoeff(a)))); 331 mp_failr(IMP_GetSint32Vector(link, (MP_Sint32_t **) &gTa, naNumbOfPar));332 for (i=0; i< naNumbOfPar; i++)331 mp_failr(IMP_GetSint32Vector(link, (MP_Sint32_t **) &gTa, rPar(currRing))); 332 for (i=0; i<rPar(currRing); i++) 333 333 napSetExp(a,i+1,gTa[i]); 334 334 } 335 napNext(a) = NULL;335 pNext(a) = NULL; 336 336 337 337 return mpsr_Success; -
Singular/mpsr_PutPoly.cc
r1a76b9 r1629ab 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_PutPoly.cc,v 1.2 3 2004-04-13 15:38:03Singular Exp $ */5 /* $Id: mpsr_PutPoly.cc,v 1.24 2009-08-14 17:13:42 Singular Exp $ */ 6 6 7 7 /*************************************************************** … … 222 222 gTa[i] = p_GetExp((poly)a,i+1,ar); 223 223 mp_failr(IMP_PutSint32Vector(link, gTa, gNalgvars)); 224 napIter(a);224 pIter(a); 225 225 } 226 226 else … … 230 230 failr(PutAlgAlgNumber(link, napGetCoeff(a))); 231 231 IMP_PutSint32(link, (MP_Sint32_t) p_GetExp((poly)a,1,ar)); 232 napIter(a);232 pIter(a); 233 233 } 234 234 } -
kernel/clapconv.cc
r1a76b9 r1629ab 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapconv.cc,v 1.1 6 2009-08-13 15:31:27Singular Exp $5 // $Id: clapconv.cc,v 1.17 2009-08-14 17:14:29 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: convert data between Singular and factory … … 337 337 term *= power( a , e ); 338 338 result += term; 339 p = napNext( p );339 p = pNext( p ); 340 340 } 341 341 return result; … … 377 377 { 378 378 t=napNew(); 379 // napNext( t ) = NULL; //already done by napNew379 // pNext( t ) = NULL; //already done by napNew 380 380 napGetCoeff(t)=convFactoryNSingAN( i.coeff() ); 381 381 if (n_IsZero(napGetCoeff(t),currRing->algring)) 382 382 { 383 napDelete(&t);383 p_Delete(&t,nacRing); 384 384 } 385 385 else -
kernel/clapsing.cc
r1a76b9 r1629ab 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapsing.cc,v 1.4 3 2009-08-13 15:31:27Singular Exp $5 // $Id: clapsing.cc,v 1.44 2009-08-14 17:14:30 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: interface between Singular and factory … … 81 81 { 82 82 bool b=isOn(SW_USE_QGCD); 83 if ( nGetChar()==1) On(SW_USE_QGCD);83 if ( rField_is_Q_a() ) On(SW_USE_QGCD); 84 84 CanonicalForm mipo=convSingPFactoryP(((lnumber)r->minpoly)->z, 85 85 r->algring); … … 157 157 // for now there is only the possibility to handle polynomials over 158 158 // Q and Fp ... 159 if (( nGetChar() == 0 || nGetChar() > 1 ) 160 && (currRing->parameter==NULL)) 159 if (rField_is_Zp() || rField_is_Q()) 161 160 { 162 161 Variable X(i); … … 168 167 } 169 168 // and over Q(a) / Fp(a) 170 else if (( nGetChar()==1 ) /* Q(a) */ 171 || (nGetChar() <-1)) /* Fp(a) */ 172 { 173 if (nGetChar()==1) setCharacteristic( 0 ); 169 else if (rField_is_Extension()) 170 { 171 if (rField_is_Q_a()) setCharacteristic( 0 ); 174 172 else setCharacteristic( -nGetChar() ); 175 173 poly res; … … 291 289 res=NULL;pa=NULL;pb=NULL; 292 290 On(SW_SYMMETRIC_FF); 293 if (( nGetChar() == 0 || nGetChar() > 1 ) 294 && (currRing->parameter==NULL)) 291 if (rField_is_Zp() || rField_is_Q()) 295 292 { 296 293 setCharacteristic( nGetChar() ); … … 312 309 } 313 310 // and over Q(a) / Fp(a) 314 else if (( nGetChar()==1 ) /* Q(a) */ 315 || (nGetChar() <-1)) /* Fp(a) */ 316 { 317 if (nGetChar()==1) setCharacteristic( 0 ); 311 else if (rField_is_Extension()) 312 { 313 if (rField_is_Q_a()) setCharacteristic( 0 ); 318 314 else setCharacteristic( -nGetChar() ); 319 315 CanonicalForm Fa,Gb; … … 439 435 poly singclap_pdivide ( poly f, poly g ) 440 436 { 441 // for now there is only the possibility to handle polynomials over442 // Q and Fp ...443 437 poly res=NULL; 444 438 On(SW_RATIONAL); 445 if (( nGetChar() == 0 || nGetChar() > 1 ) 446 && (currRing->parameter==NULL)) 439 if (rField_is_Zp() || rField_is_Q()) 447 440 { 448 441 setCharacteristic( nGetChar() ); … … 450 443 res = convFactoryPSingP( F / G ); 451 444 } 452 // and over Q(a) / Fp(a) 453 else if (( nGetChar()==1 ) /* Q(a) */ 454 || (nGetChar() <-1)) /* Fp(a) */ 455 { 456 if (nGetChar()==1) setCharacteristic( 0 ); 445 else if (rField_is_Extension()) 446 { 447 if (rField_is_Q_a()) setCharacteristic( 0 ); 457 448 else setCharacteristic( -nGetChar() ); 458 449 if (currRing->minpoly!=NULL) … … 498 489 else 499 490 { 500 if ( nGetChar() == 1)491 if ( rField_is_Q_a() ) 501 492 setCharacteristic( 0 ); 502 else if ( nGetChar() == -1 ) 503 return; /* not implemented for R */ 504 else if ( nGetChar() < 0 ) 493 else if ( rField_is_Zp_a() ) 505 494 setCharacteristic( -nGetChar() ); 506 else if (currRing->parameter==NULL) /* not GF(q) */507 setCharacteristic( nGetChar() );508 495 else 509 496 return; /* not implemented*/ … … 572 559 { 573 560 lnumber c=(lnumber)pGetCoeff(p); 574 napDelete(&c->z);561 p_Delete(&c->z,nacRing); 575 562 c->z=convFactoryPSingP( i.getItem() / g, currRing->algring ); 576 563 //nTest((number)c); … … 608 595 CanonicalForm F, FAC,Q,R; 609 596 Variable a; 610 if (( nGetChar() == 0 || nGetChar() > 1 ) 611 && (currRing->parameter==NULL)) 597 if (rField_is_Zp() || rField_is_Q()) 612 598 { 613 599 F=convSingPFactoryP( f ); 614 600 FAC=convSingPFactoryP( fac ); 615 601 } 616 // and over Q(a) / Fp(a) 617 else if (( nGetChar()==1 ) /* Q(a) */ 618 || (nGetChar() <-1)) /* Fp(a) */ 602 else if (rField_is_Extension()) 619 603 { 620 604 if (currRing->minpoly!=NULL) … … 645 629 if (R.isZero()) 646 630 { 647 if (( nGetChar() == 0 || nGetChar() > 1 ) 648 && (currRing->parameter==NULL)) 631 if (rField_is_Zp() || rField_is_Q()) 649 632 { 650 633 q = convFactoryPSingP( Q ); 651 634 } 652 else if (( nGetChar()==1 ) /* Q(a) */ 653 || (nGetChar() <-1)) /* Fp(a) */ 635 else if (rField_is_Extension()) 654 636 { 655 637 if (currRing->minpoly!=NULL) … … 807 789 setCharacteristic( nGetChar() ); 808 790 CanonicalForm F( convSingPFactoryP( f ) ); 809 if ( nGetChar()==0) /* Q */791 if (rField_is_Q()) 810 792 { 811 793 L = factorize( F ); -
kernel/longalg.cc
r1a76b9 r1629ab 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.4 6 2009-08-13 15:31:27Singular Exp $ */4 /* $Id: longalg.cc,v 1.47 2009-08-14 17:14:30 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 31 31 naIdeal naI=NULL; 32 32 33 int naNumbOfPar;34 33 napoly naMinimalPoly; 35 34 #define naParNames (currRing->parameter) … … 66 65 static BOOLEAN napDivPoly(napoly p, napoly q); 67 66 static int napExpi(int i, napoly a, napoly b); 68 staticring nacRing;67 ring nacRing; 69 68 70 69 #define napCopy(p) (napoly)p_Copy((poly)p,nacRing) … … 80 79 int j; 81 80 for (j=naI->anz-1; j>=0; j--) 82 napDelete (&naI->liste[j]);81 p_Delete (&naI->liste[j],nacRing); 83 82 omFreeSize((ADDRESS)naI->liste,naI->anz*sizeof(napoly)); 84 83 omFreeBin((ADDRESS)naI, snaIdeal_bin); … … 107 106 } 108 107 109 naNumbOfPar=rPar(r);110 108 if (i == 1) 111 109 { … … 156 154 if (naIsChar0) 157 155 nlDBTest(napGetCoeff(p), "", 0); 158 napIter(p);156 pIter(p); 159 157 } 160 158 } … … 202 200 203 201 qq = (napoly)p_Init(nacRing); 204 napNext(qq) = NULL;202 pNext(qq) = NULL; 205 203 p_Normalize(g,nacRing); 206 204 p_Normalize(f,nacRing); … … 232 230 233 231 qq = (napoly)p_Init(nacRing); 234 napNext(qq) = b = NULL;232 pNext(qq) = b = NULL; 235 233 p_Normalize(g,nacRing); 236 234 p_Normalize(f,nacRing); … … 297 295 n_Delete(&t,nacRing); 298 296 p_Normalize(qa,nacRing); 299 napDelete(&x);300 napDelete(&r);297 p_Delete(&x,nacRing); 298 p_Delete(&r,nacRing); 301 299 return qa; 302 300 } … … 317 315 p_Normalize(q,nacRing); 318 316 n_Delete(&t,nacRing); 319 napDelete(&x);320 napDelete(&r);317 p_Delete(&x,nacRing); 318 p_Delete(&r,nacRing); 321 319 if (napGetExp(q,1) >= napGetExp(c,1)) 322 320 q = napRemainder(q, c); … … 346 344 p_Normalize(q,nacRing); 347 345 n_Delete(&t,nacRing); 348 napDelete(&x);349 napDelete(&r);346 p_Delete(&x,nacRing); 347 p_Delete(&r,nacRing); 350 348 if (napGetExp(q,1) >= napGetExp(c,1)) 351 349 q = napRemainder(q, c); … … 373 371 { 374 372 d=si_max(d,napDeg(p)); 375 napIter(p);373 pIter(p); 376 374 } 377 375 return d; … … 388 386 { 389 387 d=si_max(d,napDeg(p)); 390 napIter(p);388 pIter(p); 391 389 ll++; 392 390 } … … 435 433 } 436 434 int i; 437 for (i = 0; i < naNumbOfPar; i++)435 for (i = 0; i < rPar(currRing); i++) 438 436 { 439 437 if (napGetExp(p,i+1) > 0) … … 452 450 } 453 451 } /*for*/ 454 napIter(p);452 pIter(p); 455 453 if (p==NULL) 456 454 break; … … 520 518 return s; 521 519 } 522 if (i >= naNumbOfPar)520 if (i >= rPar(currRing)) 523 521 break; 524 522 } … … 532 530 else 533 531 i = 0; 534 if ((*s == '\0') || (i >= naNumbOfPar))532 if ((*s == '\0') || (i >= rPar(currRing))) 535 533 break; 536 534 } … … 541 539 static int napExp(napoly a, napoly b) 542 540 { 543 while ( napNext(a)!=NULL) napIter(a);541 while (pNext(a)!=NULL) pIter(a); 544 542 int m = napGetExp(a,1); 545 543 if (m==0) return 0; 546 while ( napNext(b)!=NULL) napIter(b);544 while (pNext(b)!=NULL) pIter(b); 547 545 int mm=napGetExp(b,1); 548 546 if (m > mm) m = mm; … … 559 557 int m = napGetExp(a,i+1); 560 558 if (m==0) return 0; 561 while ( napNext(a) != NULL)562 { 563 napIter(a);559 while (pNext(a) != NULL) 560 { 561 pIter(a); 564 562 if (m > napGetExp(a,i+1)) 565 563 { … … 575 573 if (m==0) return 0; 576 574 } 577 napIter(b);575 pIter(b); 578 576 } 579 577 while (b != NULL); … … 590 588 return; 591 589 h = nacCopy(napGetCoeff(p)); 592 napIter(p);590 pIter(p); 593 591 do 594 592 { … … 602 600 n_Delete(&h,nacRing); 603 601 h = d; 604 napIter(p);602 pIter(p); 605 603 } 606 604 while (p!=NULL); … … 613 611 n_Delete(&napGetCoeff(p),nacRing); 614 612 napGetCoeff(p) = d; 615 napIter(p);613 pIter(p); 616 614 } 617 615 n_Delete(&h,nacRing); … … 632 630 n_Delete(&h,nacRing); 633 631 h = d; 634 napIter(p);632 pIter(p); 635 633 } 636 634 if(!nacIsOne(h)) … … 651 649 if (nacIsOne(x)) 652 650 return napInitz(x); 653 while ( napNext(a)!=NULL)654 { 655 napIter(a);651 while (pNext(a)!=NULL) 652 { 653 pIter(a); 656 654 y = nacGcd(x, napGetCoeff(a), nacRing); 657 655 n_Delete(&x,nacRing); … … 667 665 if (nacIsOne(x)) 668 666 return napInitz(x); 669 napIter(b);667 pIter(b); 670 668 } 671 669 while (b!=NULL); … … 681 679 napoly g, x, y, h; 682 680 if ((a==NULL) 683 || (( napNext(a)==NULL)&&(nacIsZero(napGetCoeff(a)))))681 || ((pNext(a)==NULL)&&(nacIsZero(napGetCoeff(a))))) 684 682 { 685 683 if ((b==NULL) 686 || (( napNext(b)==NULL)&&(nacIsZero(napGetCoeff(b)))))684 || ((pNext(b)==NULL)&&(nacIsZero(napGetCoeff(b))))) 687 685 { 688 686 return napInit(1); … … 692 690 else 693 691 if ((b==NULL) 694 || (( napNext(b)==NULL)&&(nacIsZero(napGetCoeff(b)))))692 || ((pNext(b)==NULL)&&(nacIsZero(napGetCoeff(b))))) 695 693 { 696 694 return napCopy(a); … … 710 708 if (!naIsChar0) g = napInit(1); 711 709 else g = napGcd0(x, y); 712 if ( napNext(y)==NULL)710 if (pNext(y)==NULL) 713 711 { 714 712 napSetExp(g,1, napExp(x, y)); … … 732 730 return y; 733 731 } 734 else if ( napNext(h)==NULL)732 else if (pNext(h)==NULL) 735 733 break; 736 734 x = y; 737 735 y = h; 738 736 } 739 napDelete(&y);737 p_Delete(&y,nacRing); 740 738 napDelete1(&h); 741 739 napSetExp(g,1, napExp(a, b)); … … 749 747 if (!naIsChar0) x = napInit(1); 750 748 else x = napGcd0(g,h); 751 for (i=( naNumbOfPar-1); i>=0; i--)749 for (i=(rPar(currRing)-1); i>=0; i--) 752 750 { 753 751 napSetExp(x,i+1, napExpi(i,a,b)); … … 772 770 n_Delete(&h,nacRing); 773 771 h = d; 774 napIter(b);772 pIter(b); 775 773 } 776 774 } … … 791 789 { 792 790 j++; 793 if (j > naNumbOfPar)791 if (j > rPar(currRing)) 794 792 return 1; 795 793 } … … 814 812 /* h = lt(q)/lt(naI->liste[i])*/ 815 813 napGetCoeff(h) = nacCopy(napGetCoeff(q)); 816 for (j= naNumbOfPar; j>0; j--)814 for (j=rPar(currRing); j>0; j--) 817 815 napSetExp(h,j, napGetExp(q,j) - napGetExp(naI->liste[i],j)); 818 816 p_Setm(h,nacRing); … … 820 818 h = napNeg (h); 821 819 q = napAdd (q, napCopy(h)); 822 napDelete (&napNext(h));820 p_Delete (&pNext(h),nacRing); 823 821 if (q == NULL) 824 822 { 825 napDelete(&h);823 p_Delete(&h,nacRing); 826 824 return q; 827 825 } … … 834 832 if (i >= naI->anz) 835 833 { 836 napDelete(&h);834 p_Delete(&h,nacRing); 837 835 return q; 838 836 } … … 852 850 napoly h; 853 851 854 h = napNext(q);852 h = pNext(q); 855 853 while (h != NULL) 856 854 { … … 858 856 if (h == NULL) 859 857 return q; 860 napIter(h);858 pIter(h); 861 859 } 862 860 return q; … … 1047 1045 } 1048 1046 if ((x!=NULL) && (napIsConstant(x)) && nacIsOne(napGetCoeff(x))) 1049 napDelete(&x);1047 p_Delete(&x,nacRing); 1050 1048 lo->n = x; 1051 1049 if(lo->z==NULL) … … 1093 1091 naNormalize(nres); 1094 1092 1095 // napDelete(&res->n);1093 //p_Delete(&res->n,nacRing); 1096 1094 naTest(nres); 1097 1095 return nres; … … 1147 1145 } 1148 1146 if ((napIsConstant(x)) && nacIsOne(napGetCoeff(x))) 1149 napDelete(&x);1147 p_Delete(&x,nacRing); 1150 1148 lo->n = x; 1151 1149 if (lo->n!=NULL) … … 1218 1216 { 1219 1217 nacNormalize(napGetCoeff(x)); 1220 napIter(x);1218 pIter(x); 1221 1219 } 1222 1220 } … … 1355 1353 return NULL; 1356 1354 int i; 1357 char *s=(char *)omAlloc(4* naNumbOfPar);1355 char *s=(char *)omAlloc(4* rPar(currRing)); 1358 1356 char *t=(char *)omAlloc(8); 1359 1357 s[0]='\0'; 1360 for (i = 0; i <= naNumbOfPar- 1; i++)1358 for (i = 0; i <= rPar(currRing) - 1; i++) 1361 1359 { 1362 1360 if (napGetExp(ph->z,i+1) > 0) … … 1446 1444 n_Delete(&t,nacRing); 1447 1445 } 1448 napIter(x);1449 napIter(y);1446 pIter(x); 1447 pIter(y); 1450 1448 } 1451 1449 while ((x!=NULL) && (y!=NULL)); 1452 1450 if ((x!=NULL) || (y!=NULL)) return FALSE; 1453 napDelete(&a->z);1454 napDelete(&a->n);1451 p_Delete(&a->z,nacRing); 1452 p_Delete(&a->n,nacRing); 1455 1453 a->z = napInit(1); 1456 1454 a->n = NULL; … … 1512 1510 x = (lnumber)a; 1513 1511 y = (lnumber)b; 1514 if (( naNumbOfPar== 1) && (naMinimalPoly!=NULL))1515 { 1516 if ( napNext(x->z)!=NULL)1512 if ((rPar(currRing) == 1) && (naMinimalPoly!=NULL)) 1513 { 1514 if (pNext(x->z)!=NULL) 1517 1515 result->z = napCopy(x->z); 1518 1516 else … … 1540 1538 else 1541 1539 { 1542 napDelete(&rz);1540 p_Delete(&rz,nacRing); 1543 1541 result->z=convFactoryPSingP( F*R, nacRing ); 1544 1542 p_Normalize(result->z,nacRing); … … 1552 1550 1553 1551 /*2 1554 * naNumbOfPar= 1:1552 * rPar(currRing) = 1: 1555 1553 * clears denominator algebraic case; 1556 1554 * tries to simplify ratio transcendental case; … … 1558 1556 * cancels monomials 1559 1557 * occuring in denominator 1560 * and enumerator ? naNumbOfPar!= 1;1558 * and enumerator ? rPar(currRing) != 1; 1561 1559 * 1562 1560 */ … … 1595 1593 { 1596 1594 nacNormalize(napGetCoeff(x)); 1597 napIter(x);1595 pIter(x); 1598 1596 } 1599 1597 x = p->z; … … 1605 1603 { 1606 1604 nacNormalize(napGetCoeff(y)); 1607 napIter(y);1605 pIter(y); 1608 1606 } 1609 1607 y = p->n; … … 1617 1615 { 1618 1616 nacNormalize(napGetCoeff(x)); 1619 napIter(x);1617 pIter(x); 1620 1618 } 1621 1619 x = p->z; … … 1623 1621 { 1624 1622 nacNormalize(napGetCoeff(y)); 1625 napIter(y);1623 pIter(y); 1626 1624 } 1627 1625 y = p->n; … … 1630 1628 { 1631 1629 int i; 1632 for (i= naNumbOfPar-1; i>=0; i--)1630 for (i=rPar(currRing)-1; i>=0; i--) 1633 1631 { 1634 1632 napoly xx=x; … … 1640 1638 { 1641 1639 napAddExp(xx,i+1, -m); 1642 napIter(xx);1640 pIter(xx); 1643 1641 } 1644 1642 while (yy != NULL) 1645 1643 { 1646 1644 napAddExp(yy,i+1, -m); 1647 napIter(yy);1645 pIter(yy); 1648 1646 } 1649 1647 } … … 1668 1666 return; 1669 1667 } 1670 if ( naNumbOfPar== 1) /* apply built-in gcd */1668 if (rPar(currRing) == 1) /* apply built-in gcd */ 1671 1669 { 1672 1670 napoly x1,y1; … … 1685 1683 { 1686 1684 r = napRemainder(x1, y1); 1687 if ((r==NULL) || ( napNext(r)==NULL)) break;1685 if ((r==NULL) || (pNext(r)==NULL)) break; 1688 1686 x1 = y1; 1689 1687 y1 = r; … … 1691 1689 if (r!=NULL) 1692 1690 { 1693 napDelete(&r);1694 napDelete(&y1);1691 p_Delete(&r,nacRing); 1692 p_Delete(&y1,nacRing); 1695 1693 } 1696 1694 else … … 1698 1696 napDivMod(x, y1, &(p->z), &r); 1699 1697 napDivMod(y, y1, &(p->n), &r); 1700 napDelete(&y1);1698 p_Delete(&y1,nacRing); 1701 1699 } 1702 1700 x = p->z; … … 1712 1710 { 1713 1711 nacNormalize(napGetCoeff(x)); 1714 napIter(x);1712 pIter(x); 1715 1713 } 1716 1714 x = p->z; … … 1718 1716 { 1719 1717 nacNormalize(napGetCoeff(y)); 1720 napIter(y);1718 pIter(y); 1721 1719 } 1722 1720 y = p->n; 1723 1721 } 1724 if ( napNext(y)==NULL)1722 if (pNext(y)==NULL) 1725 1723 { 1726 1724 if (nacIsOne(napGetCoeff(y))) … … 1745 1743 p->z=xx; 1746 1744 p->n=yy; 1747 napDelete(&x);1748 napDelete(&y);1745 p_Delete(&x,nacRing); 1746 p_Delete(&y,nacRing); 1749 1747 } 1750 1748 } … … 1759 1757 } 1760 1758 number g=nacCopy(napGetCoeff(x)); 1761 napIter(x);1759 pIter(x); 1762 1760 while (x!=NULL) 1763 1761 { … … 1772 1770 n_Delete(&g,nacRing); 1773 1771 g = d; 1774 napIter(x);1772 pIter(x); 1775 1773 } 1776 1774 while (y!=NULL) … … 1786 1784 n_Delete(&g,nacRing); 1787 1785 g = d; 1788 napIter(y);1786 pIter(y); 1789 1787 } 1790 1788 x=p->z; … … 1794 1792 number d = nacIntDiv(napGetCoeff(x),g); 1795 1793 napSetCoeff(x,d); 1796 napIter(x);1794 pIter(x); 1797 1795 } 1798 1796 while (y!=NULL) … … 1800 1798 number d = nacIntDiv(napGetCoeff(y),g); 1801 1799 napSetCoeff(y,d); 1802 napIter(y);1800 pIter(y); 1803 1801 } 1804 1802 n_Delete(&g,nacRing); … … 1839 1837 n_Delete(&bt,nacRing); 1840 1838 n_Delete(&r,nacRing); 1841 napIter(xx);1839 pIter(xx); 1842 1840 } 1843 1841 } … … 1848 1846 { 1849 1847 result->z=singclap_alglcm(result->z,b->n); 1850 napDelete(&x);1848 p_Delete(&x,nacRing); 1851 1849 } 1852 1850 #endif … … 1868 1866 { 1869 1867 for (i=naI->anz-1; i>=0; i--) 1870 napDelete(&naI->liste[i]);1868 p_Delete(&naI->liste[i],nacRing); 1871 1869 omFreeBin((ADDRESS)naI, snaIdeal_bin); 1872 1870 naI=NULL; … … 1996 1994 loop 1997 1995 { 1998 napIter(p);1996 pIter(p); 1999 1997 if (p==NULL) break; 2000 napNext(a) = (napoly)p_Init(nacRing);2001 napIter(a);1998 pNext(a) = (napoly)p_Init(nacRing); 1999 pIter(a); 2002 2000 for(i=1;i<=naParsToCopy;i++) 2003 2001 napSetExp(a,i,napGetExpFrom(p,i,napMapRing)); … … 2005 2003 napGetCoeff(a) = nacMap(napGetCoeff(p)); 2006 2004 } 2007 napNext(a) = NULL;2005 pNext(a) = NULL; 2008 2006 return w; 2009 2007 } … … 2032 2030 napGetCoeff(w) = nMap(napGetCoeff(p)); 2033 2031 p_Setm(w,nacRing); 2034 napIter(p);2032 pIter(p); 2035 2033 if (!not_null) 2036 2034 { … … 2048 2046 else 2049 2047 { 2050 napNext(w)=napPerm(p,par_perm,src_ring,nMap);2048 pNext(w)=napPerm(p,par_perm,src_ring,nMap); 2051 2049 return w; 2052 2050 } … … 2083 2081 erg->n = napRemainder(erg->n, naMinimalPoly); 2084 2082 if ((napIsConstant(erg->n)) && nacIsOne(napGetCoeff(erg->n))) 2085 napDelete(&(erg->n));2083 p_Delete(&(erg->n),nacRing); 2086 2084 } 2087 2085 } … … 2258 2256 res=pAdd(res,p); 2259 2257 } 2260 napIter(za);2258 pIter(za); 2261 2259 } 2262 2260 while (za!=NULL); … … 2326 2324 if (naIsChar0 && !(nlDBTest(napGetCoeff(p),f,l))) 2327 2325 return FALSE; 2328 napIter(p);2326 pIter(p); 2329 2327 } 2330 2328 p = naGetDenom0(x); … … 2333 2331 if (naIsChar0 && !(nlDBTest(napGetCoeff(p),f,l))) 2334 2332 return FALSE; 2335 napIter(p);2333 pIter(p); 2336 2334 } 2337 2335 return TRUE; -
kernel/longalg.h
r1a76b9 r1629ab 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longalg.h,v 1.1 4 2009-08-07 13:55:21Singular Exp $ */6 /* $Id: longalg.h,v 1.15 2009-08-14 17:14:30 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: algebraic numbers … … 22 22 }; 23 23 24 extern int naNumbOfPar; /* maximal number of parameters */ 24 extern napoly naMinimalPoly; 25 extern ring nacRing; 25 26 26 extern napoly naMinimalPoly;27 27 28 28 void naSetChar(int p, ring r); … … 72 72 #define napNeg(p) (p_Neg(p,currRing->algring)) 73 73 #define napVariables naNumbOfPar 74 #define napNext(p) pNext(p)75 #define napIter(p) pIter(p)76 74 #define napGetCoeff(p) pGetCoeff(p) 77 75 #define napGetExp(p,i) (p_GetExp(p,i,currRing->algring)) 78 76 #define napGetExpFrom(p,i,r) (p_GetExp(p,i,r->algring)) 79 77 #define napSetExp(p,i,e) (p_SetExp(p,i,e,currRing->algring)) 80 #define napDelete(p) p_Delete(p, currRing->algring)81 78 #define napNew() (p_Init(currRing->algring)) 82 79 #define napAdd(p1,p2) (p_Add_q(p1,p2,currRing->algring))
Note: See TracChangeset
for help on using the changeset viewer.