Changeset f2b6f0b in git for kernel/clapconv.cc
 Timestamp:
 Mar 11, 2011, 4:44:00 PM (12 years ago)
 Branches:
 (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
 Children:
 526c7a0339cc1389327b6890ee660bf4e305a2bd
 Parents:
 55b168742289691f8d1b35cb10dd7eae24b73c9d
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/clapconv.cc
r55b1687 rf2b6f0b 45 45 CanonicalForm term; 46 46 /* does only work for Zp, Q */ 47 if ( getCharacteristic() != 0 ) 48 { 49 term = npInt( n,r ); 50 } 51 else 47 if ((r==NULL)  rField_is_Q(r)) 52 48 { 53 49 if ( SR_HDL(n) & SR_INT ) … … 74 70 } 75 71 } 72 else /*if ( (r!=NULL) && rField_is_Zp(r) ) */ 73 { 74 term = npInt( n,r ); 75 } 76 76 return term; 77 77 } 78 78 79 number convFactoryNSingN( const CanonicalForm & n )79 number convFactoryNSingN( const CanonicalForm & n, const ring r) 80 80 { 81 81 if (n.isImm()) 82 return nInit(n.intval()); 82 { 83 if (r==NULL) return nlInit(n.intval(),NULL); 84 else return n_Init(n.intval(),r); 85 } 83 86 else 84 87 { … … 99 102 } 100 103 } 104 105 //number convFactoryNSingN( const CanonicalForm & n) 106 //{ 107 // return convFactoryNSingN(n,currRing); 108 //} 109 101 110 102 111 poly convFactoryPSingP ( const CanonicalForm & f, const ring r ) … … 482 491 for(i=rl1;i>=0;i) 483 492 { 484 X[i]=convSingNFactoryN(x[i], currRing); // may be larger MAX_INT485 Q[i]=convSingNFactoryN(q[i], currRing); // may be larger MAX_INT493 X[i]=convSingNFactoryN(x[i],NULL); // may be larger MAX_INT 494 Q[i]=convSingNFactoryN(q[i],NULL); // may be larger MAX_INT 486 495 } 487 496 CanonicalForm xnew,qnew; 488 497 chineseRemainder(X,Q,xnew,qnew); 489 number n=convFactoryNSingN(xnew );490 number p=convFactoryNSingN(qnew );491 number p2=nlIntDiv(p,nlInit(2, currRing));498 number n=convFactoryNSingN(xnew,NULL); 499 number p=convFactoryNSingN(qnew,NULL); 500 number p2=nlIntDiv(p,nlInit(2, NULL)); 492 501 if (nlGreater(n,p2)) 493 502 { 494 503 number n2=nlSub(n,p); 495 nlDelete(&n, currRing);504 nlDelete(&n,NULL); 496 505 n=n2; 497 506 } 498 nlDelete(&p, currRing);499 nlDelete(&p2, currRing);507 nlDelete(&p,NULL); 508 nlDelete(&p2,NULL); 500 509 return n; 501 510 #else
Note: See TracChangeset
for help on using the changeset viewer.