Changeset 6ccd426 in git
- Timestamp:
- May 14, 2010, 3:10:31 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 830743981da9efd7be7056e1a0b5e320ea114eee
- Parents:
- 7019c8f07f02f8eb0e06dd6cc2a707f095f60dd7
- Location:
- kernel
- Files:
-
- 2 added
- 1 deleted
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/AlgebraicExt.cc
r7019c8 r6ccd426 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id $ */4 /* $Id: AlgebraicExt.cc 12469 2010-05-14 10:39:49Z frank $ */ 5 5 /* 6 * ABSTRACT: algebraic numbers 6 * ABSTRACT: elements of an algebraic extension field 7 * 8 * This field has the form K(a), where K is itself a field, 9 * and a is algebraic over K. The elements in K(a) can be 10 * treated as a specific type of number, see numbers.h. 11 * This implementation declares a global variable 'nacRing' 12 * which is a valid SINGULAR ring representing K[a]. Like- 13 * wise, the minimal polynomial of a over K is stored in 14 * the global variable 'naMinimalPoly'. 7 15 */ 8 16 … … 19 27 #include "ideals.h" 20 28 #include "ring.h" 29 21 30 #ifdef HAVE_FACTORY 22 31 #include "factory.h" … … 24 33 #include "clapconv.h" 25 34 #endif 26 #include "longalg.h" 35 /* HAVE_FACTORY */ 36 37 #include "AlgebraicExt.h" 27 38 28 39 struct snaIdeal … … 31 42 napoly *liste; 32 43 }; 33 typedef struct snaIdeal * naIdeal; 34 35 naIdeal naI=NULL; 44 45 typedef struct snaIdeal* naIdeal; 46 47 naIdeal naI = NULL; 36 48 37 49 omBin snaIdeal_bin = omGetSpecBin(sizeof(snaIdeal)); … … 100 112 if (r->minpoly!=NULL) 101 113 { 102 naMinimalPoly= ((lnumber)r->minpoly)->z;114 naMinimalPoly=r->minpoly; 103 115 #ifdef LDEBUG 104 116 omCheckAddr(naMinimalPoly); … … 232 244 do 233 245 { 234 napSetExp(qq, 1,p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));246 napSetExp(qq,p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing)); 235 247 napSetm(qq); 236 248 pGetCoeff(qq) = nacDiv(pGetCoeff(a), pGetCoeff(g)); … … 262 274 do 263 275 { 264 napSetExp(qq, 1,p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));276 napSetExp(qq, p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing)); 265 277 p_Setm(qq,nacRing); 266 278 pGetCoeff(qq) = nacDiv(pGetCoeff(a), pGetCoeff(g)); … … 498 510 { 499 511 s = eati(s, &j); 500 napAddExp(ex, i+1,j);512 napAddExp(ex,j); 501 513 } 502 514 else 503 napAddExp(ex, i+1,1);515 napAddExp(ex,1); 504 516 } 505 517 return s; … … 511 523 { 512 524 s+=strlen(naParNames[i]); 513 napSetExp(ex, i+1,1);525 napSetExp(ex,1); 514 526 } 515 527 return s; … … 745 757 if (pNext(y)==NULL) 746 758 { 747 napSetExp(g, 1,napExp(x, y));759 napSetExp(g,napExp(x, y)); 748 760 p_Setm(g,nacRing); 749 761 return g; … … 769 781 p_Delete(&y,nacRing); 770 782 p_LmDelete(&h,nacRing); 771 napSetExp(g, 1,napExp(a, b));783 napSetExp(g,napExp(a, b)); 772 784 p_Setm(g,nacRing); 773 785 return g; … … 781 793 for (i=(naNumbOfPar-1); i>=0; i--) 782 794 { 783 napSetExp(x, i+1,napExpi(i,a,b));795 napSetExp(x,napExpi(i,a,b)); 784 796 p_Setm(x,nacRing); 785 797 } … … 845 857 pGetCoeff(h) = nacCopy(pGetCoeff(q)); 846 858 for (j=naNumbOfPar; j>0; j--) 847 napSetExp(h, j,p_GetExp(q,j,nacRing) - p_GetExp(naI->liste[i],j,nacRing));859 napSetExp(h,p_GetExp(q,j,nacRing) - p_GetExp(naI->liste[i],j,nacRing)); 848 860 p_Setm(h,nacRing); 849 861 h = p_Mult_q(h, napCopy(naI->liste[i]),nacRing); … … 924 936 l->s = 2; 925 937 l->z = p_ISet(1,nacRing); 926 napSetExp(l->z, i,1);938 napSetExp(l->z,1); 927 939 p_Setm(l->z,nacRing); 928 940 l->n = NULL; … … 972 984 void naDelete(number *p, const ring r) 973 985 { 974 if (( *p)!=r->minpoly)986 if (((napoly)(*p))!=r->minpoly) 975 987 { 976 988 lnumber l = (lnumber) * p; … … 1861 1873 } 1862 1874 /* normalize all coefficients in n and z (if in Q) */ 1863 if (norm) 1875 if (norm) 1864 1876 { 1865 1877 naCoefNormalize(pp); … … 1881 1893 while (xx != NULL) 1882 1894 { 1883 napAddExp(xx, i+1,-m);1895 napAddExp(xx, -m); 1884 1896 pIter(xx); 1885 1897 } 1886 1898 while (yy != NULL) 1887 1899 { 1888 napAddExp(yy, i+1,-m);1900 napAddExp(yy, -m); 1889 1901 pIter(yy); 1890 1902 } … … 2236 2248 int i; 2237 2249 for(i=1;i<=naParsToCopy;i++) 2238 napSetExp(a, i,napGetExpFrom(p,i,naMapRing));2250 napSetExp(a,napGetExpFrom(p,naMapRing)); 2239 2251 p_Setm(a,nacRing); 2240 2252 pGetCoeff(w) = nacMap(pGetCoeff(p)); … … 2246 2258 pIter(a); 2247 2259 for(i=1;i<=naParsToCopy;i++) 2248 napSetExp(a, i,napGetExpFrom(p,i,naMapRing));2260 napSetExp(a,napGetExpFrom(p,naMapRing)); 2249 2261 p_Setm(a,nacRing); 2250 2262 pGetCoeff(a) = nacMap(pGetCoeff(p)); … … 2269 2281 if (par_perm!=NULL) e=par_perm[i-1]; 2270 2282 else e=-i; 2271 int ee=napGetExpFrom(p, i,src_ring);2283 int ee=napGetExpFrom(p,src_ring); 2272 2284 if (e<0) 2273 napSetExp(w, -e,ee);2285 napSetExp(w,ee); 2274 2286 else if (ee>0) 2275 2287 not_null=FALSE; … … 2452 2464 for(i=0;i<P;i++) 2453 2465 { 2454 if(napGetExpFrom(za, i+1,oldRing)!=0)2466 if(napGetExpFrom(za,oldRing)!=0) 2455 2467 { 2456 2468 if(par_perm==NULL) … … 2458 2470 if ((rPar(currRing)>=i) && (pa!=NULL)) 2459 2471 { 2460 napSetExp(pa, i+1,napGetExpFrom(za,i+1,oldRing));2472 napSetExp(pa,napGetExpFrom(za,oldRing)); 2461 2473 p_Setm(pa,nacRing); 2462 2474 } … … 2468 2480 } 2469 2481 else if(par_perm[i]>0) 2470 pSetExp(p,par_perm[i],napGetExpFrom(za, i+1,oldRing));2482 pSetExp(p,par_perm[i],napGetExpFrom(za,oldRing)); 2471 2483 else if((par_perm[i]<0)&&(pa!=NULL)) 2472 2484 { 2473 napSetExp(pa, -par_perm[i], napGetExpFrom(za,i+1,oldRing));2485 napSetExp(pa,napGetExpFrom(za,oldRing)); 2474 2486 p_Setm(pa,nacRing); 2475 2487 } … … 2528 2540 2529 2541 #ifdef LDEBUG 2530 BOOLEAN naDBTest(number a, const char *f, const int l)2542 BOOLEAN naDBTest(number a, const char *f, const int l) 2531 2543 { 2532 2544 lnumber x=(lnumber)a; -
kernel/RatFunctField.cc
r7019c8 r6ccd426 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id $ */4 /* $Id: RatFunctField.cc 12469 2010-05-14 10:39:49Z frank $ */ 5 5 /* 6 * ABSTRACT: algebraic numbers 6 * ABSTRACT: elements of a rational function field 7 * 8 * This field has the form K(t_1, t_2, ..., t_m), where K is 9 * itself a field, and the t_i are transcendental over K. 10 * The elements in K(t_1, t_2, ..., t_m) can be treated as a 11 * specific type of number, see numbers.h. 7 12 */ 8 13 … … 24 29 #include "clapconv.h" 25 30 #endif 26 #include " longalg.h"27 28 struct sn aIdeal31 #include "RatFunctField.h" 32 33 struct snratIdeal 29 34 { 30 35 int anz; 31 napoly *liste;36 poly *liste; 32 37 }; 33 typedef struct snaIdeal * naIdeal; 34 35 naIdeal naI=NULL; 36 37 omBin snaIdeal_bin = omGetSpecBin(sizeof(snaIdeal)); 38 39 int naNumbOfPar; 40 napoly naMinimalPoly;41 #define n aParNames (currRing->parameter)42 static int n aIsChar0;43 static ring n aMapRing;38 39 typedef struct snratIdeal* nratIdeal; 40 41 nratIdeal nratI = NULL; 42 43 omBin snratIdeal_bin = omGetSpecBin(sizeof(snratIdeal)); 44 45 int nratNumbOfPar; 46 #define nratParNames (currRing->parameter) 47 static int nratIsChar0; 48 static ring nratMapRing; 44 49 45 50 #ifdef LDEBUG 46 #define naTest(a) naDBTest(a,__FILE__,__LINE__)47 BOOLEAN naDBTest(number a, const char *f,const int l);51 #define nratTest(a) nratDBTest(a,__FILE__,__LINE__) 52 BOOLEAN nratDBTest(number a, const char *f,const int l); 48 53 #else 49 #define naTest(a)54 #define nratTest(a) 50 55 #endif 51 52 number (*naMap)(number from); 56 /* LDEBUG */ 57 58 number (*nratMap)(number from); 53 59 /* procedure variables */ 54 60 static numberfunc
Note: See TracChangeset
for help on using the changeset viewer.