Changeset 23b02c9 in git


Ignore:
Timestamp:
Feb 3, 2011, 3:50:00 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8a4a442a35c4d60dea03fb95d20b0a5355b77ea5
Parents:
4cef9e4b8488e22bdbaeeb130b4e09d16ef8fb78
Message:
2 new elim variants for homog. ideals

git-svn-id: file:///usr/local/Singular/svn/trunk@13819 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r4cef9e r23b02c9  
    25422542    else break;
    25432543  }
    2544   ord=(int*)omAlloc0(ordersize*sizeof(int));
    2545   block0=(int*)omAlloc0(ordersize*sizeof(int));
    2546   block1=(int*)omAlloc0(ordersize*sizeof(int));
    2547   wv=(int**) omAlloc0(ordersize*sizeof(int**));
    25482544#if 0
    25492545  if (rIsPluralRing(origR)) // we have too keep the odering: it may be needed
     
    25782574  }
    25792575#else
    2580   for (k=0;k<ordersize-1; k++)
    2581   {
    2582     block0[k+1] = origR->block0[k];
    2583     block1[k+1] = origR->block1[k];
    2584     ord[k+1] = origR->order[k];
    2585     if (origR->wvhdl[k]!=NULL) wv[k+1] = (int*) omMemDup(origR->wvhdl[k]);
    2586   }
    25872576#endif
    2588   block0[0] = 1;
    2589   block1[0] = rVar(origR);
    2590   wv[0]=(int*)omAlloc((rVar(origR) + 1)*sizeof(int));
    2591   memset(wv[0],0,(rVar(origR) + 1)*sizeof(int));
    2592   for (j=0;j<rVar(origR);j++)
    2593     if (pGetExp(delVar,j+1)!=0) wv[0][j]=1;
    2594   // use this special ordering: like ringorder_a, except that pFDeg, pWeights
    2595   // ignore it
    2596   ord[0] = ringorder_aa;
     2577  if ((hom==TRUE) && (origR->OrdSgn==1) && (!rIsPluralRing(origR)))
     2578  {
     2579    #if 1
     2580    // we change to an ordering:
     2581    // aa(1,1,1,...,0,0,0),wp(...),C
     2582    ord=(int*)omAlloc0(4*sizeof(int));
     2583    block0=(int*)omAlloc0(4*sizeof(int));
     2584    block1=(int*)omAlloc0(4*sizeof(int));
     2585    wv=(int**) omAlloc0(4*sizeof(int**));
     2586    block0[0] = block0[1] = 1;
     2587    block1[0] = block1[1] = rVar(origR);
     2588    wv[0]=(int*)omAlloc0((rVar(origR) + 1)*sizeof(int));
     2589    // use this special ordering: like ringorder_a, except that pFDeg, pWeights
     2590    // ignore it
     2591    ord[0] = ringorder_aa;
     2592    for (j=0;j<rVar(origR);j++)
     2593      if (pGetExp(delVar,j+1)!=0) wv[0][j]=1;
     2594    BOOLEAN wp=FALSE;
     2595    for (j=0;j<rVar(origR);j++)
     2596      if (pWeight(j+1,origR)!=1) { wp=TRUE;break; }
     2597    if (wp)
     2598    {
     2599      wv[1]=(int*)omAlloc0((rVar(origR) + 1)*sizeof(int));
     2600      for (j=0;j<rVar(origR);j++)
     2601        wv[1][j]=pWeight(j+1,origR);
     2602      ord[1] = ringorder_wp;
     2603    }
     2604    else
     2605      ord[1] = ringorder_dp;
     2606    #else
     2607    // we change to an ordering:
     2608    // a(w1,...wn),wp(1,...0.....),C
     2609    ord=(int*)omAlloc0(4*sizeof(int));
     2610    block0=(int*)omAlloc0(4*sizeof(int));
     2611    block1=(int*)omAlloc0(4*sizeof(int));
     2612    wv=(int**) omAlloc0(4*sizeof(int**));
     2613    block0[0] = block0[1] = 1;
     2614    block1[0] = block1[1] = rVar(origR);
     2615    wv[0]=(int*)omAlloc0((rVar(origR) + 1)*sizeof(int));
     2616    wv[1]=(int*)omAlloc0((rVar(origR) + 1)*sizeof(int));
     2617    ord[0] = ringorder_a;
     2618    for (j=0;j<rVar(origR);j++)
     2619      wv[0][j]=pWeight(j+1,origR);
     2620    ord[1] = ringorder_wp;
     2621    for (j=0;j<rVar(origR);j++)
     2622      if (pGetExp(delVar,j+1)!=0) wv[1][j]=1;
     2623    #endif
     2624    ord[2] = ringorder_C;
     2625    ord[3] = 0;
     2626  }
     2627  else
     2628  {
     2629    // we change to an ordering:
     2630    // aa(....),orig_ordering
     2631    ord=(int*)omAlloc0(ordersize*sizeof(int));
     2632    block0=(int*)omAlloc0(ordersize*sizeof(int));
     2633    block1=(int*)omAlloc0(ordersize*sizeof(int));
     2634    wv=(int**) omAlloc0(ordersize*sizeof(int**));
     2635    for (k=0;k<ordersize-1; k++)
     2636    {
     2637      block0[k+1] = origR->block0[k];
     2638      block1[k+1] = origR->block1[k];
     2639      ord[k+1] = origR->order[k];
     2640      if (origR->wvhdl[k]!=NULL) wv[k+1] = (int*) omMemDup(origR->wvhdl[k]);
     2641    }
     2642    block0[0] = 1;
     2643    block1[0] = rVar(origR);
     2644    wv[0]=(int*)omAlloc0((rVar(origR) + 1)*sizeof(int));
     2645    for (j=0;j<rVar(origR);j++)
     2646      if (pGetExp(delVar,j+1)!=0) wv[0][j]=1;
     2647    // use this special ordering: like ringorder_a, except that pFDeg, pWeights
     2648    // ignore it
     2649    ord[0] = ringorder_aa;
     2650  }
    25972651  // fill in tmp ring to get back the data later on
    25982652  tmpR  = rCopy0(origR,FALSE,FALSE); // qring==NULL
Note: See TracChangeset for help on using the changeset viewer.