Changeset a934fc8 in git
- Timestamp:
- May 6, 2011, 3:52:31 PM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- ad35b5aa4162741cdf8ed43431d40b098724e388
- Parents:
- eca225734b56a5d965350b362be8ec9a6c986759
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-05-06 15:52:31+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:36+01:00
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/clapconv.cc
reca225 ra934fc8 36 36 37 37 static number convFactoryNSingAN( const CanonicalForm &f, const ring r); 38 39 CanonicalForm convSingNFactoryN( number n, const ring r )40 {41 CanonicalForm term;42 /* does only work for Zp, Q */43 if ((r==NULL) || rField_is_Q(r))44 {45 if ( SR_HDL(n) & SR_INT )46 {47 term = SR_TO_INT(n);48 }49 else50 {51 if ( n->s == 3 )52 {53 lint dummy;54 mpz_init_set( &dummy,n->z );55 term = make_cf( dummy );56 }57 else58 {59 // assume s==0 or s==160 lint num, den;61 On(SW_RATIONAL);62 mpz_init_set( &num, n->z );63 mpz_init_set( &den, n->n );64 term = make_cf( num, den, ( n->s != 1 ));65 }66 }67 }68 else /*if ( (r!=NULL) && rField_is_Zp(r) ) */69 {70 term = npInt( n,r );71 }72 return term;73 }74 75 number convFactoryNSingN( const CanonicalForm & n, const ring r)76 {77 if (n.isImm())78 {79 if (r==NULL) return nlInit(n.intval(),NULL);80 else return n_Init(n.intval(),r);81 }82 else83 {84 number z=ALLOC_RNUMBER();85 #if defined(LDEBUG)86 z->debug=123456;87 #endif88 gmp_numerator( n, z->z );89 if ( n.den().isOne() )90 z->s = 3;91 else92 {93 gmp_denominator( n, z->n );94 z->s = 0;95 }96 nlNormalize(z);97 return z;98 }99 }100 101 //number convFactoryNSingN( const CanonicalForm & n)102 //{103 // return convFactoryNSingN(n,currRing);104 //}105 106 38 107 39 poly convFactoryPSingP ( const CanonicalForm & f, const ring r ) -
kernel/clapconv.h
reca225 ra934fc8 35 35 poly convFactoryPSingTrP ( const CanonicalForm & f, const ring r=currRing ); 36 36 37 CanonicalForm convSingNFactoryN( number n, const ring r );38 number convFactoryNSingN( const CanonicalForm & n, const ring r);39 40 41 37 // CanonicalForm convSingIFactoryI( int i);a <- by constructor of CanonicalForm 42 38 int convFactoryISingI( const CanonicalForm & f); -
libpolys/coeffs/longrat.cc
reca225 ra934fc8 267 267 #endif 268 268 269 #ifdef HAVE_FACTORY 270 CanonicalForm nlConvSingNFactoryN( number n, const coeffs r ) 271 { 272 CanonicalForm term; 273 if ( SR_HDL(n) & SR_INT ) 274 { 275 term = SR_TO_INT(n); 276 } 277 else 278 { 279 if ( n->s == 3 ) 280 { 281 MP_INT dummy; 282 mpz_init_set( &dummy,n->z ); 283 term = make_cf( dummy ); 284 } 285 else 286 { 287 // assume s==0 or s==1 288 MP_INT num, den; 289 On(SW_RATIONAL); 290 mpz_init_set( &num, n->z ); 291 mpz_init_set( &den, n->n ); 292 term = make_cf( num, den, ( n->s != 1 )); 293 } 294 } 295 return term; 296 } 297 298 number nlConvFactoryNSingN( const CanonicalForm n, const coeffs r) 299 { 300 if (n.isImm()) 301 { 302 return nlInit(n.intval(),r); 303 } 304 else 305 { 306 number z=(number)omAllocBin(rnumber_bin); 307 #if defined(LDEBUG) 308 z->debug=123456; 309 #endif 310 gmp_numerator( n, z->z ); 311 if ( n.den().isOne() ) 312 z->s = 3; 313 else 314 { 315 gmp_denominator( n, z->n ); 316 z->s = 0; 317 } 318 nlNormalize(z,r); 319 return z; 320 } 321 } 322 #endif 269 323 number nlRInit (long i); 270 324 -
libpolys/coeffs/modulop.cc
reca225 ra934fc8 332 332 if (n.isImm()) 333 333 { 334 return n _Init(n.intval(),r);334 return npInit(n.intval(),r); 335 335 } 336 336 else -
libpolys/polys/clapsing.cc
reca225 ra934fc8 45 45 if((pNext(f)==NULL) && (pNext(g)==NULL)) 46 46 { 47 poly p=p One();47 poly p=p_One(r); 48 48 for(int i=rVar(r);i>0;i--) 49 49 p_SetExp(p,i,si_min(p_GetExp(f,i,r),p_GetExp(g,i,r)),r); … … 57 57 if (rField_is_Q(r) || (rField_is_Zp(r))) 58 58 { 59 setCharacteristic( n_GetChar(r ) );59 setCharacteristic( n_GetChar(r->cf) ); 60 60 CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g, r ) ); 61 61 res=convFactoryPSingP( gcd( F, G ) , r);
Note: See TracChangeset
for help on using the changeset viewer.