Changeset ad25ace in git
- Timestamp:
- Apr 13, 2000, 3:01:49 PM (23 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 8e153e5516cee595e5037ab243fc9a0d54dad39e
- Parents:
- 4fc736efe01670e3ed92d3911fa633d760f79b7c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r4fc736e rad25ace 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.20 8 2000-04-11 15:40:22Singular Exp $ */4 /* $Id: iparith.cc,v 1.209 2000-04-13 13:01:49 Singular Exp $ */ 5 5 6 6 /* … … 117 117 extern BOOLEAN expected_parms; 118 118 119 #define ii_div_by_0 "div. by 0" 119 120 int iiOp; /* the current operation*/ 120 121 … … 1018 1019 if (b==0) 1019 1020 { 1020 WerrorS( "div. by 0");1021 WerrorS(ii_div_by_0); 1021 1022 return TRUE; 1022 1023 } … … 1044 1045 if (nIsZero(q)) 1045 1046 { 1046 WerrorS( "div. by 0");1047 WerrorS(ii_div_by_0); 1047 1048 return TRUE; 1048 1049 } … … 1057 1058 if (q==NULL) 1058 1059 { 1059 WerrorS( "div. by 0");1060 WerrorS(ii_div_by_0); 1060 1061 return TRUE; 1061 1062 } … … 1063 1064 { 1064 1065 #ifdef HAVE_FACTORY 1065 res->data=(void*)(singclap_pdivide((poly)(u->Data()), 1066 (poly)(v->Data()))); 1066 poly p=(poly)(u->Data()); 1067 if(pGetComp(p)==0) 1068 { 1069 res->data=(void*)(singclap_pdivide(p /*(poly)(u->Data())*/ , 1070 q /*(poly)(v->Data())*/ )); 1071 } 1072 else 1073 { 1074 int comps=pMaxComp(p); 1075 ideal I=idInit(comps,1); 1076 p=(poly)(u->CopyD()); 1077 poly h; 1078 int i; 1079 // conversio to a list of polys: 1080 while (p!=NULL) 1081 { 1082 i=pGetComp(p)-1; 1083 h=pNext(p); 1084 pNext(p)=NULL; 1085 pSetComp(p,0); 1086 I->m[i]=pAdd(I->m[i],p); 1087 p=h; 1088 } 1089 // division and conversion to vector: 1090 h=NULL; 1091 p=NULL; 1092 for(i=comps-1;i>=0;i--) 1093 { 1094 if (I->m[i]!=NULL) 1095 { 1096 h=singclap_pdivide(I->m[i],q); 1097 pSetCompP(h,i+1); 1098 p=pAdd(p,h); 1099 } 1100 } 1101 idDelete(&I); 1102 res->data=(void *)p; 1103 } 1067 1104 #else 1068 1105 WerrorS("division only by a monomial");
Note: See TracChangeset
for help on using the changeset viewer.