Changeset 8fc5558 in git
- Timestamp:
- Mar 17, 1998, 11:59:57 AM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 1e9da80e5772d69c637a702b3937bddd689925a4
- Parents:
- 399efbe1493f787ca072ee4e9b85f144549f7bbc
- Location:
- Singular
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
r399efb r8fc5558 294 294 295 295 distclean: clean 296 -rm -rf depend iparith.inc mpsr_Tok.inc ${DIST_NAME} ${testdir}/out stamp-h 296 -rm -rf depend iparith.inc mpsr_Tok.inc spSpolyLoop.inc 297 -rm -rf ${DIST_NAME} ${testdir}/out stamp-h 297 298 -rm mod2.h Makefile TAGS* config.status config.cache config.log 298 299 cd ${docdir}; ${MAKE} distclean … … 300 301 maintainer-clean: distclean 301 302 @echo "This command is intended for maintainers to use;" 302 @echo "Rebuilding the deleted files requires flex (version 2.3)"303 @echo "Rebuilding the deleted files requires flex" 303 304 @echo "bison and autoconf" 304 -rm configure scanner.cc grammar.h grammar.cc 305 -rm configure scanner.cc grammar.h grammar.cc libparse.cc 305 306 306 307 info dvi ps html: -
Singular/polys-comp.h
r399efb r8fc5558 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-comp.h,v 1. 5 1998-03-16 14:56:38obachman Exp $ */6 /* $Id: polys-comp.h,v 1.6 1998-03-17 10:59:56 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 15 15 #include "polys-impl.h" 16 16 17 #ifdef COMP_FAST18 19 20 21 17 #ifdef WORDS_BIGENDIAN 22 #ifndef COMP_NO_EXP_VECTOR_OPS 23 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) 18 19 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 24 20 do \ 25 21 { \ … … 30 26 while(0) 31 27 32 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 33 do \ 34 { \ 35 d = *((long*) &(p1->exp[0])) - *((long*) &(p2->exp[0])); \ 36 if (d) \ 37 { \ 38 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 39 d = -d; \ 40 actionD; \ 41 } \ 42 actionE; \ 43 } \ 44 while(0) 45 46 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 47 do \ 48 { \ 49 const long* s1 = (long*) &(p1->exp[0]); \ 50 const long* s2 = (long*) &(p2->exp[0]); \ 51 d = *s1 - *s2; \ 52 if (d) actionD; \ 53 d = *(s1 + 1) - *(s2 + 1); \ 54 if (d) actionD; \ 55 actionE; \ 56 } \ 57 while(0) 58 59 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 60 do \ 61 { \ 62 const long* s1 = (long*) &(p1->exp[0]); \ 63 const long* s2 = (long*) &(p2->exp[0]); \ 64 d = *s1 - *s2; \ 65 if (d) actionD; \ 66 d = *(s1 + 1) - *(s2 + 1); \ 67 if (d) \ 68 { \ 69 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 70 d = -d; \ 71 actionD; \ 72 } \ 73 actionE; \ 74 } \ 75 while(0) 76 77 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 78 do \ 79 { \ 80 const long* s1 = (long*) &(p1->exp[0]); \ 81 const long* s2 = (long*) &(p2->exp[0]); \ 82 const long* const lb = s1 + length; \ 83 \ 84 for (;;) \ 85 { \ 86 d = *s1 - *s2; \ 87 if (d) actionD; \ 88 s1++; \ 89 s2++; \ 90 d = *s1 - *s2; \ 91 if (d) actionD; \ 92 s1++; \ 93 if (s1 == lb) actionE; \ 94 s2++; \ 95 } \ 96 } \ 97 while(0) 98 99 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 100 do \ 101 { \ 102 const long* s1 = (long*) &(p1->exp[0]); \ 103 const long* s2 = (long*) &(p2->exp[0]); \ 104 const long* const lb = s1 + length; \ 105 \ 106 for (;;) \ 107 { \ 108 d = *s1 - *s2; \ 109 if (d) actionD; \ 110 s1++; \ 111 if (s1 == lb) actionE; \ 112 s2++; \ 113 d = *s1 - *s2; \ 114 if (d) actionD; \ 115 s1++; \ 116 s2++; \ 117 } \ 118 } \ 119 while(0) 120 121 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 122 do \ 123 { \ 124 const long* s1 = (long*) &(p1->exp[0]); \ 125 const long* s2 = (long*) &(p2->exp[0]); \ 126 const long* const lb = s1 + length-1; \ 127 \ 128 for (;;) \ 129 { \ 130 d = *s1 - *s2; \ 131 if (d) actionD; \ 132 s1++; \ 133 if (s1 == lb) break; \ 134 s2++; \ 135 d = *s1 - *s2; \ 136 if (d) actionD; \ 137 s1++; \ 138 s2++; \ 139 } \ 140 \ 141 d = *s1 - *(s2 + 1); \ 142 if (d) \ 143 { \ 144 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 145 d = -d; \ 146 actionD; \ 147 } \ 148 actionE; \ 149 } \ 150 while(0) 151 152 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 28 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 153 29 do \ 154 30 { \ 155 const long* s1 = (long*) &(p1->exp[0]); \ 156 const long* s2 = (long*) &(p2->exp[0]); \ 157 const long* const lb = s1 + length -1; \ 158 \ 159 for (;;) \ 160 { \ 161 d = *s1 - *s2; \ 162 if (d) actionD; \ 163 s1++; \ 164 s2++; \ 165 d = *s1 - *s2; \ 166 if (d) actionD; \ 167 s1++; \ 168 if (s1 == lb) break; \ 169 s2++; \ 170 } \ 171 \ 172 d = *s1 - *(s2 + 1); \ 31 d = *((long*) &(p1->exp[0])) - *((long*) &(p2->exp[0])); \ 173 32 if (d) \ 174 33 { \ … … 181 40 while(0) 182 41 183 #else // COMP_NO_EXP_VECTOR_OPS184 185 #define _pMonCmp(p1, p2, d, actionD, actionE) \186 do \187 { \188 Exponent_pt e1 = &(p1->exp[0]); \189 Exponent_pt e2 = &(p2->exp[0]); \190 const Exponent_pt ub = e1 + pVariables; \191 \192 for (;;) \193 { \194 d = *e1 - *e2; \195 if (d) actionD; \196 e1++; \197 if (e1 == ub) \198 { \199 d = pGetComp(p1) - pGetComp(p2); \200 if (d) actionD; \201 actionE; \202 } \203 e2++; \204 } \205 } \206 while(0)207 208 #define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \209 do \210 { \211 Exponent_pt e1 = &(p1->exp[0]); \212 Exponent_pt e2 = &(p2->exp[0]); \213 const Exponent_pt ub = e1 + pVariables; \214 \215 for (;;) \216 { \217 d = *e1 - *e2; \218 if (d) actionD; \219 e1++; \220 if (e1 == ub) \221 { \222 d = pGetComp(p2) - pGetComp(p1); \223 if (d) actionD; \224 actionE; \225 } \226 e2++; \227 } \228 } \229 while(0)230 231 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \232 _pMonCmp(p1, p2, d, actionD, actionE)233 234 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \235 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE)236 237 42 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 238 _pMonCmp(p1, p2, d, actionD, actionE) 239 43 do \ 44 { \ 45 const long* s1 = (long*) &(p1->exp[0]); \ 46 const long* s2 = (long*) &(p2->exp[0]); \ 47 d = *s1 - *s2; \ 48 if (d) actionD; \ 49 d = *(s1 + 1) - *(s2 + 1); \ 50 if (d) actionD; \ 51 actionE; \ 52 } \ 53 while(0) 54 240 55 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 241 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 56 do \ 57 { \ 58 const long* s1 = (long*) &(p1->exp[0]); \ 59 const long* s2 = (long*) &(p2->exp[0]); \ 60 d = *s1 - *s2; \ 61 if (d) actionD; \ 62 d = *(s1 + 1) - *(s2 + 1); \ 63 if (d) \ 64 { \ 65 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 66 d = -d; \ 67 actionD; \ 68 } \ 69 actionE; \ 70 } \ 71 while(0) 242 72 243 73 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 244 _pMonCmp(p1, p2, d, actionD, actionE) 245 246 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 247 _pMonCmp(p1, p2, d, actionD, actionE) 248 249 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 250 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 251 252 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 253 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 254 255 #endif // COMP_NO_EXP_VECTOR_OPS 74 do \ 75 { \ 76 const long* s1 = (long*) &(p1->exp[0]); \ 77 const long* s2 = (long*) &(p2->exp[0]); \ 78 const long* const lb = s1 + length; \ 79 \ 80 for (;;) \ 81 { \ 82 d = *s1 - *s2; \ 83 if (d) actionD; \ 84 s1++; \ 85 s2++; \ 86 d = *s1 - *s2; \ 87 if (d) actionD; \ 88 s1++; \ 89 if (s1 == lb) actionE; \ 90 s2++; \ 91 } \ 92 } \ 93 while(0) 94 95 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 96 do \ 97 { \ 98 const long* s1 = (long*) &(p1->exp[0]); \ 99 const long* s2 = (long*) &(p2->exp[0]); \ 100 const long* const lb = s1 + length; \ 101 \ 102 for (;;) \ 103 { \ 104 d = *s1 - *s2; \ 105 if (d) actionD; \ 106 s1++; \ 107 if (s1 == lb) actionE; \ 108 s2++; \ 109 d = *s1 - *s2; \ 110 if (d) actionD; \ 111 s1++; \ 112 s2++; \ 113 } \ 114 } \ 115 while(0) 116 117 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 118 do \ 119 { \ 120 const long* s1 = (long*) &(p1->exp[0]); \ 121 const long* s2 = (long*) &(p2->exp[0]); \ 122 const long* const lb = s1 + length-1; \ 123 \ 124 for (;;) \ 125 { \ 126 d = *s1 - *s2; \ 127 if (d) actionD; \ 128 s1++; \ 129 if (s1 == lb) break; \ 130 s2++; \ 131 d = *s1 - *s2; \ 132 if (d) actionD; \ 133 s1++; \ 134 s2++; \ 135 } \ 136 \ 137 d = *s1 - *(s2 + 1); \ 138 if (d) \ 139 { \ 140 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 141 d = -d; \ 142 actionD; \ 143 } \ 144 actionE; \ 145 } \ 146 while(0) 147 148 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 149 do \ 150 { \ 151 const long* s1 = (long*) &(p1->exp[0]); \ 152 const long* s2 = (long*) &(p2->exp[0]); \ 153 const long* const lb = s1 + length -1; \ 154 \ 155 for (;;) \ 156 { \ 157 d = *s1 - *s2; \ 158 if (d) actionD; \ 159 s1++; \ 160 s2++; \ 161 d = *s1 - *s2; \ 162 if (d) actionD; \ 163 s1++; \ 164 if (s1 == lb) break; \ 165 s2++; \ 166 } \ 167 \ 168 d = *s1 - *(s2 + 1); \ 169 if (d) \ 170 { \ 171 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 172 d = -d; \ 173 actionD; \ 174 } \ 175 actionE; \ 176 } \ 177 while(0) 256 178 257 179 #else // ! WORDS_BIGENDIAN 258 180 259 #ifndef COMP_NO_EXP_VECTOR_OPS 260 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 181 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 261 182 do \ 262 183 { \ … … 267 188 while(0) 268 189 269 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) 190 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 270 191 do \ 271 192 { \ … … 282 203 283 204 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 284 do \285 { \286 const long* s1 = ((long*) p1) + pMonomSizeW-1; \287 const long* s2 = ((long*) p2) + pMonomSizeW-1; \288 d = *s1 - *s2; \289 if (d) actionD; \290 d = *(s1 - 1) - *(s2 - 1); \291 if (d) actionD; \292 actionE; \293 } \294 while(0)295 296 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \297 do \298 { \299 const long* s1 = ((long*) p1) + pMonomSizeW-1; \300 const long* s2 = ((long*) p2) + pMonomSizeW-1; \301 d = *s1 - *s2; \302 if (d) actionD; \303 d = *s1 - *s2; \304 if (d) actionD; \305 d = *(s1 -1) - *(s2 -1); \306 if (d) \307 { \308 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \309 d = -d; \310 actionD; \311 } \312 actionE; \313 } \314 while(0)315 316 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \317 do \318 { \319 const long* s1 = ((long*) p1) + pMonomSizeW-1; \320 const long* s2 = ((long*) p2) + pMonomSizeW-1; \321 const long* const lb = s1 - length; \322 for (;;) \323 { \324 d = *s1 - *s2; \325 if (d) actionD; \326 s1--; \327 s2--; \328 d = *s1 - *s2; \329 if (d) actionD; \330 s1--; \331 if (s1 == lb) actionE; \332 s2--; \333 } \334 } \335 while(0)336 337 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \338 205 do \ 339 206 { \ 340 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 341 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 342 const long* const lb = s1 - length; \ 343 \ 344 for (;;) \ 345 { \ 346 d = *s1 - *s2; \ 347 if (d) actionD; \ 348 s1--; \ 349 if (s1 == lb) actionE; \ 350 s2--; \ 351 d = *s1 - *s2; \ 352 if (d) actionD; \ 353 s1--; \ 354 s2--; \ 355 } \ 356 } \ 357 while(0) 358 359 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 360 do \ 361 { \ 362 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 363 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 364 const long* const lb = s1 - length +1; \ 365 \ 366 for (;;) \ 367 { \ 368 d = *s1 - *s2; \ 369 if (d) actionD; \ 370 s1--; \ 371 if (s1 == lb) break; \ 372 s2--; \ 373 d = *s1 - *s2; \ 374 if (d) actionD; \ 375 s1--; \ 376 s2--; \ 377 } \ 378 \ 379 d = *s1 - *(s2 - 1); \ 380 if (d) \ 381 { \ 382 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 383 d = -d; \ 384 actionD; \ 385 } \ 207 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 208 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 209 d = *s1 - *s2; \ 210 if (d) actionD; \ 211 d = *(s1 - 1) - *(s2 - 1); \ 212 if (d) actionD; \ 386 213 actionE; \ 387 214 } \ 388 215 while(0) 389 216 390 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \391 do \392 { \393 const long* s1 = ((long*) p1) + pMonomSizeW-1; \394 const long* s2 = ((long*) p2) + pMonomSizeW-1; \395 const long* const lb = s1 - length +1; \396 \397 for (;;) \398 { \399 d = *s1 - *s2; \400 if (d) actionD; \401 s1--; \402 s2--; \403 d = *s1 - *s2; \404 if (d) actionD; \405 s1--; \406 if (s1 == lb) break; \407 s2--; \408 } \409 \410 d = *s1 - *(s2 - 1); \411 if (d) \412 { \413 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \414 d = -d; \415 actionD; \416 } \417 actionE; \418 } \419 while(0)420 421 #else // COMP_NO_EXP_VECTOR_OPS422 423 #define _pMonCmp(p1, p2, d, actionD, actionE) \424 do \425 { \426 Exponent_pt e1 = &(p1->exp[pVarHighIndex]); \427 Exponent_pt e2 = &(p2->exp[pVarHighIndex]); \428 const Exponent_pt ub = e1 - pVariables; \429 \430 for (;;) \431 { \432 d = *e1 - *e2; \433 if (d) actionD; \434 e1--; \435 if (e1 == ub) \436 { \437 d = pGetComp(p1) - pGetComp(p2); \438 if (d) actionD; \439 actionE; \440 } \441 e2--; \442 } \443 } \444 while(0)445 446 #define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \447 do \448 { \449 Exponent_pt e1 = &(p1->exp[pVarHighIndex]); \450 Exponent_pt e2 = &(p2->exp[pVarHighIndex]); \451 const Exponent_pt ub = e1 - pVariables; \452 \453 for (;;) \454 { \455 d = *e1 - *e2; \456 if (d) actionD; \457 e1--; \458 if (e1 == ub) \459 { \460 d = pGetComp(p2) - pGetComp(p1); \461 if (d) actionD; \462 actionE; \463 } \464 e2--; \465 } \466 } \467 while(0)468 469 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \470 _pMonCmp(p1, p2, d, actionD, actionE)471 472 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \473 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE)474 475 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \476 _pMonCmp(p1, p2, d, actionD, actionE)477 478 217 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 479 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 218 do \ 219 { \ 220 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 221 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 222 d = *s1 - *s2; \ 223 if (d) actionD; \ 224 d = *s1 - *s2; \ 225 if (d) actionD; \ 226 d = *(s1 -1) - *(s2 -1); \ 227 if (d) \ 228 { \ 229 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 230 d = -d; \ 231 actionD; \ 232 } \ 233 actionE; \ 234 } \ 235 while(0) 480 236 481 237 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 482 _pMonCmp(p1, p2, d, actionD, actionE) 483 484 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 485 _pMonCmp(p1, p2, d, actionD, actionE) 486 487 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 488 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 489 490 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 491 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 492 493 #endif // COMP_NO_EXP_VECTOR_OPS 494 238 do \ 239 { \ 240 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 241 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 242 const long* const lb = s1 - length; \ 243 for (;;) \ 244 { \ 245 d = *s1 - *s2; \ 246 if (d) actionD; \ 247 s1--; \ 248 s2--; \ 249 d = *s1 - *s2; \ 250 if (d) actionD; \ 251 s1--; \ 252 if (s1 == lb) actionE; \ 253 s2--; \ 254 } \ 255 } \ 256 while(0) 257 258 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 259 do \ 260 { \ 261 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 262 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 263 const long* const lb = s1 - length; \ 264 \ 265 for (;;) \ 266 { \ 267 d = *s1 - *s2; \ 268 if (d) actionD; \ 269 s1--; \ 270 if (s1 == lb) actionE; \ 271 s2--; \ 272 d = *s1 - *s2; \ 273 if (d) actionD; \ 274 s1--; \ 275 s2--; \ 276 } \ 277 } \ 278 while(0) 279 280 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 281 do \ 282 { \ 283 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 284 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 285 const long* const lb = s1 - length +1; \ 286 \ 287 for (;;) \ 288 { \ 289 d = *s1 - *s2; \ 290 if (d) actionD; \ 291 s1--; \ 292 if (s1 == lb) break; \ 293 s2--; \ 294 d = *s1 - *s2; \ 295 if (d) actionD; \ 296 s1--; \ 297 s2--; \ 298 } \ 299 \ 300 d = *s1 - *(s2 - 1); \ 301 if (d) \ 302 { \ 303 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 304 d = -d; \ 305 actionD; \ 306 } \ 307 actionE; \ 308 } \ 309 while(0) 310 311 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 312 do \ 313 { \ 314 const long* s1 = ((long*) p1) + pMonomSizeW-1; \ 315 const long* s2 = ((long*) p2) + pMonomSizeW-1; \ 316 const long* const lb = s1 - length +1; \ 317 \ 318 for (;;) \ 319 { \ 320 d = *s1 - *s2; \ 321 if (d) actionD; \ 322 s1--; \ 323 s2--; \ 324 d = *s1 - *s2; \ 325 if (d) actionD; \ 326 s1--; \ 327 if (s1 == lb) break; \ 328 s2--; \ 329 } \ 330 \ 331 d = *s1 - *(s2 - 1); \ 332 if (d) \ 333 { \ 334 if (((long) (pGetComp(p1) - pGetComp(p2))) == d) \ 335 d = -d; \ 336 actionD; \ 337 } \ 338 actionE; \ 339 } \ 340 while(0) 341 495 342 #endif // WORDS_BIGENDIAN 496 343 497 #endif // COMP_FAST498 499 344 #endif // POLYS_COMP_H 500 345 -
Singular/polys-impl.h
r399efb r8fc5558 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-impl.h,v 1.1 8 1998-03-16 14:56:38obachman Exp $ */6 /* $Id: polys-impl.h,v 1.19 1998-03-17 10:59:57 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 19 19 #include "structs.h" 20 20 #include "mmemory.h" 21 #include "binom.h"22 21 23 22 /*************************************************************** … … 36 35 37 36 typedef long Order_t; 38 // make sure that exp is aligned39 37 struct spolyrec 40 38 { … … 42 40 number coef; 43 41 Order_t Order; 44 #ifdef TEST_MAC_DEBUG 45 Order_t MOrder; 46 #endif 47 monomial exp; 42 monomial exp; // make sure that exp is aligned 48 43 }; 49 44 45 50 46 /*************************************************************** 51 * MACROS CONTROLING MONOMIAL COMPARIONS: 52 53 * COMP_TRADITIONAL 54 Keeps the traditional comparison routines 55 defined -- needed as long as their might be comparisons with 56 negativ components. 57 All the traditional routines are prefixed by t_ 58 59 * COMP_FAST 60 Implements monomial operations using the fast vector 61 techniques and several other extensions which go along with that. 62 Undefine in case there are problems. 63 64 * COMP_STATISTIC 65 Provides several routines for accumulating statistics on monomial 66 comparisons and divisibility tests 67 68 * COMP_DEBUG 69 Turns on debugging of COMP_FAST by comparing the results of fast 70 comparison with traditional comparison 71 72 * COMP_NO_EXP_VECTOR_OPS 73 Like COMP_FAST, except that it turns off "vector techniques" of 74 monomial operations, i.e. does everything exponent-wise. 47 * 48 * variables/defines used for managment of monomials 49 * 75 50 ***************************************************************/ 76 #define COMP_FAST 77 // #define COMP_DEBUG 78 // #define COMP_NO_EXP_VECTOR_OPS 79 #define COMP_TRADITIONAL 80 81 #if defined(COMP_NO_EXP_VECTOR_OPS) && ! defined(COMP_FAST) 82 #define COMP_FAST 83 #endif 84 85 #if defined(COMP_FAST) && ! defined(NDEBUG) 86 #define COMP_DEBUG 87 #endif 88 89 // some relations between these flags 90 #ifdef COMP_DEBUG 91 #define COMP_TRADITIONAL 92 #define COMP_FAST 93 #undef COMP_PROFILE 94 #undef COMP_STATISTICS 95 #endif // COMP_DEBUG 96 97 #ifdef COMP_STATISTICS 98 #undef COMP_FAST 99 #endif // COMP_STATISTICS 100 101 // for the time being COMP_TRADITIONAL always has to be defined, since 102 // traditional routines are needed in spolys.cc -- monomials with 103 // negative exponents are compared there! 104 #define COMP_TRADITIONAL 105 106 /*************************************************************** 107 * 108 * variables used for storage management and monomial traversions 109 * 110 ***************************************************************/ 111 112 // size of poly without exponents 113 #ifdef TEST_MAC_DEBUG 114 #define POLYSIZE (sizeof(poly) + sizeof(number) + 2*sizeof(Order_t)) 115 #else 51 116 52 #define POLYSIZE (sizeof(poly) + sizeof(number) + sizeof(Order_t)) 117 #endif118 53 #define POLYSIZEW (POLYSIZE / sizeof(long)) 119 54 // number of Variables … … 123 58 // size of a monom in units of sizeof(void*) -- i.e. in words 124 59 extern int pMonomSizeW; 125 #ifdef COMP_FAST126 60 // Ceiling((pVariables+1) / sizeof(void*)) == length of exp-vector in words 127 61 extern int pVariables1W; 128 62 // Ceiling((pVariables) / sizeof(void*)) 129 63 extern int pVariablesW; 130 extern int pCompIndex;131 64 extern int pVarOffset; 132 65 extern int pVarLowIndex; 133 66 extern int pVarHighIndex; 134 #else135 #define pCompIndex 0136 #endif137 67 138 68 /*************************************************************** … … 146 76 // 147 77 // BIGENDIAN -- lex order 148 // e_1, e_2, ... , e_n,..,comp : pVarOffset = -1, 149 // pCompIndex = pVariables + #(..) 78 // e_1, e_2, ... , e_n,comp,.. : pVarOffset = -1, 150 79 // pVarLowIndex = 0, 151 80 // pVarHighIndex = pVariables-1 81 // P_COMP_INDEX = pVariables 152 82 // BIGENDIAN -- rev lex order 153 // e_n, ... , e_2, e_1,..,comp : pVarOffset = pVariables, 154 // pCompIndex = pVariables + #(..) 83 // e_n, ... , e_2, e_1,comp,.. : pVarOffset = pVariables, 155 84 // pVarLowIndex = 0, 156 85 // pVarHighIndex = pVariables-1 86 // P_COMP_INDEX = pVariables 157 87 // LITTLEENDIAN -- rev lex order 158 88 // comp,.., e_1, e_2, ... , e_n : pVarOffset = #(..), 159 // pCompIndex = 0,160 89 // pVarLowIndex = 1 + #(..), 161 90 // pVarHighIndex = #(..) + pVariables 91 // P_COMP_INDEX = pVariables 162 92 // LITTLEENDIAN -- lex order 163 93 // comp,..,e_n, .... , e_2, e_1 : pVarOffset = pVariables + 1 + #(..) 164 // pCompIndex = 0165 94 // pVarLowIndex = 1 + #(..) 166 95 // pVarHighIndex = #(..) + pVariables 96 // P_COMP_INDEX = pVariables 167 97 // 168 98 // Furthermore, the size of the exponent vector is always a multiple … … 170 100 // filled in between comp and first/last exponent -- i.e. comp and 171 101 // first/last exponent might not be next to each other 172 173 #ifdef COMP_FAST174 102 175 103 #ifdef WORDS_BIGENDIAN … … 193 121 #endif // WORDS_BIGENDIAN 194 122 195 inline void pGetVarIndicies_Lex(int nvars, 196 int &VarOffset, int &VarCompIndex, 123 inline void pGetVarIndicies_Lex(int nvars, int &VarOffset, 197 124 int &VarLowIndex, int &VarHighIndex) 198 125 { 126 #ifdef WORDS_BIGENDIAN 127 VarOffset = -1; 128 VarLowIndex = 0; 129 VarHighIndex = nvars - 1; 130 #else // ! WORDS_BIGENDIAN 199 131 long temp = (nvars+1)*sizeof(Exponent_t); 200 132 if ((temp % sizeof(long)) == 0) … … 202 134 else 203 135 temp = (temp / sizeof(long)) + 1; // now temp == nvars1W 136 VarHighIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1; 137 VarLowIndex = VarHighIndex - nvars + 1; 138 VarOffset = VarHighIndex + 1; 139 #endif // WORDS_BIGENDIAN 140 } 141 142 #define pSetVarIndicies_Lex(nvars) \ 143 pGetVarIndicies_Lex(nvars,pVarOffset,pVarLowIndex,pVarHighIndex) 144 145 146 inline void pGetVarIndicies_RevLex(int nvars, int &VarOffset, 147 int &VarLowIndex, int &VarHighIndex) 148 { 204 149 #ifdef WORDS_BIGENDIAN 205 VarCompIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1; 206 VarOffset = -1; 150 VarOffset = nvars; 207 151 VarLowIndex = 0; 208 VarHighIndex = nvars -1;152 VarHighIndex = nvars-1; 209 153 #else // ! WORDS_BIGENDIAN 210 VarHighIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1;211 VarCompIndex = 0;212 VarOffset = VarHighIndex + 1;213 VarLowIndex = VarOffset - nvars;214 #endif // WORDS_BIGENDIAN215 }216 #define pSetVarIndicies_Lex(nvars) \217 pGetVarIndicies_Lex(nvars,pVarOffset,pCompIndex,pVarLowIndex,pVarHighIndex)218 219 inline void pGetVarIndicies_RevLex(int nvars,220 int &VarOffset, int &VarCompIndex,221 int &VarLowIndex, int &VarHighIndex)222 {223 154 long temp = (nvars+1)*sizeof(Exponent_t); 224 155 if ((temp % sizeof(long)) == 0) … … 226 157 else 227 158 temp = (temp / sizeof(long)) + 1; 228 #ifdef WORDS_BIGENDIAN229 VarCompIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1;230 VarOffset = nvars;231 VarLowIndex = 0;232 VarHighIndex = nvars-1;233 #else // ! WORDS_BIGENDIAN234 // comp, ..., e_1, e_2, ... , e_n235 159 VarHighIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1; 236 VarCompIndex = 0;237 160 VarLowIndex = VarHighIndex - nvars + 1; 238 161 VarOffset = VarLowIndex - 1; 239 162 #endif // WORDS_BIGENDIAN 240 163 } 164 #ifdef WORDS_BIGENDIAN 241 165 #define pSetVarIndicies_RevLex(nvars) \ 242 166 pGetVarIndicies_RevLex(nvars,pVarOffset,pCompIndex,pVarLowIndex,pVarHighIndex) 167 #else 168 #define pSetVarIndicies_RevLex(nvars) \ 169 pGetVarIndicies_RevLex(nvars,pVarOffset,pVarLowIndex, pVarLowIndex,pVarHighIndex) 170 #endif 243 171 244 172 // The default settings:
Note: See TracChangeset
for help on using the changeset viewer.