Changeset 7049b2 in git
- Timestamp:
- Dec 8, 2000, 1:47:37 PM (22 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 2639fd85c62e265b9d5351a9fd025336832879df
- Parents:
- 6aef97b3678a5fb25e12017e60d3dea6563d2494
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/clapconv.cc
r6aef97b r7049b2 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapconv.cc,v 1. 29 2000-12-06 11:03:08Singular Exp $5 // $Id: clapconv.cc,v 1.30 2000-12-08 12:47:37 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: convert data between Singular and factory … … 25 25 static void convRec( const CanonicalForm & f, int * exp, poly & result ); 26 26 27 static void convRecAlg( const CanonicalForm & f, int * exp, alg& result );27 static void convRecAlg( const CanonicalForm & f, int * exp, napoly & result ); 28 28 29 29 static void convRecPP ( const CanonicalForm & f, int * exp, poly & result ); 30 30 31 static void convRecPTr ( const CanonicalForm & f, int * exp, alg& result );31 static void convRecPTr ( const CanonicalForm & f, int * exp, napoly & result ); 32 32 33 33 static void convRecAP ( const CanonicalForm & f, int * exp, poly & result ); … … 240 240 241 241 CanonicalForm 242 convSingTrClapP( algp )242 convSingTrClapP( napoly p ) 243 243 { 244 244 CanonicalForm result = 0; … … 299 299 } 300 300 301 alg 301 napoly 302 302 convClapPSingTr ( const CanonicalForm & f ) 303 303 { … … 308 308 // for ( int i = 0; i < n; i++ ) exp[i] = 0; 309 309 memset(exp,0,n*sizeof(int)); 310 algresult = NULL;310 napoly result = NULL; 311 311 convRecPTr( f, exp, result ); 312 312 delete [] exp; … … 315 315 316 316 static void 317 convRecPTr ( const CanonicalForm & f, int * exp, alg& result )317 convRecPTr ( const CanonicalForm & f, int * exp, napoly & result ) 318 318 { 319 319 if (f == 0) … … 331 331 else 332 332 { 333 algterm = napNew();333 napoly term = napNew(); 334 334 // napNext( term ) = NULL; //already done by napNew 335 335 for ( int i = 1; i <= napVariables; i++ ) 336 nap GetExp( term, i ) = exp[i];336 napSetExp( term, i , exp[i]); 337 337 if ( getCharacteristic() != 0 ) 338 338 { … … 426 426 else 427 427 { 428 alg z=(alg)convClapASingA( f );428 napoly z=(napoly)convClapASingA( f ); 429 429 if (z!=NULL) 430 430 { … … 435 435 pSetExp( term, i , exp[i+off]); 436 436 pSetComp(term, 0); 437 for ( i = 0; i < off; i++ ) 438 z->e[i]+=exp[i+1]; 437 for ( i = 1; i <= off; i++ ) 438 //z->e[i-1]+=exp[i]; 439 napAddExp(z,i,exp[i]); 439 440 pGetCoeff(term)=(number)omAlloc0Bin(rnumber_bin); 440 441 ((lnumber)pGetCoeff(term))->z=z; … … 445 446 } 446 447 447 CanonicalForm convSingAClapA ( algp , const Variable & a )448 CanonicalForm convSingAClapA ( napoly p , const Variable & a ) 448 449 { 449 450 CanonicalForm result = 0; … … 529 530 } 530 531 531 algconvClapASingA ( const CanonicalForm & f )532 { 533 alga=NULL;534 algt;532 napoly convClapASingA ( const CanonicalForm & f ) 533 { 534 napoly a=NULL; 535 napoly t; 535 536 for( CFIterator i=f; i.hasTerms(); i++) 536 537 { … … 540 541 if (nacIsZero(napGetCoeff(t))) 541 542 { 542 napDelete(&t);543 } 544 else 545 { 546 nap GetExp(t,1)=i.exp();543 p_Delete(&t, currRing->algring); 544 } 545 else 546 { 547 napSetExp(t,1,i.exp()); 547 548 a=napAdd(a,t); 548 549 }
Note: See TracChangeset
for help on using the changeset viewer.