Changeset 7245240 in git for kernel/kutil.cc


Ignore:
Timestamp:
Jul 9, 2008, 10:26:30 AM (16 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7739c953f47596b385dcf31bc6786a1e3ac94590
Parents:
c9c60f894de6f136a5e83377562698e0806b77c5
Message:
stratChangeTailRing für gcd/strong polys


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

Legend:

Unmodified
Added
Removed
  • kernel/kutil.cc

    rc9c60f r7245240  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.99 2008-07-08 13:29:46 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.100 2008-07-09 08:26:30 wienand Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    12661266  number d, s, t;
    12671267  assume(i<=strat->sl);
    1268   LObject  Lp;
    1269   poly m1, m2, erg, gcd;
     1268  assume(atR >= 0);
     1269  poly m1, m2, gcd;
    12701270
    12711271  d = nExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t);
     
    12801280
    12811281  k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
    1282 
     1282  while (! kCheckStrongCreation(atR, m1, i, m2, strat) )
     1283  {
     1284    memset(&(strat->P), 0, sizeof(strat->P));
     1285    kStratChangeTailRing(strat);
     1286    strat->P = *(strat->R[atR]);
     1287    p_LmFree(m1, strat->tailRing);
     1288    p_LmFree(m2, strat->tailRing);
     1289    p_LmFree(gcd, currRing);
     1290    k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
     1291  }
    12831292  pSetCoeff0(m1, s);
    12841293  pSetCoeff0(m2, t);
    12851294  pSetCoeff0(gcd, d);
    1286 
    12871295
    12881296#ifdef KDEBUG
     
    13051313#endif
    13061314
    1307   erg = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing);
    1308   pNext(gcd) = erg;
    1309   pLmDelete(m1);
    1310   pLmDelete(m2);
     1315  pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing);
     1316  p_LmDelete(m1, strat->tailRing);
     1317  p_LmDelete(m2, strat->tailRing);
    13111318
    13121319#ifdef KDEBUG
     
    13221329  h.tailRing = strat->tailRing;
    13231330  int posx;
    1324   if (h.p!=NULL)
    1325   {
    1326     if (TEST_OPT_INTSTRATEGY)
    1327     {
    1328       h.pCleardenom(); // also does a pContent
    1329     }
    1330     else
    1331     {
    1332       h.pNorm();
    1333     }
     1331  h.pCleardenom();
    13341332    strat->initEcart(&h);
    13351333    if (strat->Ll==-1)
     
    13391337    h.sev = pGetShortExpVector(h.p);
    13401338    h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
    1341     if (pNext(p) != NULL)
    1342     {
    1343       // What does this? (Oliver)
    1344       // pShallowCopyDeleteProc p_shallow_copy_delete
    1345       //      = pGetShallowCopyDeleteProc(strat->tailRing, new_tailRing);
    1346       // pNext(p) = p_shallow_copy_delete(pNext(p),
    1347       //              currRing, strat->tailRing, strat->tailRing->PolyBin);
    1348     }
    13491339    enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
    1350   }
    13511340  return TRUE;
    13521341}
     
    26332622      }
    26342623    }
    2635 
    2636 #ifdef HAVE_VANGB
    2637     // initenterzeropairsRing(h, ecart, strat, atR);
    2638 #endif
    26392624
    26402625    if (new_pair) chainCritRing(h,ecart,strat);
     
    57725757}
    57735758
     5759#ifdef HAVE_RINGS
     5760/***************************************************************
     5761 *
     5762 * Checks, if we can compute the gcd poly / strong pair
     5763 * gcd-poly = m1 * R[atR] + m2 * S[atS]
     5764 *
     5765 ***************************************************************/
     5766BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
     5767{
     5768  assume(strat->S_2_R[atS] >= -1 && strat->S_2_R[atS] <= strat->tl);
     5769  assume(strat->tailRing != currRing);
     5770
     5771  poly p1_max = (strat->R[atR])->max;
     5772  poly p2_max = (strat->R[strat->S_2_R[atS]])->max;
     5773
     5774  if ((p1_max != NULL && !p_LmExpVectorAddIsOk(m1, p1_max, strat->tailRing)) ||
     5775      (p2_max != NULL && !p_LmExpVectorAddIsOk(m2, p2_max, strat->tailRing)))
     5776  {
     5777    return FALSE;
     5778  }
     5779  return TRUE;
     5780}
     5781#endif
     5782
    57745783BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject* T, unsigned long expbound)
    57755784{
     
    58905899  if (rField_is_Ring(currRing))
    58915900  {
    5892     l += 20; // TEMP, TODO OLI
    58935901    l *= 2;
    58945902  }
Note: See TracChangeset for help on using the changeset viewer.