Changeset 53535c in git for Singular/iparith.cc
- Timestamp:
- Sep 8, 2015, 10:22:53 AM (9 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- b075f54919258c76495ed117b0f095df1f2ef635
- Parents:
- 47362dcbb6b4fbb3b9d6cded63720e333b4c97b3b6c5b9ea35189a34db58f51d1b3bb752d8b73338
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r47362dc r53535c 1828 1828 else 1829 1829 { 1830 xx=(number *)omAlloc(rl*sizeof(number));1831 1830 if (nMap==NULL) 1832 1831 { … … 1834 1833 return TRUE; 1835 1834 } 1835 xx=(number *)omAlloc(rl*sizeof(number)); 1836 1836 for(i=rl-1;i>=0;i--) 1837 1837 { … … 1898 1898 // deletes also x 1899 1899 c->Clean(); 1900 if ( return_type==POLY_CMD)1900 if ((return_type==POLY_CMD) &&(result!=NULL)) 1901 1901 { 1902 1902 res->data=(char *)result->m[0]; … … 1913 1913 omFree(q); 1914 1914 res->rtyp=return_type; 1915 return FALSE;1915 return result==NULL; 1916 1916 } 1917 1917 static BOOLEAN jjCOEF(leftv res, leftv u, leftv v) … … 3479 3479 return FALSE; 3480 3480 } 3481 static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v);3482 static void jjSTD_1_ID(leftv res, ideal i0, int t0, ideal p0, attr a)3483 /* destroys i0, p0 */3484 /* result (with attributes) in res */3485 /* i0: SB*/3486 /* t0: type of p0*/3487 /* p0 new elements*/3488 /* a attributes of i0*/3489 {3490 int tp;3491 if (t0==IDEAL_CMD) tp=POLY_CMD;3492 else tp=VECTOR_CMD;3493 for (int i=IDELEMS(p0)-1; i>=0; i--)3494 {3495 poly p=p0->m[i];3496 p0->m[i]=NULL;3497 if (p!=NULL)3498 {3499 sleftv u0,v0;3500 memset(&u0,0,sizeof(sleftv));3501 memset(&v0,0,sizeof(sleftv));3502 v0.rtyp=tp;3503 v0.data=(void*)p;3504 u0.rtyp=t0;3505 u0.data=i0;3506 u0.attribute=a;3507 setFlag(&u0,FLAG_STD);3508 jjSTD_1(res,&u0,&v0);3509 i0=(ideal)res->data;3510 res->data=NULL;3511 a=res->attribute;3512 res->attribute=NULL;3513 u0.CleanUp();3514 v0.CleanUp();3515 res->CleanUp();3516 }3517 }3518 idDelete(&p0);3519 res->attribute=a;3520 res->data=(void *)i0;3521 res->rtyp=t0;3522 }3523 3481 static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v) 3524 3482 { … … 3567 3525 else /*IDEAL/MODULE*/ 3568 3526 { 3569 attr *aa=u->Attribute(); 3570 attr a=NULL; 3571 if ((aa!=NULL)&&(*aa!=NULL)) a=(*aa)->Copy(); 3572 jjSTD_1_ID(res,(ideal)u->CopyD(),r,(ideal)v->CopyD(),a); 3527 i0=(ideal)v->CopyD(); 3528 int ii0=idElem(i0); /* size of i0 */ 3529 i1=idSimpleAdd(i1,i0); // 3530 memset(i0->m,0,sizeof(poly)*IDELEMS(i0)); 3531 idDelete(&i0); 3532 intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 3533 tHomog hom=testHomog; 3534 3535 if (w!=NULL) 3536 { 3537 if (!idTestHomModule(i1,currRing->qideal,w)) 3538 { 3539 // no warnung: this is legal, if i in std(i,p) 3540 // is homogeneous, but p not 3541 w=NULL; 3542 } 3543 else 3544 { 3545 w=ivCopy(w); 3546 hom=isHomog; 3547 } 3548 } 3549 if (ii0*4 >= 3*IDELEMS(i1)) // MAGIC: add few poly to large SB: 3/4 3550 { 3551 BITSET save1; 3552 SI_SAVE_OPT1(save1); 3553 si_opt_1|=Sy_bit(OPT_SB_1); 3554 /* ii0 appears to be the position of the first element of il that 3555 does not belong to the old SB ideal */ 3556 result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0); 3557 SI_RESTORE_OPT1(save1); 3558 } 3559 else 3560 { 3561 result=kStd(i1,currRing->qideal,hom,&w); 3562 } 3563 idDelete(&i1); 3564 idSkipZeroes(result); 3565 if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD); 3566 res->data = (char *)result; 3573 3567 } 3574 3568 if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
Note: See TracChangeset
for help on using the changeset viewer.