Changeset 68349d in git
- Timestamp:
- Mar 25, 2004, 10:19:12 PM (20 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- c47b0a37e9aaabd8518efe50efd4ab6a540b00b6
- Parents:
- 3d9ed9730c6639ccd48654bab09d3ef24067f307
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gring.cc
r3d9ed9 r68349d 7 7 * Author: levandov (Viktor Levandovsky) 8 8 * Created: 8/00 - 11/00 9 * Version: $Id: gring.cc,v 1. 4 2003-12-17 19:40:41levandov Exp $9 * Version: $Id: gring.cc,v 1.5 2004-03-25 21:19:12 levandov Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 1393 1393 ares=p_Add_q(ares, bres,currRing); 1394 1394 /* What to give free? */ 1395 /* Do we have to free PREFIX/SUFFIX? it seems so */ 1395 1396 pDelete(&prefix); 1396 1397 pDelete(&suffix); … … 1946 1947 } 1947 1948 1948 #endif 1949 /* substitute the n-th variable by e in p 1950 * destroy p 1951 * e is not a constant 1952 */ 1953 poly nc_pSubst(poly p, int n, poly e) 1954 { 1955 int rN=currRing->N; 1956 int *PRE = (int *)omAlloc0((rN+1)*sizeof(int)); 1957 int *SUF = (int *)omAlloc0((rN+1)*sizeof(int)); 1958 int i,j,pow; 1959 poly suf,pre; 1960 poly res = NULL; 1961 poly out = NULL; 1962 while ( p!= NULL ) 1963 { 1964 pGetExpV(p, PRE); /* faster splitting? */ 1965 pow = PRE[n]; PRE[n]=0; 1966 res = NULL; 1967 if (pow!=0) 1968 { 1969 for (i=n+1; i<=rN; i++) 1970 { 1971 SUF[i] = PRE[i]; 1972 PRE[i] = 0; 1973 } 1974 res = pPower(pCopy(e),pow); 1975 /* multiply with prefix */ 1976 pre = pOne(); 1977 pSetExpV(pre,PRE); 1978 pSetm(pre); 1979 pSetComp(pre,PRE[0]); 1980 res = nc_mm_Mult_p(pre,res,currRing); 1981 /* multiply with suffix */ 1982 suf = pOne(); 1983 pSetExpV(suf,SUF); 1984 pSetm(suf); 1985 pSetComp(suf,PRE[0]); 1986 res = nc_p_Mult_mm(res,suf,currRing); 1987 } 1988 else /* pow==0 */ 1989 { 1990 res = pHead(p); 1991 } 1992 p = pLmDeleteAndNext(p); 1993 out = pAdd(out,res); 1994 } 1995 freeT(PRE,rN); 1996 freeT(SUF,rN); 1997 return(out); 1998 } 1999 2000 #endif -
kernel/gring.h
r3d9ed9 r68349d 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gring.h,v 1. 3 2003-12-16 18:30:31levandov Exp $ */6 /* $Id: gring.h,v 1.4 2004-03-25 21:18:57 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT additional defines etc for --with-plural … … 23 23 void ncCleanUp(ring r); /* smaller than kill */ 24 24 25 / / poly functions defined in p_Procs :25 /* poly functions defined in p_Procs : */ 26 26 poly nc_pp_Mult_mm(poly p, poly m, const ring r, poly &last); 27 27 poly nc_p_Mult_mm(poly p, poly m, const ring r); 28 28 poly nc_p_Minus_mm_Mult_qq(poly p, const poly m, poly q, const ring r); 29 / / other routines we need in addition :29 /* other routines we need in addition : */ 30 30 poly nc_p_Mult_mm_Common(poly p, const poly m, int side, const ring r); 31 31 poly nc_mm_Mult_p(const poly m, poly p, const ring r); … … 42 42 poly _nc_p_Mult_q(poly p, poly q, const int copy, const ring r); 43 43 44 //copy : 44 /* subst: */ 45 poly nc_pSubst(poly p, int n, poly e); 46 47 /* copy : */ 45 48 poly nc_p_CopyGet(poly a, ring r); 46 49 poly nc_p_CopyPut(poly a, ring r); 47 50 48 / /syzygies :49 / / former nc_spGSpolyCreate51 /* syzygies : */ 52 /* former nc_spGSpolyCreate */ 50 53 poly nc_CreateSpoly(poly p1, poly p2, poly spNoether, const ring r); 51 / / former nc_spGSpolyRed54 /* former nc_spGSpolyRed */ 52 55 poly nc_ReduceSpoly(poly p1, poly p2, poly spNoether, const ring r); 53 / / former nc_spGSpolyRedNew56 /* former nc_spGSpolyRedNew */ 54 57 poly nc_ReduceSpolyNew(poly p1, poly p2, poly spNoether, const ring r); 55 / / former nc_spGSpolyRedTail58 /* former nc_spGSpolyRedTail */ 56 59 void nc_ReduceSpolyTail(poly p1, poly q, poly q2, poly spNoether, const ring r); 57 / / former nc_spShort60 /* former nc_spShort */ 58 61 poly nc_CreateShortSpoly(poly p1, poly p2, const ring r=currRing); 59 62 60 63 ideal gr_bba (ideal F, ideal Q,kStrategy strat); 61 64 62 / / brackets:65 /* brackets: */ 63 66 poly nc_p_Bracket_qq(poly p, poly q); 64 67 poly nc_mm_Bracket_nn(poly m1, poly m2); 65 68 66 //twostd: 67 69 /* twostd: */ 68 70 ideal twostd(ideal I); 69 71 70 / / complete reduction routines72 /* complete reduction routines */ 71 73 72 / /void nc_kBucketPolyRed(kBucket_pt b, poly p);74 /* void nc_kBucketPolyRed(kBucket_pt b, poly p); */ 73 75 void nc_kBucketPolyRed(kBucket_pt b, poly p, number *c); 74 76 void nc_PolyPolyRed(poly &b, poly p, number *c); … … 79 81 80 82 #else 81 / / dummy definition to make gcc happy83 /* dummy definition to make gcc happy */ 82 84 #define nc_kBucketPolyRed(A,B,C) 0 83 85 #define nc_PolyPolyRed(A,B,C) 0 -
kernel/polys.cc
r3d9ed9 r68349d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1. 1.1.1 2003-10-06 12:15:55 SingularExp $ */4 /* $Id: polys.cc,v 1.2 2004-03-25 21:16:15 levandov Exp $ */ 5 5 6 6 /* … … 20 20 #include "ring.h" 21 21 22 #ifdef HAVE_PLURAL 23 #include "gring.h" 24 #endif 25 22 26 /* ----------- global variables, set by pSetGlobals --------------------- */ 23 27 /* computes length and maximal degree of a POLYnomial */ … … 835 839 else return pSubst2(p, n, pGetCoeff(e)); 836 840 } 841 842 #ifdef HAVE_PLURAL 843 if (rIsPluralRing(currRing)) 844 { 845 return nc_pSubst(p,n,e); 846 } 847 #endif 837 848 838 849 int exponent,i;
Note: See TracChangeset
for help on using the changeset viewer.