Changeset 1b816a3 in git
- Timestamp:
- Jul 6, 2010, 2:35:39 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- a23b2107d8a272d2243292dc7d9703920aa2bd55
- Parents:
- 208cd5146dbce262234140fd61a3065eb0660935
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-07-06 14:35:39+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:22+01:00
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/coeffs.h
r208cd5 r1b816a3 261 261 static inline BOOLEAN n_GreaterZero(number n, const coeffs r){ return (r)->cfGreaterZero(n,r); } 262 262 // cfGreater? 263 #ifdef HAVE_RINGS 264 static inline BOOLEAN n_IsUnit(number n, const coeffs r) { return r->cfIsUnit(n,r); } 265 #endif 263 266 264 267 /// init with an integer -
polys/monomials/p_polys.cc
r208cd5 r1b816a3 11 11 12 12 13 #include < kernel/mod2.h>14 15 #include <kernel/structs.h>16 #include <kernel/p_polys.h>17 #include <kernel/ring.h>18 #include <kernel/ideals.h>19 #include <kernel/int64vec.h>13 #include <auxialiary.h> 14 15 #include "ring.h" 16 #include "p_polys.h" 17 #include "ring.h" 18 #include "ideals.h" 19 #include "int64vec.h" 20 20 #ifndef NDEBUG 21 21 #include <kernel/febase.h> … … 230 230 } 231 231 } 232 #endif233 234 #ifndef NDEBUG235 232 #if MYTEST 236 PrintS("Initial Value: "); p_DebugPrint(p, r, r, 1); 233 // if( p->exp[o->data.isTemp.start] > 0 ) 234 // { 235 // PrintS("Initial Value: "); p_DebugPrint(p, r, r, 1); 236 // } 237 237 #endif 238 238 #endif … … 272 272 273 273 const poly pp = F->m[c]; // get reference monomial!!! 274 275 274 276 275 #ifndef NDEBUG … … 326 325 // TODO: how to check this for computed values??? 327 326 #endif 328 #ifndef NDEBUG329 #if MYTEST330 PrintS("IS::Suffix::Result: "); // p_Write(p, r, r);331 p_DebugPrint(p, r, r, 1);332 #endif333 #endif334 335 327 } else 336 328 { -
polys/monomials/ring.cc
r208cd5 r1b816a3 10 10 /* includes */ 11 11 #include <math.h> 12 #include <kernel/mod2.h> 13 14 #include <kernel/options.h> 15 #include <omalloc/omalloc.h> 16 #include <kernel/polys.h> 17 #include <kernel/numbers.h> 18 #include <kernel/febase.h> 19 #include <kernel/intvec.h> 20 #include <kernel/longtrans.h> 21 #include <kernel/ffields.h> 22 #include <kernel/ideals.h> 23 #include <kernel/ring.h> 24 #include <kernel/prCopy.h> 25 #include <Singular/ipshell.h> 26 #include <kernel/p_Procs.h> 12 #include "options.h" 13 #include "omalloc.h" 14 #include "polys.h" 15 #include "numbers.h" 16 #include "febase.h" 17 #include "intvec.h" 18 #include "longalg.h" 19 #include "longtrans.h" 20 #include "ffields.h" 21 #include "ideals.h" 22 #include "ring.h" 23 #include "prCopy.h" 24 #include "../Singular/ipshell.h" 25 #include "p_Procs.h" 27 26 #ifdef HAVE_PLURAL 28 #include < kernel/gring.h>29 #include < kernel/sca.h>30 #endif 31 #include < kernel/maps.h>32 #include < kernel/matpol.h>27 #include <gring.h> 28 #include <sca.h> 29 #endif 30 #include <maps.h> 31 #include <matpol.h> 33 32 #ifdef HAVE_FACTORY 34 33 #define SI_DONT_HAVE_GLOBAL_VARS 35 # include <factory /factory.h>34 # include <factory.h> 36 35 #endif 37 36 … … 2500 2499 prev_ord=-1; 2501 2500 place++; 2502 2503 #if MYTEST2504 Print("rO_ISPrefix: place = %d, v: {", ord_struct.data.isTemp.start);2505 2506 for( int i = 0; i <= N; i++ )2507 Print("v[%d]: %09x", i, ord_struct.data.isTemp.pVarOffset[i]);2508 2509 PrintS("}!\n");2510 #endif2511 2501 } 2512 2502 static void rO_ISSuffix(int &place, int &bitplace, int &prev_ord, long *o, 2513 2503 int N, int *v, sro_ord *tmp_typ, int &typ_i, int sgn) 2514 2504 { 2515 #if MYTEST2516 Print("rO_ISSuffix: place = %d\n", place);2517 #endif2518 2505 2519 2506 // Let's find previous prefix: … … 2553 2540 2554 2541 2555 #if MYTEST2556 PrintS("Changes in v: { ");2557 #endif2558 2559 2542 for( int i = 0; i <= N; i++ ) // Note [0] == component !!! No Skip? 2560 2543 { … … 2565 2548 v[i] = -1; // Undo! 2566 2549 assume( pVarOffset[i] != -1 ); 2567 #if MYTEST2568 Print("v[%d]: %010x; ", i, pVarOffset[i]);2569 #endif2570 2550 } 2571 2551 else … … 2576 2556 pVarOffset[0] &= 0x0fff; 2577 2557 2578 #if MYTEST2579 PrintS(" }!\n");2580 #endif2581 2558 sro_ord &ord_struct = tmp_typ[typ_j]; 2582 2559 … … 4121 4098 Print(" start (level) %d, suffixpos: %d, VO: ",r->typ[j].data.isTemp.start, r->typ[j].data.isTemp.suffixpos); 4122 4099 4123 #ifndef NDEBUG4124 for( int k = 0; k <= r->N; k++)4125 if (r->typ[j].data.isTemp.pVarOffset[k] != -1)4126 Print("[%2d]: %09x; ", k, r->typ[j].data.isTemp.pVarOffset[k]);4127 #endif4128 4100 } 4129 4101 else if (r->typ[j].ord_typ==ro_is) … … 4414 4386 ring rCurrRingAssure_SyzComp() 4415 4387 { 4416 #if MYTEST4417 PrintS("rCurrRingAssure_SyzComp(), currRing: \n");4418 rWrite(currRing);4419 #ifdef RDEBUG4420 rDebugPrint(currRing);4421 #endif4422 PrintLn();4423 #endif4424 4425 4388 ring r = rAssure_SyzComp(currRing, TRUE); 4426 4389 … … 4429 4392 rChangeCurrRing(r); 4430 4393 assume(currRing == r); 4431 4432 #if MYTEST4433 PrintS("\nrCurrRingAssure_SyzComp(): new currRing: \n");4434 rWrite(currRing);4435 #ifdef RDEBUG4436 rDebugPrint(currRing);4437 #endif4438 PrintLn();4439 #endif4440 4394 } 4441 4395 … … 4496 4450 #ifdef HAVE_PLURAL 4497 4451 ring old_ring = r; 4498 4499 #if MYTEST 4500 PrintS("rCurrRingAssure_SyzComp(): temp r': "); 4501 rWrite(r); 4502 #ifdef RDEBUG 4503 rDebugPrint(r); 4504 #endif 4505 PrintLn(); 4506 #endif 4507 #endif 4508 4452 #endif 4509 4453 4510 4454 if (r->qideal!=NULL) … … 4531 4475 assume(ncRingType(res) == ncRingType(old_ring)); 4532 4476 #endif 4533 4534 #if MYTEST4535 PrintS("rCurrRingAssure_SyzComp(): res: ");4536 rWrite(r);4537 #ifdef RDEBUG4538 rDebugPrint(r);4539 #endif4540 PrintLn();4541 #endif4542 4543 4477 } 4544 4478 … … 4947 4881 rComplete(res, 1); 4948 4882 4949 #if MYTEST4950 PrintS("rAssure_InducedSchreyerOrdering(): temp res: ");4951 rWrite(res);4952 #ifdef RDEBUG4953 rDebugPrint(res);4954 #endif4955 PrintLn();4956 #endif4957 4958 4883 #ifdef HAVE_PLURAL 4959 4884 if (rIsPluralRing(r)) … … 4972 4897 #ifdef HAVE_PLURAL 4973 4898 ring old_ring = r; 4974 4975 #if MYTEST4976 PrintS("rAssure_InducedSchreyerOrdering(): temp nc res: ");4977 rWrite(res);4978 #ifdef RDEBUG4979 rDebugPrint(res);4980 #endif4981 PrintLn();4982 #endif4983 4899 #endif 4984 4900 … … 5067 4983 { 5068 4984 // Put the reference set F into the ring -ordering -recor 5069 #if MYTEST5070 Print("rSetISReference(F, i: %d, p: %d, w)\nF:", i, p);5071 idShow(F, r, r, 1); // currRing!5072 PrintLn();5073 PrintS("w: ");5074 if(componentWeights == NULL)5075 PrintS("NULL\n");5076 else5077 componentWeights->show();5078 #endif5079 4985 5080 4986 // TEST THAT THERE ARE DEGs!!! -
polys/polys.cc
r208cd5 r1b816a3 12 12 #include <string.h> 13 13 #include <ctype.h> 14 #include <kernel/mod2.h> 15 #include <kernel/options.h> 16 #include <omalloc/omalloc.h> 17 #include <kernel/febase.h> 18 #include <kernel/numbers.h> 19 #include <kernel/polys.h> 20 #include <kernel/ring.h> 21 #include <kernel/sbuckets.h> 14 #include <auxiliary.h> 15 #include "options.h" 16 #include "omalloc.h" 17 #include "reporter.h" 18 #include "numbers.h" 19 #include "polys.h" 20 #include "ring.h" 22 21 23 22 #ifdef HAVE_PLURAL 24 #include < kernel/gring.h>25 #include < kernel/sca.h>23 #include <gring.h> 24 #include <sca.h> 26 25 #endif 27 26 … … 34 33 /* returns -1 if a comes before b, 0 if a=b, 1 otherwise */ 35 34 36 int pVariables; // number of variables37 38 35 /* 1 for polynomial ring, -1 otherwise */ 39 36 int pOrdSgn; … … 55 52 { 56 53 if (ppNoether!=NULL) pDelete(&ppNoether); 57 pVariables = r->N;58 pOrdSgn = r->OrdSgn;59 pFDeg=r->pFDeg;60 pLDeg=r->pLDeg;61 pLexOrder=r->LexOrder;54 //pVariables = r->N; 55 //pOrdSgn = r->OrdSgn; 56 //pFDeg=r->pFDeg; 57 //pLDeg=r->pLDeg; 58 //pLexOrder=r->LexOrder; 62 59 63 60 if (complete) … … 102 99 * comment should be "assumes that LM(a) = LM(b)*m, for some monomial m..." 103 100 */ 104 poly pDivide(poly a, poly b) 101 #define pDivide(a,b) p_Divide(a,b,currRing) 102 poly p_Divide(poly a, poly b, cont ring r) 105 103 { 106 104 assume((pGetComp(a)==pGetComp(b)) || (pGetComp(b)==0)); … … 108 106 poly result = pInit(); 109 107 110 for(i=(int) pVariables; i; i--)111 p SetExp(result,i, pGetExp(a,i)- pGetExp(b,i));112 p SetComp(result, pGetComp(a) - pGetComp(b));113 p Setm(result);108 for(i=(int)r->N; i; i--) 109 p_SetExp(result,i, p_GetExp(a,i,r)- p_GetExp(b,i,r),r); 110 p_SetComp(result, p_GetComp(a,r) - p_GetComp(b,r),r); 111 p_Setm(result,r); 114 112 return result; 115 113 } … … 154 152 * assumes that b is not NULL, destroys b 155 153 */ 156 poly p DivideM(poly a, poly b)154 poly p_DivideM(poly a, poly b, const ring r) 157 155 { 158 156 if (a==NULL) { pDelete(&b); return NULL; } … … 168 166 while (a!=NULL) 169 167 { 170 if (p DivisibleBy(b,a))171 { 172 assume((p GetComp(a)==pGetComp(b)) || (pGetComp(b)==0));173 for(i=(int) pVariables; i; i--)174 p SubExp(a,i, pGetExp(b,i));175 p SubComp(a, pGetComp(b));176 p Setm(a);168 if (p_DivisibleBy(b,a,r)) 169 { 170 assume((p_GetComp(a,r)==p_GetComp(b,r)) || (p_GetComp(b,r)==0)); 171 for(i=(int)r->N; i; i--) 172 p_SubExp(a,i, p_GetExp(b,i,r),r); 173 p_SubComp(a, p_GetComp(b,r),r); 174 p_Setm(a,r); 177 175 prev=a; 178 176 pIter(a); … … 182 180 if (prev==NULL) 183 181 { 184 p LmDelete(&result);182 p_DeleteLm(&result,r); 185 183 a=result; 186 184 } 187 185 else 188 186 { 189 p LmDelete(&pNext(prev));187 p_DeleteLm(&pNext(prev),r); 190 188 a=pNext(prev); 191 189 } -
polys/polys.h
r208cd5 r1b816a3 325 325 // ----------------- define to enable new p_procs -----*/ 326 326 327 poly p Divide(poly a, poly b);328 poly p DivideM(poly a, poly b);327 poly p_Divide(poly a, poly b, const ring r); 328 poly p_DivideM(poly a, poly b, const ring r); 329 329 void pLcm(poly a, poly b, poly m); 330 330 poly pDiff(poly a, int k);
Note: See TracChangeset
for help on using the changeset viewer.