Changeset 494884 in git


Ignore:
Timestamp:
Mar 22, 2011, 11:16:48 AM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
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
Message:
fixed weight.cc
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/weight.cc

    rc462b55 r494884  
    99
    1010#include <math.h>
    11 #include <kernel/mod2.h>
    12 #include <kernel/options.h>
     11//#include <kernel/mod2.h>
    1312#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>
    2020
    2121/*0 implementation*/
     
    3434extern "C" void wGcd(int *x, int n);
    3535
    36 static void wDimensions(polyset s, int sl, int *lpol, int *npol, int *mons)
     36static void wDimensions(poly* s, int sl, int *lpol, int *npol, int *mons)
    3737{
    3838  int  i, i1, j, k;
     
    6464
    6565
    66 static void wInit(polyset s, int sl, int mons, int *A)
     66static void wInit(poly* s, int sl, int mons, int *A, const ring R)
    6767{
    6868  int  n, a, i, j, *B, *C;
     
    7171
    7272  B = A;
    73   n = pVariables;
     73  n = rVar(R);
    7474  a = (n + 1) * sizeof(int);
    7575  pl = (int *)omAlloc(a);
     
    8484        C = B;
    8585        B++;
    86         pGetExpV(p, pl);
     86        p_GetExpV(p, pl,R);
    8787        for (j = 0; j < n; j++)
    8888        {
     
    9595        C = B;
    9696        B++;
    97         pGetExpV(q, pl);
     97        p_GetExpV(q, pl,R);
    9898        for (j = 0; j < n; j++)
    9999        {
     
    108108}
    109109
    110 void wCall(polyset s, int sl, int *x, double wNsqr)
     110void wCall(poly* s, int sl, int *x, double wNsqr, const ring R)
    111111{
    112112  int  n, q, npol, mons, i;
     
    115115  void *adr;
    116116
    117   n = pVariables;
     117  n = rVar(R);
    118118  lpol = (int * )omAlloc((sl + 1) * sizeof(int));
    119119  wDimensions(s, sl, lpol, &npol, &mons);
     
    130130  q = (n + 1) * mons * sizeof(int);
    131131  A = (int * )omAlloc(q);
    132   wInit(s, sl, mons, A);
     132  wInit(s, sl, mons, A, R);
    133133  degw = A + (n * mons);
    134134  memset(degw, 0, mons * sizeof(int));
     
    182182
    183183
    184 void kEcartWeights(polyset s, int sl, short *eweight)
     184void kEcartWeights(poly* s, int sl, short *eweight, const ring R)
    185185{
    186186  int  n, i;
     
    188188
    189189  *eweight = 0;
    190   n = pVariables;
    191   if (rHasLocalOrMixedOrdering_currRing())
     190  n = rVar(R);
     191  if (rHasLocalOrMixedOrdering(R))
    192192    wFunctional = wFunctionalMora;
    193193  else
    194194    wFunctional = wFunctionalBuch;
    195195  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);
    197197  for (i = n; i!=0; i--)
    198198    eweight[i] = x[i + n + 1];
     
    200200}
    201201
    202 short * iv2array(intvec * iv)
    203 {
    204   short *s=(short *)omAlloc0((pVariables+1)*sizeof(short));
     202short * iv2array(intvec * iv, const ring R)
     203{
     204  short *s=(short *)omAlloc0((rVar(R)+1)*sizeof(short));
    205205  int len=0;
    206206  if(iv!=NULL)
  • libpolys/polys/weight.h

    rc462b55 r494884  
    1111#include <polys/monomials/ring.h>
    1212
    13 //extern short * ecartWeights;
     13extern short * ecartWeights;
    1414//extern pFDegProc pFDegOld;
    1515//extern pLDegProc pLDegOld;
    1616
    17 void kEcartWeights(poly* s, int sl, short *eweight);
     17void kEcartWeights(poly* s, int sl, short *eweight, const ring R);
    1818//BOOLEAN kWeight(leftv res,leftv id);
    1919//BOOLEAN kQHWeight(leftv res,leftv v);
     
    2222long totaldegreeWecart_IV(poly p, ring r, const short *w);
    2323
    24 short * iv2array(intvec * iv);
     24short * iv2array(intvec * iv, const ring R);
    2525
    2626// internal:
     
    2929extern "C" double wFunctionalBuch(int *degw, int *lpol, int npol,
    3030       double *rel, double wx, double wNsqr);
    31 void wCall(poly* s, int sl, int *x, double wNsqr);
     31void wCall(poly* s, int sl, int *x, double wNsqr, const ring R);
    3232
    3333#endif
Note: See TracChangeset for help on using the changeset viewer.