Changeset 0e4337 in git
- Timestamp:
- Feb 26, 2001, 4:08:45 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- af847a2a8b7e01d923f5ef3edef35d4921a47299
- Parents:
- d88b030aab30132964e13441edf50d4075a99fb2
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
rd88b03 r0e4337 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.16 2 2001-02-22 19:12:57levandov Exp $ */4 /* $Id: extra.cc,v 1.163 2001-02-26 15:08:42 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 69 69 70 70 #ifdef HAVE_PLURAL 71 #include "ring.h" 71 72 #include "gring.h" 72 73 #endif … … 1180 1181 matrix C; 1181 1182 matrix D; 1182 1183 matrix COM; 1183 1184 if ((h!=NULL) && (h->Typ()==MATRIX_CMD)) 1184 1185 { … … 1195 1196 { 1196 1197 currRing->nc=(nc_struct *)omAlloc0(sizeof(nc_struct)); 1197 currRing->nc->MT=(matrix *)omAlloc0(pVariables*(pVariables-1)/2*sizeof(matrix));1198 currRing->nc->MTsize=(int *)omAlloc0(pVariables*(pVariables-1)/2*sizeof(int));1198 currRing->nc->MT=(matrix *)omAlloc0(currRing->N*(currRing->N-1)/2*sizeof(matrix)); 1199 currRing->nc->MTsize=(int *)omAlloc0(currRing->N*(currRing->N-1)/2*sizeof(int)); 1199 1200 } 1200 1201 else 1201 1202 { 1202 1203 WarnS("redefining algebra structure"); 1203 } 1204 } 1204 1205 currRing->nc->type=nc_general; 1205 1206 currRing->nc->C=C; 1206 1207 currRing->nc->D=D; 1207 { 1208 int i,j; 1209 poly p; 1210 short DefMTsize=7; 1211 int nv=pVariables; 1212 for(i=1;i<nv;i++) 1213 { 1214 for(j=i+1;j<=nv;j++) 1215 { 1216 currRing->nc->MTsize[UPMATELEM(i,j,curring->N)]=DefMTsize; /* default sizes */ 1217 currRing->nc->MT[UPMATELEM(i,j,curring->N)]=mpNew(DefMTsize,DefMTsize); 1208 COM=mpCopy(currRing->nc->C); 1209 int i,j; 1210 poly p; 1211 short DefMTsize=7; 1212 int nv=currRing->N; 1213 for(i=1;i<nv;i++) 1214 { 1215 for(j=i+1;j<=nv;j++) 1216 { 1217 if (MATELEM(D,i,j)==NULL) 1218 { 1219 currRing->nc->MTsize[UPMATELEM(i,j,currRing->N)]=0; 1220 } 1221 else 1222 { 1223 MATELEM(COM,i,j)=NULL; 1224 currRing->nc->MTsize[UPMATELEM(i,j,currRing->N)]=DefMTsize; /* default sizes */ 1225 currRing->nc->MT[UPMATELEM(i,j,currRing->N)]=mpNew(DefMTsize,DefMTsize); 1218 1226 p=pOne(); 1219 1227 pSetCoeff(p,nCopy(pGetCoeff(MATELEM(currRing->nc->C,i,j)))); … … 1222 1230 pSetm(p); 1223 1231 p=pAdd(p,pCopy(MATELEM(currRing->nc->D,i,j))); 1224 MATELEM(currRing->nc->MT[UPMATELEM(i,j,curring->N)],1,1)=p; 1225 /* set MT[i,j,1,1] to c_i_j*x_i*x_j + D_i_j */ 1232 MATELEM(currRing->nc->MT[UPMATELEM(i,j,currRing->N)],1,1)=p; 1226 1233 } 1227 } 1228 } 1229 // set p_Procs: 1230 // currRing->p_Procs->pp_Mult_mm =nc_pp_Mult_mm; 1231 // currRing->p_Procs->p_Mult_mm =nc_p_Mult_mm; 1232 // currRing->p_Procs->p_Minus_mm_Mult_qq =nc_p_Minus_mm_Mult_qq; 1233 1234 1235 /* set MT[i,j,1,1] to c_i_j*x_i*x_j + D_i_j */ 1236 } 1237 } 1238 1239 currRing->nc->COM=COM; 1234 1240 return FALSE; 1235 1241 } -
Singular/gring.cc
rd88b03 r0e4337 7 7 * Author: levandov (Viktor Levandovsky) 8 8 * Created: 8/00 - 11/00 9 * Version: $Id: gring.cc,v 1. 7 2001-02-23 16:44:13 levandov Exp $9 * Version: $Id: gring.cc,v 1.8 2001-02-26 15:08:43 levandov Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" 12 #ifdef HAVE_PLURAL 12 13 #include "gring.h" 13 #ifdef HAVE_PLURAL 14 #include "febase.h" 15 #include "ring.h" 16 #include "polys.h" 17 #include "numbers.h" 18 #include "ideals.h" 19 #include "matpol.h" 20 14 21 15 22 //global nc_macros : … … 39 46 /* destroy p,q */ 40 47 { 41 poly res= 0;42 poly ghost ;48 poly res=NULL; 49 poly ghost=NULL; 43 50 while (q!=NULL) 44 51 { 45 52 res=p_Add_q(res,nc_pp_Mult_mm(p,p_Head(q,r),r,ghost),r); 46 p_LmDeleteAndNext(q,r);53 q=p_LmDeleteAndNext(q,r); 47 54 } 48 55 p_Delete(&p,r); … … 117 124 out = p_Add_q(out,v,r); 118 125 // p_DeleteLm(&p,r); 119 p _LmDeleteAndNext(p,r);126 p=p_LmDeleteAndNext(p,r); 120 127 } 121 128 freeT(P,r->N); … … 586 593 number tmp_number=NULL; 587 594 588 // first check wether the polynom is alredy computed 595 //Now check zero exeptions, commutativity and should we do something at all? 596 out=pOne(); 597 p_SetExp(out,j,b,r); 598 p_SetExp(out,i,a,r); 599 if (i==j) p_SetExp(out,j,a+b,r); 600 p_Setm(out,r); 601 if ((a==0)||(b==0)||(i<=j)) return(out);//zero exeptions and usual case 602 603 if (MATELEM(r->nc->COM,j,i)!=NULL) 604 //commutative or quasicommutative case 605 { 606 if (r->cf->nIsOne(p_GetCoeff(MATELEM(r->nc->COM,j,i),r))) //commutative case 607 { 608 return(out); 609 } 610 else 611 { 612 tmp_number=p_GetCoeff(MATELEM(r->nc->COM,j,i),r); //quasicommutative case 613 nPower(tmp_number,a*b,&tmp_number); 614 p_SetCoeff(out,tmp_number,r); 615 return(out); 616 } 617 }// end commutative or quasicommutative case 618 619 //we are here if i>j and variables do not commute or quasicommute 620 //in fact, now a>=1 and b>=1; and j<i 621 // now check wether the polynom is alredy computed 589 622 int vik = UPMATELEM(j,i,r->N); 590 623 matrix cMT=r->nc->MT[vik]; … … 593 626 if (((a<cMTsize)&&(b<cMTsize))&&(MATELEM(cMT,a,b)!=NULL)) 594 627 { 595 out=p_Copy(MATELEM(cMT,a,b),r); 596 return (out); 597 } 598 599 //Now check zero exeptions, commutativity and should we do something at all? 600 out=pOne(); 601 p_SetExp(out,j,b,r); 602 p_SetExp(out,i,a,r); 603 if (i==j) p_SetExp(out,j,a+b,r); 604 p_Setm(out,r); 605 if ((a==0)||(b==0)||(i<=j)) return(out);//zero exeptions and usual case 606 607 if (p_GetCoeff(r->nc->COM[UPMATELEM(i,j,r->N)],r)!=0) //commutative or quasicommutative case 608 { 609 if (p_GetCoeff(r->nc->COM[UPMATELEM(i,j,r->N)],r)!=n_Init(1,r)) //commutative case 610 { 611 return(out); 612 } 613 else 614 { 615 tmp_number=p_GetCoeff(r->nc->COM[UPMATELEM(i,j,r->N)],r); //quasicommutative case 616 nPower(tmp_number,a*b,&tmp_number); 617 p_SetCoeff(out,tmp_number,r); 618 return(out); 619 } 620 }// end commutative or quasicommutative case 621 622 //we are here if i>j and variables do not commute or quasicommute 623 //in fact, now a>=1 and b>=1; and j<i 624 628 out=p_Copy(MATELEM(cMT,a,b),r); 629 return (out); 630 } 631 625 632 // poly C=MATELEM(r->nc->C,j,i); 626 633 // number c=p_GetCoeff(C,r); //coeff … … 628 635 629 636 int newcMTsize=0; 630 637 int k,m; 631 638 p_Delete(&out,r);//Shura thinks it is nesessary 639 632 640 633 641 if (a>=b) {newcMTsize=a;} else {newcMTsize=b;} … … 636 644 newcMTsize = newcMTsize+cMTsize; 637 645 matrix tmp = mpNew(newcMTsize,newcMTsize); 638 int k,m;639 646 640 647 for (k=1;k<r->N;k++) -
Singular/gring.h
rd88b03 r0e4337 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gring.h,v 1. 5 2001-02-23 16:28:24 levandov Exp $ */6 /* $Id: gring.h,v 1.6 2001-02-26 15:08:44 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT additional defines etc for --with-plural … … 11 11 #include "mod2.h" 12 12 #ifdef HAVE_PLURAL 13 #include "polys.h" // do we need it really? 14 #include "numbers.h" 15 #include "matpol.h" 16 /* #include "p_Procs.h" */ 17 #include "ideals.h" 13 #include "structs.h" 18 14 19 15 #define UPMATELEM(i,j,nVar) ( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) ) … … 27 23 poly nc_mm_Mult_uu (Exponent_t *F,int jG,int bG, const ring r); 28 24 poly nc_uu_Mult_ww (int i, int a, int j, int b, const ring r); 25 poly _nc_p_Mult_q(poly p, poly q, const int copy, const ring r); 29 26 30 27 #endif /* HAVE_PLURAL */ -
Singular/pInline2.h
rd88b03 r0e4337 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline2.h,v 1.2 6 2001-02-23 16:28:24 levandov Exp $9 * Version: $Id: pInline2.h,v 1.27 2001-02-26 15:08:44 levandov Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE2_H … … 26 26 #ifdef HAVE_PLURAL 27 27 #include "gring.h" 28 #include "ring.h" 28 29 #endif 29 30 -
Singular/structs.h
rd88b03 r0e4337 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.5 7 2001-02-20 09:45:43 SingularExp $ */6 /* $Id: structs.h,v 1.58 2001-02-26 15:08:45 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 353 353 matrix D; 354 354 matrix *MT; 355 matrix COM; 355 356 int *MTsize; 356 357 };
Note: See TracChangeset
for help on using the changeset viewer.