Changeset 7a5e7c in git for Singular/polys.cc
- Timestamp:
- Jun 12, 1998, 7:41:42 PM (26 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- 069fcf4380789e4c2f33f5e235d901d02dd871ba
- Parents:
- 60c7ad1963149772ccf27f5cca2b5ea93c1030d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/polys.cc
r60c7ad r7a5e7c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1. 29 1998-06-12 10:13:36 SingularExp $ */4 /* $Id: polys.cc,v 1.30 1998-06-12 17:41:33 obachman Exp $ */ 5 5 6 6 /* … … 164 164 } 165 165 166 static int pComp_otEXP_nwONE(poly p1, poly p2); 167 static int pComp_otCOMPEXP_nwONE(poly p1, poly p2); 168 static int pComp_otEXPCOMP_nwONE(poly p1, poly p2); 169 static int pComp_otEXP_nwTWO(poly p1, poly p2); 170 static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2); 171 static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2); 172 static int pComp_otEXP_nwEVEN(poly p1, poly p2); 173 static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2); 174 static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2); 175 static int pComp_otEXP_nwODD(poly p1, poly p2); 176 static int pComp_otCOMPEXP_nwODD(poly p1, poly p2); 177 static int pComp_otEXPCOMP_nwODD(poly p1, poly p2); 178 179 180 // comp_nwONE is used if pVariables1W == 1 and component is compatible 181 // with ordering 182 static int pComp_otEXP_nwONE(poly p1, poly p2) 166 167 static int pComp_otEXP(poly p1, poly p2); 168 static int pComp_otCOMPEXP(poly p1, poly p2); 169 static int pComp_otEXPCOMP(poly p1, poly p2); 170 171 static int pComp_otEXP(poly p1, poly p2) 183 172 { 184 173 register long d = pGetOrder(p1) - pGetOrder(p2); 185 186 174 if (d) Mreturn(d, pOrdSgn); 187 _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual, return 0); 188 175 176 _pMonComp_otEXP_nwGEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 177 189 178 NotEqual: 190 179 Mreturn(d, pLexSgn); 191 180 } 192 181 193 // comp_otEXPCOMP_nwONE : pVariables1W == 1, priority is 194 // given to exponents, component is incompatible with ordering 195 static int pComp_otEXPCOMP_nwONE(poly p1, poly p2) 196 { 197 register long d = pGetOrder(p1) - pGetOrder(p2); 198 199 if (d) Mreturn(d, pOrdSgn); 200 _pMonComp_otEXPCOMP_nwONE(p1, p2, d, goto NotEqual , return 0); 201 202 NotEqual: 203 Mreturn(d, pLexSgn) 204 } 205 206 // comp_otEXPCOMP_nwONE : pVariables1W == 1, priority is given to component, 207 // component is incompatible with ordering 208 static int pComp_otCOMPEXP_nwONE(poly p1, poly p2) 182 static int pComp_otCOMPEXP(poly p1, poly p2) 209 183 { 210 184 register long d = pGetComp(p2) - pGetComp(p1); 211 185 if (d) Mreturn(d, pComponentOrder); 186 212 187 d = pGetOrder(p1) - pGetOrder(p2); 213 188 if (d) Mreturn(d, pOrdSgn); 214 _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual , return 0); 215 189 190 _pMonComp_otEXP_nwGEN(p1, p2, pVariablesW, d, goto NotEqual , return 0); 191 216 192 NotEqual: 217 193 Mreturn(d, pLexSgn); 218 194 } 219 195 220 // comp_nwTWO : pVariables1W == 2 and component is compatible with ordering 221 static int pComp_otEXP_nwTWO(poly p1, poly p2) 196 static int pComp_otEXPCOMP(poly p1, poly p2) 222 197 { 223 198 register long d = pGetOrder(p1) - pGetOrder(p2); 224 225 199 if (d) Mreturn(d, pOrdSgn); 226 _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0); 227 200 201 _pMonComp_otEXPCOMP_nwGEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 202 228 203 NotEqual: 229 204 Mreturn(d, pLexSgn); 230 205 } 231 206 232 // comp_otEXPCOMP_nwTWO : pVariables1W == 2, priority is given to exponents, 233 // component is incompatible with ordering 234 static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2) 235 { 236 register long d = pGetOrder(p1) - pGetOrder(p2); 237 238 if (d) Mreturn(d, pOrdSgn); 239 _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, goto NotEqual, return 0); 240 241 NotEqual: 242 Mreturn(d, pLexSgn); 243 } 244 245 // comp_otEXPCOMP_nwTWO : pVariables1W == 2, priority is given to component, 246 // component is incompatible with ordering 247 static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2) 248 { 249 register long d = pGetComp(p2) - pGetComp(p1); 250 if (d) Mreturn(d, pComponentOrder); 251 d = pGetOrder(p1) - pGetOrder(p2); 252 if (d) Mreturn(d, pOrdSgn); 253 _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0); 254 255 NotEqual: 256 Mreturn(d, pLexSgn); 257 } 258 259 // comp_nwEVEN : pVariables1W == 2*i and component is compatible 260 // with ordering 261 static int pComp_otEXP_nwEVEN(poly p1, poly p2) 262 { 263 register long d = pGetOrder(p1) - pGetOrder(p2); 264 265 if (d) Mreturn(d, pOrdSgn); 266 _pMonComp_otEXP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 267 268 NotEqual: 269 Mreturn(d, pLexSgn); 270 } 271 272 // comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to exponents, 273 // component is incompatible with ordering 274 static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2) 275 { 276 register long d = pGetOrder(p1) - pGetOrder(p2); 277 278 if (d) Mreturn(d, pOrdSgn); 279 _pMonComp_otEXPCOMP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 280 281 NotEqual: 282 Mreturn(d, pLexSgn); 283 } 284 285 // comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to component, 286 // component is incompatible with ordering 287 static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2) 288 { 289 register long d = pGetComp(p2) - pGetComp(p1); 290 if (d) Mreturn(d, pComponentOrder); 291 d = pGetOrder(p1) - pGetOrder(p2); 292 if (d) Mreturn(d, pOrdSgn); 293 _pMonComp_otEXP_nwEVEN(p1, p2, pVariablesW, d, goto NotEqual, return 0); 294 295 NotEqual: 296 Mreturn(d, pLexSgn); 297 } 298 299 // comp_nwODD : pVariables1W == 2*i and component is compatible 300 // with ordering 301 static int pComp_otEXP_nwODD(poly p1, poly p2) 302 { 303 register long d = pGetOrder(p1) - pGetOrder(p2); 304 305 if (d) Mreturn(d, pOrdSgn); 306 _pMonComp_otEXP_nwODD(p1, p2, pVariables1W, d, goto NotEqual, return 0); 307 308 NotEqual: 309 Mreturn(d, pLexSgn); 310 } 311 312 // comp_otEXPCOMP_nwODD : pVariables1W == 2*i, priority is given to exponents, 313 // component is incompatible with ordering 314 static int pComp_otEXPCOMP_nwODD(poly p1, poly p2) 315 { 316 register long d = pGetOrder(p1) - pGetOrder(p2); 317 if (d) 318 { 319 if (d > 0) return pOrdSgn; 320 return -pOrdSgn; 321 } 322 323 _pMonComp_otEXPCOMP_nwODD(p1, p2, pVariables1W, d, goto NotEqual , return 0); 324 325 NotEqual: 326 Mreturn(d, pLexSgn); 327 } 328 329 // comp_otCOMPEXP_nwODD : pVariables1W == 2*i, priority is given to component, 330 // component is incompatible with ordering 331 static int pComp_otCOMPEXP_nwODD(poly p1, poly p2) 332 { 333 register long d = pGetComp(p2) - pGetComp(p1); 334 if (d) Mreturn(d, pComponentOrder); 335 d = pGetOrder(p1) - pGetOrder(p2); 336 if (d) Mreturn(d, pOrdSgn); 337 _pMonComp_otEXP_nwODD(p1, p2, pVariablesW, d, goto NotEqual, return 0); 338 339 NotEqual: 340 Mreturn(d, pLexSgn); 341 } 207 /*---------------------------------------------------*/ 208 342 209 /*2 343 210 * compare the head monomial of p1 and p2 with weight vector … … 353 220 } 354 221 355 /*---------------------------------------------------*/356 222 357 223 /* These functions could be made faster if you use pointers to the … … 1119 985 if (comp_order == ringorder_C || o_r == ringorder_unspec) 1120 986 { 1121 if (pVariables1W == 1) *p = pComp_otEXPCOMP_nwONE; 1122 else if (pVariables1W == 2) *p = pComp_otEXPCOMP_nwTWO; 1123 else if (pVariables1W & 1) *p = pComp_otEXPCOMP_nwODD; 1124 else *p = pComp_otEXPCOMP_nwEVEN; 987 *p = pComp_otEXPCOMP; 1125 988 } 1126 989 else 1127 990 { 1128 991 // component is compatible with exponent vector 1129 if (pVariables1W == 1) *p = pComp_otEXP_nwONE; 1130 else if (pVariables1W == 2) *p = pComp_otEXP_nwTWO; 1131 else if (pVariables1W & 1) *p = pComp_otEXP_nwODD; 1132 else *p = pComp_otEXP_nwEVEN; 992 *p = pComp_otEXP; 1133 993 } 1134 994 break; … … 1147 1007 if (comp_order == ringorder_c) 1148 1008 { 1149 if (pVariables1W == 1) *p = pComp_otEXPCOMP_nwONE; 1150 else if (pVariables1W == 2) *p = pComp_otEXPCOMP_nwTWO; 1151 else if (pVariables1W & 1) *p = pComp_otEXPCOMP_nwODD; 1152 else *p = pComp_otEXPCOMP_nwEVEN; 1009 *p = pComp_otEXPCOMP; 1153 1010 } 1154 1011 else 1155 1012 { 1156 1013 // component is compatible with exponent vector 1157 if (pVariables1W == 1) *p = pComp_otEXP_nwONE; 1158 else if (pVariables1W == 2) *p = pComp_otEXP_nwTWO; 1159 else if (pVariables1W & 1) *p = pComp_otEXP_nwODD; 1160 else *p = pComp_otEXP_nwEVEN; 1014 *p = pComp_otEXP; 1161 1015 } 1162 1016 #ifdef PDEBUG … … 1192 1046 pSetVarIndicies_RevLex(pVariables); 1193 1047 pLexSgn = -1; 1194 if (pVariablesW == 1) 1195 *p = pComp_otCOMPEXP_nwONE; 1196 else if (pVariablesW == 2) 1197 *p = pComp_otCOMPEXP_nwTWO; 1198 else if (pVariablesW & 1) 1199 *p = pComp_otCOMPEXP_nwODD; 1200 else 1201 *p = pComp_otCOMPEXP_nwEVEN; 1048 *p = pComp_otCOMPEXP; 1202 1049 break; 1203 1050 … … 1213 1060 pSetVarIndicies_Lex(pVariables); 1214 1061 pLexSgn = 1; 1215 if (pVariablesW == 1) 1216 *p = pComp_otCOMPEXP_nwONE; 1217 else if (pVariablesW == 2) 1218 *p = pComp_otCOMPEXP_nwTWO; 1219 else if (pVariablesW & 1) 1220 *p = pComp_otCOMPEXP_nwODD; 1221 else 1222 *p = pComp_otCOMPEXP_nwEVEN; 1062 *p = pComp_otCOMPEXP; 1223 1063 #ifdef PDEBUG 1224 1064 break;
Note: See TracChangeset
for help on using the changeset viewer.