Changeset 0f0974 in git
- Timestamp:
- Jun 21, 1999, 6:46:40 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 8c51b6db1c377ec23bece6adf1c29990118edc44
- Parents:
- 092430050dbf6ad127e0cf157b408a5b79bf6403
- Location:
- Singular
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/algmap.cc
r092430 r0f0974 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: algmap.cc,v 1.1 1 1998-09-22 14:09:00Singular Exp $ */4 /* $Id: algmap.cc,v 1.12 1999-06-21 16:46:35 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials from rings with … … 28 28 int i, j, m = r0->N; 29 29 30 if (naGetDenom (pGetCoeff(p0)) != NULL)30 if (naGetDenom0(pGetCoeff(p0)) != NULL) 31 31 { 32 32 *nom = TRUE; 33 33 return res; 34 34 } 35 a0 = naGetNom (pGetCoeff(p0));35 a0 = naGetNom0(pGetCoeff(p0)); 36 36 do 37 37 { … … 41 41 { 42 42 pGetCoeff(q0) = (number)Alloc0(sizeof(rnumber)); 43 b0 = naGetNom (pGetCoeff(q0)) = napNew();43 b0 = naGetNom0(pGetCoeff(q0)) = napNew(); 44 44 napGetCoeff(b0) = nacCopy(napGetCoeff(a0)); 45 45 for (i=1; i<=t; i++) … … 80 80 if (s!=0) 81 81 { 82 if (naGetDenom (pGetCoeff(p0)) != NULL)82 if (naGetDenom0(pGetCoeff(p0)) != NULL) 83 83 { 84 84 *nom = TRUE; 85 85 return res; 86 86 } 87 a0 = naGetNom (pGetCoeff(p0));87 a0 = naGetNom0(pGetCoeff(p0)); 88 88 } 89 89 q0 = pInit(); … … 117 117 if (s==0) 118 118 { 119 naGetNom (pGetCoeff(q0)) = b0;119 naGetNom0(pGetCoeff(q0)) = b0; 120 120 return pAdd(res, q0); 121 121 } … … 126 126 if (pGetCoeff(q0)==NULL) 127 127 pGetCoeff(q0) = (number)Alloc0(sizeof(rnumber)); 128 naGetNom (pGetCoeff(q0)) = b1;128 naGetNom0(pGetCoeff(q0)) = b1; 129 129 return pAdd(res, q0); 130 130 } … … 212 212 b0 = napNew(); 213 213 napGetCoeff(b0) = pGetCoeff(p0); 214 naGetNom (cc) = b0;214 naGetNom0(cc) = b0; 215 215 pMultN(monpart,cc); 216 216 napGetCoeff(b0) = NULL; … … 224 224 return pAdd(res, monpart); 225 225 } 226 if (naGetDenom (pGetCoeff(p0)) != NULL)226 if (naGetDenom0(pGetCoeff(p0)) != NULL) 227 227 { 228 228 *nom = TRUE; … … 232 232 return NULL; 233 233 } 234 a0 = naGetNom (pGetCoeff(p0));234 a0 = naGetNom0(pGetCoeff(p0)); 235 235 do 236 236 { … … 239 239 { 240 240 pGetCoeff(q) = (number)Alloc0(sizeof(rnumber)); 241 b0 = naGetNom (pGetCoeff(q)) = napNew();241 b0 = naGetNom0(pGetCoeff(q)) = napNew(); 242 242 napGetCoeff(b0) = nacCopy(napGetCoeff(a0)); 243 243 } -
Singular/longalg.cc
r092430 r0f0974 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.3 2 1999-04-23 15:22:25Singular Exp $ */4 /* $Id: longalg.cc,v 1.33 1999-06-21 16:46:36 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 2537 2537 } 2538 2538 2539 number naGetDenom(number n) 2540 { 2541 lnumber x=(lnumber)n; 2542 if (x->n!=NULL) 2543 { 2544 lnumber r=(lnumber)Alloc0(sizeof(rnumber)); 2545 r->z=napCopy(naGetDenom0(x)); 2546 r->s = 2; 2547 return (number)r; 2548 } 2549 return naInit(1); 2550 } 2551 2539 2552 #ifdef LDEBUG 2540 2553 BOOLEAN naDBTest(number a, char *f,int l) … … 2578 2591 p = p->ne; 2579 2592 } 2580 p = x->n;2593 p = naGetDenom0(x); 2581 2594 while(p!=NULL) 2582 2595 { -
Singular/longalg.h
r092430 r0f0974 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longalg.h,v 1. 7 1999-01-21 15:00:07 Singular Exp $ */6 /* $Id: longalg.h,v 1.8 1999-06-21 16:46:37 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: algebraic numbers … … 99 99 #define napNew() ((alg)Alloc0(napMonomSize)) 100 100 #define nanumber lnumber 101 #define naGetNom (na) (((nanumber)(na))->z)102 #define naGetDenom (na) (((nanumber)(na))->n)101 #define naGetNom0(na) (((nanumber)(na))->z) 102 #define naGetDenom0(na) (((nanumber)(na))->n) 103 103 extern number (*nacCopy)(number a); 104 104 extern BOOLEAN (*nacIsZero)(number a); … … 106 106 extern void (*nacNormalize)(number &a); 107 107 extern void napWrite(alg l); 108 extern number naGetDenom(number n); 108 109 #endif 109 110 -
Singular/longrat.cc
r092430 r0f0974 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1.1 8 1999-04-29 11:38:49Singular Exp $ */4 /* $Id: longrat.cc,v 1.19 1999-06-21 16:46:38 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 2101 2101 return iz; 2102 2102 } 2103 2104 number nlGetDenom(number n) 2105 { 2106 if (!(SR_HDL(n) & SR_INT)) 2107 { 2108 if (n->s!=3) 2109 { 2110 number r=nlRInit(1); 2111 mpz_set(&r->z,&n->n); 2112 return r; 2113 } 2114 } 2115 return nlInit(1); 2116 } -
Singular/longrat.h
r092430 r0f0974 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longrat.h,v 1.1 0 1998-06-02 15:29:56Singular Exp $ */6 /* $Id: longrat.h,v 1.11 1999-06-21 16:46:39 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computation with long rational numbers … … 78 78 int nlModP(number n, int p); 79 79 int nlSize(number n); 80 number nlGetDenom(number n); 80 81 #ifdef LDEBUG 81 82 BOOLEAN nlDBTest(number a, char *f, int l); -
Singular/numbers.cc
r092430 r0f0974 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: numbers.cc,v 1.1 3 1999-05-31 12:08:04 obachmanExp $ */4 /* $Id: numbers.cc,v 1.14 1999-06-21 16:46:39 Singular Exp $ */ 5 5 6 6 /* … … 50 50 BOOLEAN (*nIsMOne)(number a); 51 51 BOOLEAN (*nGreaterZero)(number a); 52 void (*nWrite)(number &a); 53 char * (*nRead)(char *s,number *a); 54 void (*nPower)(number a, int i, number * result); 52 void (*nWrite)(number &a); 53 char * (*nRead)(char *s,number *a); 54 void (*nPower)(number a, int i, number * result); 55 number (*nGetDenom)(number n); 55 56 numberfunc nGcd,nLcm; 56 57 BOOLEAN (*nSetMap)(int c,char **par, int nop, number minpol); … … 85 86 86 87 number ndIntMod(number a, number b) { return nInit(0); } 88 89 number ndGetDenom(number n) { return nInit(1); } 87 90 88 91 int nGetChar() { return nChar; } … … 108 111 nParDeg= ndParDeg; 109 112 nSize = ndSize; 113 nGetDenom = ndGetDenom; 114 nName = ndName; 110 115 } 111 116 //Print("n:c=%d compl=%d param=%d\n",c,complete,r->parameter); … … 153 158 nName= naName; 154 159 nSize = naSize; 160 nGetDenom = naGetDenom; 155 161 #ifdef LDEBUG 156 162 nDBTest=naDBTest; … … 195 201 nLcm = nlLcm; 196 202 nSetMap = nlSetMap; 197 nName= ndName;198 203 nSize = nlSize; 204 nGetDenom = nlGetDenom; 199 205 #ifdef LDEBUG 200 206 nDBTest=nlDBTest; … … 240 246 nLcm = ndGcd; /* tricky, isn't it ?*/ 241 247 nSetMap = npSetMap; 242 nName= ndName;248 /* nName= ndName; */ 243 249 /*nSize = ndSize;*/ 244 250 #ifdef LDEBUG … … 333 339 nLcm = ndGcd; /* tricky, isn't it ?*/ 334 340 nSetMap=nrSetMap; 335 nName=ndName;341 /* nName= ndName; */ 336 342 /*nSize = ndSize;*/ 337 343 #ifdef LDEBUG … … 378 384 nLcm = ndGcd; /* tricky, isn't it ?*/ 379 385 nSetMap=ngfSetMap; 380 nName=ndName;386 /* nName= ndName; */ 381 387 /*nSize = ndSize;*/ 382 388 #ifdef LDEBUG … … 422 428 nLcm = ndGcd; /* tricky, isn't it ?*/ 423 429 nSetMap=ngcSetMap; 424 nName=ndName;425 430 nPar=ngcPar; 426 431 /*nSize = ndSize;*/ -
Singular/numbers.h
r092430 r0f0974 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1. 6 1999-04-29 11:38:54Singular Exp $ */6 /* $Id: numbers.h,v 1.7 1999-06-21 16:46:40 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 39 39 (*nGreaterZero)(number a); 40 40 extern void (*nPower)(number a, int i, number * result); 41 extern number (*nGetDenom)(number n); 41 42 extern numberfunc nGcd, nLcm; 42 43
Note: See TracChangeset
for help on using the changeset viewer.