source: git/Singular/dyn_modules/gfanlib/ppinitialReduction.cc @ dffd154

spielwiese
Last change on this file since dffd154 was dffd154, checked in by Yue Ren <ren@…>, 10 years ago
chg: status update 20.09.
  • Property mode set to 100644
File size: 18.2 KB
Line 
1#include <kernel/polys.h>
2#include <Singular/ipid.h>
3
4#include <libpolys/polys/monomials/p_polys.h>
5#include <singularWishlist.h>
6#include <tropicalStrategy.h>
7
8#include <map>
9#include <set>
10
11bool isOrderingLocalInT(const ring r)
12{
13  poly one = p_One(r);
14  poly t = p_One(r);
15  p_SetExp(t,1,1,r);
16  p_Setm(t,r);
17  int s = p_LmCmp(one,t,r);
18  p_Delete(&one,r);
19  p_Delete(&t,r);
20  return (s==1);
21}
22
23/***
24 * changes a polynomial g with the help p-t such that
25 * 1) each term of g has a distinct monomial in x
26 * 2) no term of g has a coefficient divisible by p
27 * in particular, this means that all g_\alpha can be obtained
28 * by reading the coefficients and that g is initially reduced
29 * with respect to p-t
30 **/
31bool pReduce(poly &g, const number p, const ring r)
32{
33  if (g==NULL)
34    return false;
35  p_Test(g,r);
36
37  poly toBeChecked = pNext(g);
38  pNext(g) = NULL; poly gEnd = g;
39  poly gCache;
40
41  number coeff, pPower; int power; poly subst;
42  while(toBeChecked)
43  {
44    for (gCache = g; gCache; pIter(gCache))
45      if (p_LeadmonomDivisibleBy(gCache,toBeChecked,r)) break;
46    if (gCache)
47    {
48      n_Power(p,p_GetExp(toBeChecked,1,r)-p_GetExp(gCache,1,r),&pPower,r->cf);
49      coeff = n_Mult(p_GetCoeff(toBeChecked,r),pPower,r->cf);
50      p_SetCoeff(gCache,n_Add(p_GetCoeff(gCache,r),coeff,r->cf),r);
51      n_Delete(&pPower,r->cf); n_Delete(&coeff,r->cf);
52      toBeChecked=p_LmDeleteAndNext(toBeChecked,r);
53    }
54    else
55    {
56      if (n_DivBy(p_GetCoeff(toBeChecked,r),p,r->cf))
57      {
58        power=1;
59        coeff=n_Div(p_GetCoeff(toBeChecked,r),p,r->cf);
60        while (n_DivBy(coeff,p,r->cf))
61        {
62          power++;
63          number coeff0 = n_Div(coeff,p,r->cf);
64          n_Delete(&coeff,r->cf);
65          coeff = coeff0;
66          coeff0 = NULL;
67          if (power<1)
68          {
69            WerrorS("pReduce: overflow in exponent");
70            return true;
71          }
72        }
73        subst=p_LmInit(toBeChecked,r);
74        p_AddExp(subst,1,power,r);
75        p_SetCoeff(subst,coeff,r);
76        p_Setm(subst,r); p_Test(subst,r);
77        toBeChecked=p_LmDeleteAndNext(toBeChecked,r);
78        toBeChecked=p_Add_q(toBeChecked,subst,r);
79        p_Test(toBeChecked,r);
80      }
81      else
82      {
83        pNext(gEnd)=toBeChecked;
84        pIter(gEnd); pIter(toBeChecked);
85        pNext(gEnd)=NULL;
86        p_Test(g,r);
87      }
88    }
89  }
90  p_Test(g,r);
91  return false;
92}
93
94void ptNormalize(poly* gStar, const number p, const ring r)
95{
96  poly g = *gStar;
97  if (g==NULL || n_DivBy(p_GetCoeff(g,r),p,r->cf))
98    return;
99  p_Test(g,r);
100
101  // create p-t
102  poly pt = p_Init(r);
103  p_SetCoeff(pt,n_Copy(p,r->cf),r);
104
105  pNext(pt) = p_Init(r);
106  p_SetExp(pNext(pt),1,1,r);
107  p_Setm(pNext(pt),r);
108  p_SetCoeff(pNext(pt),n_Init(-1,r->cf),r);
109
110  // make g monic with the help of p-t
111  number a,b;
112  number gcd = n_ExtGcd(p_GetCoeff(g,r),p,&a,&b,r->cf);
113  assume(n_IsUnit(gcd,r->cf));
114  // now a*leadcoef(g)+b*p = gcd with gcd being a unit
115  // so a*g+b*(p-t)*leadmonom(g) should have a unit as leading coefficient
116  // but first check whether b is 0,
117  // since p_Mult_nn doesn't allow 0 as number input
118  if (n_IsZero(b,r->cf))
119  {
120    n_Delete(&a,r->cf);
121    n_Delete(&b,r->cf);
122    n_Delete(&gcd,r->cf);
123    p_Delete(&pt,r);
124    return;
125  }
126  poly m = p_Head(g,r);
127  p_SetCoeff(m,n_Init(1,r->cf),r);
128  g = p_Add_q(p_Mult_nn(g,a,r),p_Mult_nn(p_Mult_mm(pt,m,r),b,r),r);
129  n_Delete(&a,r->cf);
130  n_Delete(&b,r->cf);
131  n_Delete(&gcd,r->cf);
132  p_Delete(&m,r);
133
134  p_Test(g,r);
135  return;
136}
137
138void ptNormalize(ideal I, const number p, const ring r)
139{
140  for (int i=0; i<idSize(I); i++)
141    ptNormalize(&(I->m[i]),p,r);
142  return;
143}
144
145#ifndef NDEBUG
146BOOLEAN pppReduce(leftv res, leftv args)
147{
148  leftv u = args;
149  if ((u != NULL) && (u->Typ() == POLY_CMD))
150  {
151    poly g; number p = n_Init(3,currRing->cf);
152    omUpdateInfo();
153    Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
154    g = (poly) u->CopyD();
155    (void) pReduce(g,p,currRing);
156    p_Delete(&g,currRing);
157    omUpdateInfo();
158    Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
159    g = (poly) u->CopyD();
160    (void) pReduce(g,p,currRing);
161    n_Delete(&p,currRing->cf);
162    res->rtyp = POLY_CMD;
163    res->data = (char*) g;
164    return FALSE;
165  }
166  return TRUE;
167}
168#endif //NDEBUG
169
170bool pReduce0(ideal &I, const number p, const ring r)
171{
172  int k = idSize(I);
173  for (int i=0; i<k; i++)
174  {
175    if (I->m[i]!=NULL)
176    {
177      number c = p_GetCoeff(I->m[i],r);
178      if (!n_Equal(p,c,r->cf))
179        if (pReduce(I->m[i],p,r))
180          return true;
181    }
182  }
183  return false;
184}
185
186
187/***
188 * reduces h initially with respect to g,
189 * returns false if h was initially reduced in the first place,
190 * returns true if reductions have taken place.
191 * assumes that h and g are in pReduced form and homogeneous in x of the same degree
192 **/
193bool ppreduceInitially(poly* hStar, const poly g, const ring r)
194{
195  poly h = *hStar;
196  if (h==NULL || g==NULL)
197    return false;
198  p_Test(h,r);
199  p_Test(g,r);
200  poly hCache;
201  for (hCache=h; hCache; pIter(hCache))
202    if (p_LeadmonomDivisibleBy(g,hCache,r)) break;
203  if (hCache)
204  {
205    number gAlpha = p_GetCoeff(g,r);
206    poly hAlphaT = p_Init(r);
207    p_SetCoeff(hAlphaT,n_Copy(p_GetCoeff(hCache,r),r->cf),r);
208    p_SetExp(hAlphaT,1,p_GetExp(hCache,1,r)-p_GetExp(g,1,r),r);
209    for (int i=2; i<=r->N; i++)
210      p_SetExp(hAlphaT,i,0,r);
211    p_Setm(hAlphaT,r); p_Test(hAlphaT,r);
212    poly q1 = p_Mult_nn(h,gAlpha,r); p_Test(q1,r);
213    poly q2 = p_Mult_q(p_Copy(g,r),hAlphaT,r); p_Test(q2,r);
214    q2 = p_Neg(q2,r); p_Test(q2,r);
215    h = p_Add_q(q1,q2,r);
216    p_Test(h,r);
217    hStar = &h;
218    return true;
219  }
220  return false;
221}
222
223
224#ifndef NDEBUG
225BOOLEAN ppreduceInitially0(leftv res, leftv args)
226{
227  leftv u = args;
228  if ((u != NULL) && (u->Typ() == POLY_CMD))
229  {
230    leftv v = u->next;
231    if ((v != NULL) && (v->Typ() == POLY_CMD))
232    {
233      poly g,h;
234      omUpdateInfo();
235      Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
236      h = (poly) u->CopyD();
237      g = (poly) v->CopyD();
238      (void)ppreduceInitially(&h,g,currRing);
239      p_Delete(&h,currRing);
240      p_Delete(&g,currRing);
241      omUpdateInfo();
242      Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
243      h = (poly) u->CopyD();
244      g = (poly) v->CopyD();
245      (void)ppreduceInitially(&h,g,currRing);
246      p_Delete(&g,currRing);
247      res->rtyp = POLY_CMD;
248      res->data = (char*) h;
249      return FALSE;
250    }
251  }
252  return TRUE;
253}
254#endif //NDEBUG
255
256
257/***
258 * reduces I initially with respect to itself and with respect to p-t.
259 * also sorts the generators of I with respect to the leading monomials in descending order.
260 * assumes that I is generated by elements which are homogeneous in x of the same degree.
261 **/
262bool ppreduceInitially(ideal I, const number p, const ring r)
263{
264  int m=idSize(I),n=m; poly cache;
265  do
266  {
267    int j=0;
268    for (int i=1; i<n; i++)
269    {
270      if (p_LmCmp(I->m[i-1],I->m[i],r)<0)
271      {
272        cache=I->m[i-1];
273        I->m[i-1]=I->m[i];
274        I->m[i]=cache;
275        j = i;
276      }
277    }
278    n=j;
279  } while(n);
280  for (int i=0; i<m; i++)
281    if (pReduce(I->m[i],p,r)) return true;
282
283  /***
284   * the first pass. removing terms with the same monomials in x as lt(g_i) out of g_j for i<j
285   **/
286  for (int i=0; i<m-1; i++)
287    for (int j=i+1; j<m; j++)
288      if (ppreduceInitially(&I->m[j], I->m[i], r) && pReduce(I->m[j],p,r)) return true;
289
290  /***
291   * the second pass. removing terms divisible by lt(g_j) out of g_i for i<j
292   **/
293  for (int i=0; i<m-1; i++)
294    for (int j=i+1; j<m; j++)
295      if (ppreduceInitially(&I->m[i], I->m[j],r) && pReduce(I->m[i],p,r)) return true;
296
297  /***
298   * removes the elements of I which have been reduced to 0 in the previous two passes
299   **/
300  idSkipZeroes(I);
301  return false;
302}
303
304
305#ifndef NDEBUG
306BOOLEAN ppreduceInitially1(leftv res, leftv args)
307{
308  leftv u = args;
309  if ((u != NULL) && (u->Typ() == IDEAL_CMD))
310  {
311    leftv v = u->next;
312    if ((v != NULL) && (v->Typ() == NUMBER_CMD))
313    {
314      ideal I; number p;
315      omUpdateInfo();
316      Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
317      I = (ideal) u->CopyD();
318      p = (number) v->CopyD();
319      (void) ppreduceInitially(I,p,currRing);
320      id_Delete(&I,currRing);
321      n_Delete(&p,currRing->cf);
322      omUpdateInfo();
323      Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
324      I = (ideal) u->CopyD();
325      p = (number) v->CopyD();
326      (void) ppreduceInitially(I,p,currRing);
327      n_Delete(&p,currRing->cf);
328      res->rtyp = IDEAL_CMD;
329      res->data = (char*) I;
330      return FALSE;
331    }
332  }
333  return TRUE;
334}
335#endif //NDEBUG
336
337
338/***
339 * inserts g into I and reduces I with respect to itself and p-t
340 * assumes that I was already sorted and initially reduced in the first place
341 **/
342bool ppreduceInitially(ideal I, const number p, const poly g, const ring r)
343{
344  idInsertPoly(I,g);
345  int n=idSize(I);
346  int j;
347  for (j=n-1; j>0; j--)
348  {
349    if (p_LmCmp(I->m[j], I->m[j-1],r)>0)
350    {
351      poly cache = I->m[j];
352      I->m[j] = I->m[j-1];
353      I->m[j-1] = cache;
354    }
355    else
356      break;
357  }
358
359  /***
360   * the first pass. removing terms with the same monomials in x as lt(g_i) out of g_j for i<j
361   * removing terms with the same monomials in x as lt(g_j) out of g_k for j<k
362   **/
363  for (int i=0; i<j; i++)
364    if (ppreduceInitially(&I->m[j], I->m[i], r) && pReduce(I->m[j],p,r)) return true;
365  for (int k=j+1; k<n; k++)
366    if (ppreduceInitially(&I->m[k], I->m[j], r) && pReduce(I->m[k],p,r)) return true;
367
368  /***
369   * the second pass. removing terms divisible by lt(g_j) and lt(g_k) out of g_i for i<j<k
370   * removing terms divisible by lt(g_k) out of g_j for j<k
371   **/
372  for (int i=0; i<j; i++)
373    for (int k=j; k<n; k++)
374      if (ppreduceInitially(&I->m[i], I->m[k], r) && pReduce(I->m[i],p,r)) return true;
375  for (int k=j+1; k<n; k++)
376    if (ppreduceInitially(&I->m[j], I->m[k], r) && pReduce(I->m[j],p,r)) return true;
377
378  /***
379   * removes the elements of I which have been reduced to 0 in the previous two passes
380   **/
381  idSkipZeroes(I);
382  return false;
383}
384
385
386#ifndef NDEBUG
387BOOLEAN ppreduceInitially2(leftv res, leftv args)
388{
389  leftv u = args;
390  if ((u != NULL) && (u->Typ() == IDEAL_CMD))
391  {
392    leftv v = u->next;
393    if ((v != NULL) && (v->Typ() == NUMBER_CMD))
394    {
395      leftv w = v->next;
396      if ((w != NULL) && (w->Typ() == POLY_CMD))
397      {
398        ideal I; number p; poly g;
399        omUpdateInfo();
400        Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
401        I = (ideal) u->CopyD();
402        p = (number) v->CopyD();
403        g = (poly) w->CopyD();
404        (void) ppreduceInitially(I,p,g,currRing);
405        id_Delete(&I,currRing);
406        n_Delete(&p,currRing->cf);
407        omUpdateInfo();
408        Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
409        I = (ideal) u->CopyD();
410        p = (number) v->CopyD();
411        g = (poly) w->CopyD();
412        (void) ppreduceInitially(I,p,g,currRing);
413        n_Delete(&p,currRing->cf);
414        res->rtyp = IDEAL_CMD;
415        res->data = (char*) I;
416        return FALSE;
417      }
418    }
419  }
420  return TRUE;
421}
422#endif //NDEBUG
423
424
425/***
426 * reduces H initially with respect to itself, with respect to p-t,
427 * and with respect to G.
428 * assumes that the generators of H are homogeneous in x of the same degree,
429 * assumes that the generators of G are homogeneous in x of lesser degree.
430 **/
431bool ppreduceInitially(ideal &H, const number p, const ideal G, const ring r)
432{
433  /***
434   * Step 1: reduce H initially with respect to itself and with respect to p-t
435   **/
436  if (ppreduceInitially(H,p,r)) return true;
437
438  /***
439   * Step 2: initialize a working list T and an ideal I in which the reductions will take place
440   **/
441  int m=idSize(H),n=0;
442  ideal I = idInit(m), T = idInit(m);
443  for (int i=0; i<m; i++)
444  {
445    I->m[i]=H->m[i];
446    if (pNext(H->m[i])) T->m[n++]=H->m[i];
447  }
448  poly g; int k=n;
449  do
450  {
451    int j=0;
452    for (int i=1; i<k; i++)
453    {
454      if (p_LmCmp(pNext(T->m[i-1]),pNext(T->m[i]),r)<0)
455      {
456        g=T->m[i-1];
457        T->m[i-1]=T->m[i];
458        T->m[i]=g;
459        j = i;
460      }
461    }
462    k=j;
463  } while(k);
464
465  /***
466   * Step 3: as long as the working list is not empty, successively reduce terms in it
467   *   by adding suitable elements to I and reducing it initially with respect to itself
468   **/
469  k=idSize(G);
470  while (n)
471  {
472    int i=0; for (; i<k; i++)
473      if (p_LeadmonomDivisibleBy(G->m[i],pNext(T->m[0]),r)) break;
474    if (i<k)
475    {
476      g = p_One(r);
477      for (int j=2; j<=r->N; j++)
478        p_SetExp(g,j,p_GetExp(pNext(T->m[0]),j,r)-p_GetExp(G->m[i],j,r),r);
479      p_Setm(g,r);
480      g = p_Mult_q(g,p_Copy(G->m[i],r),r);
481      ppreduceInitially(I,p,g,r);
482    }
483    else
484      pIter(T->m[0]);
485    for (int i=0; i<n;)
486    {
487      if (!pNext(T->m[i]))
488      {
489        for (int j=i; j<n-1; j++)
490          T->m[j]=T->m[j+1];
491        T->m[--n]=NULL;
492      }
493      else
494        i++;
495    }
496    int l = n;
497    do
498    {
499      int j=0;
500      for (int i=1; i<l; i++)
501      {
502        if (p_LmCmp(pNext(T->m[i-1]),pNext(T->m[i]),r)<0)
503        {
504          g=T->m[i-1];
505          T->m[i-1]=I->m[i];
506          T->m[i]=g;
507          j = i;
508        }
509      }
510      l=j;
511    } while(l);
512  }
513
514  /***
515   * Step 4: cleanup, delete all polynomials in I which have been added in Step 3
516   **/
517  k=idSize(I);
518  for (int i=0; i<k; i++)
519  {
520    for (int j=0; j<m; j++)
521    {
522      if (p_LeadmonomDivisibleBy(H->m[j],I->m[i],r))
523      {
524        I->m[i]=NULL;
525        break;
526      }
527    }
528  }
529  id_Delete(&I,r);
530  id_Delete(&T,r);
531  return false;
532}
533
534
535#ifndef NDEBUG
536BOOLEAN ppreduceInitially3(leftv res, leftv args)
537{
538  leftv u = args;
539  if ((u != NULL) && (u->Typ() == IDEAL_CMD))
540  {
541    leftv v = u->next;
542    if ((v != NULL) && (v->Typ() == NUMBER_CMD))
543    {
544      leftv w = v->next;
545      if ((w != NULL) && (w->Typ() == IDEAL_CMD))
546      {
547        ideal H,G; number p;
548        omUpdateInfo();
549        Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
550        H = (ideal) u->CopyD();
551        p = (number) v->CopyD();
552        G = (ideal) w->CopyD();
553        (void) ppreduceInitially(H,p,G,currRing);
554        id_Delete(&H,currRing);
555        id_Delete(&G,currRing);
556        n_Delete(&p,currRing->cf);
557        omUpdateInfo();
558        Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
559        H = (ideal) u->CopyD();
560        p = (number) v->CopyD();
561        G = (ideal) w->CopyD();
562        (void) ppreduceInitially(H,p,G,currRing);
563        n_Delete(&p,currRing->cf);
564        id_Delete(&G,currRing);
565        res->rtyp = IDEAL_CMD;
566        res->data = (char*) H;
567        return FALSE;
568      }
569    }
570  }
571  return TRUE;
572}
573#endif //NDEBUG
574
575
576static std::vector<int> synchronize(const ideal I, const ideal Hi)
577{
578  int k = idSize(I);
579  int l = idSize(Hi);
580  std::vector<int> synch(k);
581  int j;
582  for (int i=0; i<k; i++)
583  {
584    for (j=0; j<l; j++)
585    {
586      if (I->m[i]==Hi->m[j])
587      {
588        synch[i] = j;
589        break;
590      }
591    }
592    if (j==l)
593      synch[i] = -1;
594  }
595  return synch;
596}
597
598static void synchronize(ideal I, const ideal Hi, const std::vector<int> synch)
599{
600  for (unsigned i=0; i<synch.size(); i++)
601    if (synch[i]>=0)
602    {
603      I->m[i] = Hi->m[synch[i]];
604      std::cout << i << " -> " << synch[i] << std::endl;
605    }
606}
607
608void z_Write(number p, ring r)
609{
610  poly g = p_One(r);
611  p_SetCoeff(g,p,r);
612  p_Write(g,r);
613  return;
614}
615
616/**
617 * reduces I initially with respect to itself.
618 * assumes that the generators of I are homogeneous in x and that p-t is in I.
619 */
620bool ppreduceInitially(ideal I, const ring r, const number p)
621{
622  assume(!n_IsUnit(p,r->cf));
623
624  /***
625   * Step 1: split up I into components of same degree in x
626   *  the lowest component should only contain p-t
627   **/
628  std::map<long,ideal> H; int n = idSize(I);
629  for (int i=0; i<n; i++)
630  {
631    I->m[i] = p_Cleardenom(I->m[i],r);
632    long d = 0;
633    for (int j=2; j<=r->N; j++)
634      d += p_GetExp(I->m[i],j,r);
635    std::map<long,ideal>::iterator it = H.find(d);
636    if (it != H.end())
637      idInsertPoly(it->second,I->m[i]);
638    else
639    {
640      std::pair<long,ideal> Hd(d,idInit(1));
641      Hd.second->m[0] = I->m[i];
642      H.insert(Hd);
643    }
644  }
645
646  std::map<long,ideal>::iterator it=H.begin();
647  it++;
648  ideal Hi = it->second;
649
650  /***
651   * Step 2: reduce each component initially with respect to itself
652   *  and all lower components
653   **/
654  // std::vector<int> synch = synchronize(I,Hi);
655  if (ppreduceInitially(Hi,p,r)) return true;
656  // synchronize(I,Hi,synch);
657  id_Test(Hi,r);
658  id_Test(I,r);
659
660  ideal G = idInit(n); int m=0;
661  ideal GG = (ideal) omAllocBin(sip_sideal_bin);
662  GG->nrows = 1; GG->rank = 1; GG->m=NULL;
663
664  for (it++; it!=H.end(); it++)
665  {
666    int l=idSize(Hi); int k=l; poly cache;
667    /**
668     * sorts Hi according to degree in t in descending order
669     * (lowest first, highest last)
670     */
671    do
672    {
673      int j=0;
674      for (int i=1; i<k; i++)
675      {
676        if (p_GetExp(Hi->m[i-1],1,r)<p_GetExp(Hi->m[i],1,r))
677        {
678          cache=Hi->m[i-1];
679          Hi->m[i-1]=Hi->m[i];
680          Hi->m[i]=cache;
681          j = i;
682        }
683      }
684      k=j;
685    } while(k);
686    int kG=n-m, kH=0;
687    for (int i=n-m-l; i<n; i++)
688    {
689      if (kG==n)
690      {
691        memcpy(&(G->m[i]),&(Hi->m[kH]),(n-i)*sizeof(poly));
692        break;
693      }
694      if (kH==l)
695        break;
696      if (p_GetExp(G->m[kG],1,r)>p_GetExp(Hi->m[kH],1,r))
697        G->m[i] = G->m[kG++];
698      else
699        G->m[i] = Hi->m[kH++];
700    }
701    m += l; IDELEMS(GG) = m; GG->m = &G->m[n-m];
702    // std::vector<int> synch = synchronize(I,it->second);
703    if (ppreduceInitially(it->second,p,GG,r)) return true;
704    // synchronize(I,it->second,synch);
705    idShallowDelete(&Hi); Hi = it->second;
706  }
707  idShallowDelete(&Hi);
708
709  ptNormalize(I,p,r);
710  omFreeBin((ADDRESS)GG, sip_sideal_bin); idShallowDelete(&G);
711  return false;
712}
713
714
715// #ifndef NDEBUG
716// BOOLEAN ppreduceInitially4(leftv res, leftv args)
717// {
718//   leftv u = args;
719//   if ((u != NULL) && (u->Typ() == IDEAL_CMD))
720//   {
721//     ideal I;
722//     omUpdateInfo();
723//     Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
724//     I = (ideal) u->CopyD();
725//     (void) ppreduceInitially(I,currRing);
726//     id_Delete(&I,currRing);
727//     omUpdateInfo();
728//     Print("usedBytesAfter=%ld\n",om_Info.UsedBytes);
729//     I = (ideal) u->CopyD();
730//     (void) ppreduceInitially(I,currRing);
731//     res->rtyp = IDEAL_CMD;
732//     res->data = (char*) I;
733//     return FALSE;
734//   }
735//   return TRUE;
736// }
737// #endif
738
739
740// BOOLEAN ppreduceInitially(leftv res, leftv args)
741// {
742//   leftv u = args;
743//   if ((u != NULL) && (u->Typ() == IDEAL_CMD))
744//   {
745//     ideal I = (ideal) u->CopyD();
746//     (void) ppreduceInitially(I,currRing);
747//     res->rtyp = IDEAL_CMD;
748//     res->data = (char*) I;
749//     return FALSE;
750//   }
751//   return TRUE;
752// }
Note: See TracBrowser for help on using the repository browser.