Changeset 1135a61 in git for libpolys/polys/weight.cc


Ignore:
Timestamp:
Apr 19, 2011, 12:00:52 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
ec0d9b416a53586bd0d5b780545cea184cf3d824
Parents:
f27003fd89ac86ed0bd7cc93a1342d129926c00c
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-04-19 12:00:52+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:18+01:00
Message:
fix weight0.c
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/weight.cc

    rf27003 r1135a61  
    2626extern "C" double wFunctionalBuch(int *degw, int *lpol, int npol,
    2727       double *rel, double wx, double wNsqr);
    28 extern "C" void wAdd(int *A, int mons, int kn, int xx);
     28extern "C" void wAdd(int *A, int mons, int kn, int xx, int rvar);
    2929extern "C" void wNorm(int *degw, int *lpol, int npol, double *rel);
    3030extern "C" void wFirstSearch(int *A, int *x, int mons,
    31         int *lpol, int npol, double *rel, double *fopt, double wNsqr);
     31        int *lpol, int npol, double *rel, double *fopt, double wNsqr, int rvar);
    3232extern "C" void wSecondSearch(int *A, int *x, int *lpol,
    33         int npol, int mons, double *rel, double *fk, double wNsqr);
     33        int npol, int mons, double *rel, double *fk, double wNsqr, int rvar);
    3434extern "C" void wGcd(int *x, int n);
    3535
     
    134134  memset(degw, 0, mons * sizeof(int));
    135135  for (i = n; i!=0; i--)
    136     wAdd(A, mons, i, 1);
     136    wAdd(A, mons, i, 1, rVar(R));
    137137  wNorm(degw, lpol, npol, rel);
    138138  f1 = (*wFunctional)(degw, lpol, npol, rel, (double)1.0, wNsqr);
     
    141141  fx = (double)2.0 * eps;
    142142  memset(x, 0, (n + 1) * sizeof(int));
    143   wFirstSearch(A, x, mons, lpol, npol, rel, &fx, wNsqr);
     143  wFirstSearch(A, x, mons, lpol, npol, rel, &fx, wNsqr, rVar(R));
    144144  if (TEST_OPT_PROT) Print("// %e\n",fx);
    145145  memcpy(x + 1, xopt + 1, n * sizeof(int));
     
    148148  {
    149149    x[i] *= 16;
    150     wAdd(A, mons, i, x[i]);
    151   }
    152   wSecondSearch(A, x, lpol, npol, mons, rel, &fx, wNsqr);
     150    wAdd(A, mons, i, x[i], rVar(R));
     151  }
     152  wSecondSearch(A, x, lpol, npol, mons, rel, &fx, wNsqr, rVar(R));
    153153  if (TEST_OPT_PROT) Print("// %e\n",fx);
    154154  if (fx >= eps)
     
    166166//      memset(degw, 0, mons * sizeof(int));
    167167//      for (i = n; i!=0; i--)
    168 //        wAdd(A, mons, i, x[i]);
     168//        wAdd(A, mons, i, x[i], rVar(R));
    169169//      eps = wPrWeight(x, n);
    170170//      fx = (*wFunctional)(degw, lpol, npol, rel, eps);
Note: See TracChangeset for help on using the changeset viewer.