Changeset c35d87 in git
- Timestamp:
- Apr 3, 2003, 3:22:00 PM (21 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 48d7c9636f8b5c6edaa03cf850cf8e868e5eb605
- Parents:
- 56216bbcb77c03ae9c5eb9842cc2e37d779e319b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r56216b rc35d87 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.29 4 2003-03-31 12:27:00 Singular Exp $ */4 /* $Id: iparith.cc,v 1.295 2003-04-03 13:22:00 Singular Exp $ */ 5 5 6 6 /* … … 60 60 #define ALLOW_PLURAL ,1 61 61 #define NO_PLURAL ,0 62 #define COMM_PLURAL ,2 62 63 #else 63 64 #define ALLOW_PLURAL 64 #define NO_PLURAL 65 #define NO_PLURAL 66 #define COMM_PLURAL 65 67 #endif 66 68 … … 83 85 short res; 84 86 short arg; 85 #ifdef HAVE_PLURAL 87 #ifdef HAVE_PLURAL 86 88 short valid_for_plural; 87 #endif 89 #endif 88 90 }; 89 91 … … 96 98 short arg1; 97 99 short arg2; 98 #ifdef HAVE_PLURAL 100 #ifdef HAVE_PLURAL 99 101 short valid_for_plural; 100 #endif 102 #endif 101 103 }; 102 104 … … 110 112 short arg2; 111 113 short arg3; 112 #ifdef HAVE_PLURAL 114 #ifdef HAVE_PLURAL 113 115 short valid_for_plural; 114 #endif 116 #endif 115 117 }; 116 118 struct sValCmdM … … 120 122 short res; 121 123 short number_of_args; /* -1: any, -2: any >0, .. */ 122 #ifdef HAVE_PLURAL 124 #ifdef HAVE_PLURAL 123 125 short valid_for_plural; 124 #endif 126 #endif 125 127 }; 126 128 #endif … … 740 742 v->name = omStrDup(v->name); 741 743 } 742 743 744 v->req_packhdl=IDPACKAGE(packhdl); 745 v->packhdl=IDPACKAGE(packhdl); 744 746 syMake(v, v->name, packhdl); 745 747 memcpy(res, v, sizeof(sleftv)); … … 5835 5837 { 5836 5838 res->rtyp=dArith2[i].res; 5839 #ifdef HAVE_PLURAL 5840 if ((currRing!=NULL) && (rIsPluralRing(currRing))) 5841 { 5842 if (dArith2[i].valid_for_plural==NO_PLURAL) 5843 { 5844 Werror("not implemented for non-commutative rings"); 5845 break; 5846 } 5847 else if (dArith2[i].valid_for_plural==COMM_PLURAL) 5848 { 5849 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 5850 } 5851 /* else ALLOW_PLURAL */ 5852 } 5853 #endif 5837 5854 if (dArith2[i].p(res,a,b)) 5838 5855 { … … 5863 5880 { 5864 5881 res->rtyp=dArith2[i].res; 5882 #ifdef HAVE_PLURAL 5883 if ((currRing!=NULL) && (rIsPluralRing(currRing))) 5884 { 5885 if (dArith2[i].valid_for_plural==NO_PLURAL) 5886 { 5887 Werror("not implemented for non-commutative rings"); 5888 break; 5889 } 5890 else if (dArith2[i].valid_for_plural==COMM_PLURAL) 5891 { 5892 Warn("assume commutative subalgebra for cmd `%s`, 5893 Tok2Cmdname(i)); 5894 } 5895 /* else ALLOW_PLURAL */ 5896 } 5897 #endif 5865 5898 failed= ((iiConvert(at,dArith2[i].arg1,ai,a,an)) 5866 5899 || (iiConvert(bt,dArith2[i].arg2,bi,b,bn)) … … 5981 6014 { 5982 6015 int r=res->rtyp=dArith1[i].res; 5983 #ifdef HAVE_PLURAL 5984 if ((currRing!=NULL) && (rIsPluralRing(currRing)) && (dArith1[i].valid_for_plural==0)) 5985 { 5986 Werror("not implemented for non-commutative rings"); 5987 break; 5988 } 5989 #endif 6016 #ifdef HAVE_PLURAL 6017 if ((currRing!=NULL) && (rIsPluralRing(currRing))) 6018 { 6019 if (dArith1[i].valid_for_plural==NO_PLURAL) 6020 { 6021 Werror("not implemented for non-commutative rings"); 6022 break; 6023 } 6024 else if (dArith1[i].valid_for_plural==COMM_PLURAL) 6025 { 6026 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 6027 } 6028 /* else ALLOW_PLURAL */ 6029 } 6030 #endif 5990 6031 if (r<0) 5991 6032 { … … 6024 6065 { 6025 6066 int r=res->rtyp=dArith1[i].res; 6026 #ifdef HAVE_PLURAL 6027 if ((currRing!=NULL) && (rIsPluralRing(currRing)) && (dArith1[i].valid_for_plural==0)) 6028 { 6029 Werror("not implemented for non-commutative rings"); 6030 break; 6031 } 6032 #endif 6067 #ifdef HAVE_PLURAL 6068 if ((currRing!=NULL) && (rIsPluralRing(currRing))) 6069 { 6070 if (dArith1[i].valid_for_plural==NO_PLURAL) 6071 { 6072 Werror("not implemented for non-commutative rings"); 6073 break; 6074 } 6075 else if (dArith1[i].valid_for_plural==COMM_PLURAL) 6076 { 6077 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 6078 } 6079 /* else ALLOW_PLURAL */ 6080 } 6081 #endif 6033 6082 if (r<0) 6034 6083 { … … 6145 6194 { 6146 6195 res->rtyp=dArith3[i].res; 6147 #ifdef HAVE_PLURAL 6148 if ((currRing!=NULL) && (rIsPluralRing(currRing)) && (dArith3[i].valid_for_plural==0)) 6149 { 6150 Werror("not implemented for non-commutative rings"); 6151 break; 6152 } 6153 #endif 6196 #ifdef HAVE_PLURAL 6197 if ((currRing!=NULL) && (rIsPluralRing(currRing))) 6198 { 6199 if (dArith3[i].valid_for_plural==NO_PLURAL) 6200 { 6201 Werror("not implemented for non-commutative rings"); 6202 break; 6203 } 6204 else if (dArith3[i].valid_for_plural==COMM_PLURAL) 6205 { 6206 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 6207 } 6208 /* else ALLOW_PLURAL */ 6209 } 6210 #endif 6154 6211 if (dArith3[i].p(res,a,b,c)) 6155 6212 { … … 6182 6239 { 6183 6240 res->rtyp=dArith3[i].res; 6184 #ifdef HAVE_PLURAL 6185 if ((currRing!=NULL) 6186 && (rIsPluralRing(currRing)) 6187 && (dArith3[i].valid_for_plural==0)) 6188 { 6189 Werror("not implemented for non-commutative rings"); 6190 break; 6191 } 6192 #endif 6241 #ifdef HAVE_PLURAL 6242 if ((currRing!=NULL) 6243 && (rIsPluralRing(currRing))) 6244 { 6245 if (dArith3[i].valid_for_plural==NO_PLURAL) 6246 { 6247 Werror("not implemented for non-commutative rings"); 6248 break; 6249 } 6250 else if (dArith3[i].valid_for_plural==COMM_PLURAL) 6251 { 6252 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 6253 } 6254 /* else ALLOW_PLURAL */ 6255 } 6256 #endif 6193 6257 failed= ((iiConvert(at,dArith3[i].arg1,ai,a,an)) 6194 6258 || (iiConvert(bt,dArith3[i].arg2,bi,b,bn)) … … 6325 6389 a->next->next->name=NULL; 6326 6390 a->next->next->attribute=NULL; 6327 6391 /* no break */ 6328 6392 case 2: 6329 6393 memcpy(&d->arg2,a->next,sizeof(sleftv)); … … 6333 6397 a->next->attribute=NULL; 6334 6398 d->arg2.next=NULL; 6335 6399 /* no break */ 6336 6400 case 1: 6337 6401 d->arg1.next=NULL; … … 6361 6425 { 6362 6426 res->rtyp=dArithM[i].res; 6363 #ifdef HAVE_PLURAL 6364 if ((currRing!=NULL) 6365 && (rIsPluralRing(currRing)) 6366 && (dArithM[i].valid_for_plural==0)) 6367 { 6368 Werror("not implemented for non-commutative rings"); 6369 break; 6370 } 6371 #endif 6427 #ifdef HAVE_PLURAL 6428 if ((currRing!=NULL) 6429 && (rIsPluralRing(currRing))) 6430 { 6431 if (dArithM[i].valid_for_plural==NO_PLURAL) 6432 { 6433 Werror("not implemented for non-commutative rings"); 6434 break; 6435 } 6436 else if (dArithM[i].valid_for_plural==COMM_PLURAL) 6437 { 6438 Warn("assume commutative subalgebra for cmd `%s`,Tok2Cmdname(i)); 6439 } 6440 /* else ALLOW_PLURAL */ 6441 } 6442 #endif 6372 6443 if (dArithM[i].p(res,a)) 6373 6444 {
Note: See TracChangeset
for help on using the changeset viewer.