Changeset 1112b76 in git
- Timestamp:
- Jun 22, 2010, 12:41:01 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- d61b83a9e2debd2805137931b5341399516d2a63
- Parents:
- d4531110717a559c771df1b82982574879ac0fc5
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2010-06-22 12:41:01+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:16+01:00
- Location:
- coeffs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/numbers.cc
rd45311 r1112b76 8 8 */ 9 9 10 #include <string.h> 11 #include <stdlib.h> 10 #include "config.h" 11 #include <auxiliary.h> 12 13 14 12 15 #include "coeffs.h" 13 #include "reporter.h" 14 #include "omalloc.h" 16 17 #include "numbers.h" 18 19 #include <reporter.h> 20 #include <omalloc.h> 15 21 #include "numbers.h" 16 22 #include "longrat.h" … … 22 28 #include "longtrans.h" 23 29 #ifdef HAVE_RINGS 24 #include <kernel/rmodulo2m.h> 25 #include <kernel/rmodulon.h> 26 #include <kernel/rintegers.h> 27 28 extern omBin gmp_nrz_bin; 29 #endif 30 31 #ifndef assume 32 # define assume(a) if(!(a)){ Werror( "Assumption: is wrong: %s\n", #a ); }; 33 #endif 30 #include <rmodulo2m.h> 31 #include <rmodulon.h> 32 #include <rintegers.h> 33 #endif 34 #include <string.h> 35 #include <stdlib.h> 36 34 37 35 38 … … 111 114 { 112 115 n_Procs_s *n=cf_root; 113 while((n!=NULL) && (!n->nCoeffIsEqual(n,t,parameter))) 116 117 while((n!=NULL) && (n->nCoeffIsEqual!=NULL) && (!n->nCoeffIsEqual(n,t,parameter))) 114 118 n=n->next; 119 115 120 if (n==NULL) 116 121 { … … 135 140 n->cfGcd = ndGcd; 136 141 n->cfLcm = ndGcd; /* tricky, isn't it ?*/ 142 137 143 #ifdef HAVE_RINGS 138 144 n->cfDivComp = ndDivComp; … … 189 195 else 190 196 Werror("coeff init missing for %d",(int)t); 197 191 198 // post init settings: 192 199 if (n->cfRePart==NULL) n->cfRePart=n->cfCopy; 193 200 if (n->cfIntDiv==NULL) n->cfIntDiv=n->cfDiv; 201 194 202 #ifdef HAVE_RINGS 195 203 if (n->cfGetUnit==NULL) n->cfGetUnit=n->cfCopy; 196 204 #endif 205 197 206 #ifndef NDEBUG 198 207 assume(n->nCoeffIsEqual!=NULL); … … 239 248 assume(n->cfInpMult!=NULL); 240 249 assume(n->cfInit_bigint!=NULL); 241 250 #ifdef LDEBUG 242 251 assume(n->cfDBTest!=NULL); 243 252 #endif 244 253 assume(n->type==t); 245 254 #endif -
coeffs/rmodulo2m.cc
rd45311 r1112b76 29 29 30 30 /* for initializing function pointers */ 31 void nr2mInitChar (coeffs r, void*) 32 { 33 nr2mInitExp(r->ch, r); 31 void nr2mInitChar (coeffs r, void* p) 32 { 33 34 nr2mInitExp((int)(long)(p), r); 35 34 36 r->cfInit = nr2mInit; 35 37 r->cfCopy = ndCopy; … … 613 615 */ 614 616 615 void nr2mSetExp(int m, co nst coeffs r)617 void nr2mSetExp(int m, coeffs r) 616 618 { 617 619 if (m > 1) … … 630 632 } 631 633 632 void nr2mInitExp(int m, co nst coeffs r)634 void nr2mInitExp(int m, coeffs r) 633 635 { 634 636 nr2mSetExp(m, r); -
coeffs/rmodulon.cc
rd45311 r1112b76 30 30 31 31 /* for initializing function pointers */ 32 void nrnInitChar (coeffs r, void*) 33 { 34 nrnInitExp(r->ch, r); 32 void nrnInitChar (coeffs r, void* p) 33 { 34 35 nrnInitExp((int)(long)(p), r); 36 35 37 r->cfInit = nrnInit; 36 38 r->cfDelete = nrnDelete; … … 534 536 */ 535 537 536 void nrnSetExp(int m, co nst coeffs r)538 void nrnSetExp(int m, coeffs r) 537 539 { 538 540 if ((r->nrnModul != NULL) && (mpz_cmp(r->nrnModul, r->ringflaga) == 0) && (nrnExponent == r->ringflagb)) return; … … 546 548 mpz_init(nrnMinusOne); 547 549 } 550 // BUG: r->ringflaga is undefined! 548 551 mpz_set(r->nrnModul, r->ringflaga); 549 552 mpz_pow_ui(r->nrnModul, r->nrnModul, nrnExponent); … … 551 554 } 552 555 553 void nrnInitExp(int m, co nst coeffs r)556 void nrnInitExp(int m, coeffs r) 554 557 { 555 558 nrnSetExp(m, r); 556 559 557 if (mpz_cmp_ui(r->nrnModul, 2) <= 0)560 if (mpz_cmp_ui(r->nrnModul, 2) <= 0) // ??? 558 561 { 559 562 WarnS("nrnInitExp failed"); 560 563 } 564 565 r->ch = m; // ??? 561 566 } 562 567 -
coeffs/test.cc
rd45311 r1112b76 2 2 3 3 #include <auxiliary.h> 4 4 5 #include <coeffs.h> 5 6 #include <numbers.h> … … 39 40 40 41 41 bool Test(const n_coeffType type )42 bool Test(const n_coeffType type, void* p = NULL) 42 43 { 43 44 … … 45 46 "]: -----------------------" << endl; 46 47 47 const coeffs r = nInitChar( type, NULL);48 const coeffs r = nInitChar( type, p ); 48 49 49 50 assume( r != NULL ); … … 143 144 #ifdef HAVE_RINGS 144 145 type = nRegister( n_Z2m, nr2mInitChar); assume( type == n_Z2m ); 145 if( Test(type ) )146 if( Test(type, (void*) 2) ) 146 147 c ++; 147 148 #endif … … 150 151 #ifdef HAVE_RINGS 151 152 type = nRegister( n_Zn, nrnInitChar); assume( type == n_Zn ); 152 if( Test(type ) )153 if( Test(type, (void*) 3) ) 153 154 c ++; 154 155 /* BUG: … … 158 159 #0 0x00007ffff7b91f1b in __gmpz_set () from /usr/lib/libgmp.so.10 159 160 #1 0x00000000004177a5 in nrnSetExp (m=0, r=0x7ffff7f44ae8) at rmodulon.cc:549 161 160 162 #2 0x0000000000417814 in nrnInitExp (m=0, r=0x7ffff7f44ae8) at rmodulon.cc:556 163 161 164 #3 0x0000000000416122 in nrnInitChar (r=0x7ffff7f44ae8) at rmodulon.cc:34 162 165 #4 0x0000000000413278 in nInitChar (t=n_Zn, parameter=0x0) at numbers.cc:146
Note: See TracChangeset
for help on using the changeset viewer.