Changeset 494884 in git for libpolys/polys/weight.cc
- Timestamp:
- Mar 22, 2011, 11:16:48 AM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 58ea04393add5871d2f9f54b118b57b5395f173f
- Parents:
- c462b558d2bcc56ce39d2181b2f9d9cd1b82345b
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-03-22 11:16:48+01:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:04:09+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/weight.cc
rc462b55 r494884 9 9 10 10 #include <math.h> 11 #include <kernel/mod2.h> 12 #include <kernel/options.h> 11 //#include <kernel/mod2.h> 13 12 #include <omalloc/omalloc.h> 14 #include <kernel/polys.h> 15 #include <kernel/intvec.h> 16 #include <kernel/febase.h> 17 #include <kernel/ideals.h> 18 #include <kernel/ring.h> 19 #include <kernel/weight.h> 13 #include <misc/options.h> 14 #include <polys/monomials/p_polys.h> 15 #include <misc/intvec.h> 16 //#include <kernel/febase.h> 17 //#include <kernel/ideals.h> 18 #include <polys/monomials/ring.h> 19 #include <polys/weight.h> 20 20 21 21 /*0 implementation*/ … … 34 34 extern "C" void wGcd(int *x, int n); 35 35 36 static void wDimensions(poly sets, int sl, int *lpol, int *npol, int *mons)36 static void wDimensions(poly* s, int sl, int *lpol, int *npol, int *mons) 37 37 { 38 38 int i, i1, j, k; … … 64 64 65 65 66 static void wInit(poly set s, int sl, int mons, int *A)66 static void wInit(poly* s, int sl, int mons, int *A, const ring R) 67 67 { 68 68 int n, a, i, j, *B, *C; … … 71 71 72 72 B = A; 73 n = pVariables;73 n = rVar(R); 74 74 a = (n + 1) * sizeof(int); 75 75 pl = (int *)omAlloc(a); … … 84 84 C = B; 85 85 B++; 86 p GetExpV(p, pl);86 p_GetExpV(p, pl,R); 87 87 for (j = 0; j < n; j++) 88 88 { … … 95 95 C = B; 96 96 B++; 97 p GetExpV(q, pl);97 p_GetExpV(q, pl,R); 98 98 for (j = 0; j < n; j++) 99 99 { … … 108 108 } 109 109 110 void wCall(poly set s, int sl, int *x, double wNsqr)110 void wCall(poly* s, int sl, int *x, double wNsqr, const ring R) 111 111 { 112 112 int n, q, npol, mons, i; … … 115 115 void *adr; 116 116 117 n = pVariables;117 n = rVar(R); 118 118 lpol = (int * )omAlloc((sl + 1) * sizeof(int)); 119 119 wDimensions(s, sl, lpol, &npol, &mons); … … 130 130 q = (n + 1) * mons * sizeof(int); 131 131 A = (int * )omAlloc(q); 132 wInit(s, sl, mons, A );132 wInit(s, sl, mons, A, R); 133 133 degw = A + (n * mons); 134 134 memset(degw, 0, mons * sizeof(int)); … … 182 182 183 183 184 void kEcartWeights(poly set s, int sl, short *eweight)184 void kEcartWeights(poly* s, int sl, short *eweight, const ring R) 185 185 { 186 186 int n, i; … … 188 188 189 189 *eweight = 0; 190 n = pVariables;191 if (rHasLocalOrMixedOrdering _currRing())190 n = rVar(R); 191 if (rHasLocalOrMixedOrdering(R)) 192 192 wFunctional = wFunctionalMora; 193 193 else 194 194 wFunctional = wFunctionalBuch; 195 195 x = (int * )omAlloc(2 * (n + 1) * sizeof(int)); 196 wCall(s, sl, x, (double)2.0 / (double)n );196 wCall(s, sl, x, (double)2.0 / (double)n, R); 197 197 for (i = n; i!=0; i--) 198 198 eweight[i] = x[i + n + 1]; … … 200 200 } 201 201 202 short * iv2array(intvec * iv )203 { 204 short *s=(short *)omAlloc0(( pVariables+1)*sizeof(short));202 short * iv2array(intvec * iv, const ring R) 203 { 204 short *s=(short *)omAlloc0((rVar(R)+1)*sizeof(short)); 205 205 int len=0; 206 206 if(iv!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.