Changeset 43cbc0 in git


Ignore:
Timestamp:
Feb 23, 2009, 8:22:27 PM (14 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
e8e2b6921594abbde4a1dccae43bc5f6b73440d1
Parents:
51542244f370752f7a57d84632cc1650dc8a4ed5
Message:
*levandov: massive attack of RATGRING things on BB algorithm


git-svn-id: file:///usr/local/Singular/svn/trunk@11458 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/gr_kstd2.cc

    r515422 r43cbc0  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gr_kstd2.cc,v 1.28 2009-02-23 11:26:29 Singular Exp $ */
     4/* $Id: gr_kstd2.cc,v 1.29 2009-02-23 19:22:27 levandov Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: noncomm. alg. of Buchberger
     
    11231123//        }
    11241124
    1125       strat->P.p = nc_CreateSpoly(strat->P.p1,strat->P.p2,currRing);
     1125     
     1126      if( ! rIsRatGRing(currRing) )
     1127      {
     1128        strat->P.p = nc_CreateSpoly(strat->P.p1,strat->P.p2,currRing);
     1129      }
     1130      else
     1131      {
     1132        /* rational case */
     1133        strat->P.p = nc_rat_CreateSpoly(strat->P.p1,strat->P.p2,currRing->real_var_start-1,currRing);
     1134      }
     1135
    11261136
    11271137#ifdef PDEBUG
  • kernel/gring.cc

    r515422 r43cbc0  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.68 2008-07-26 14:28:03 motsak Exp $
     9 *  Version: $Id: gring.cc,v 1.69 2009-02-23 19:22:27 levandov Exp $
    1010 *******************************************************************/
    1111
     
    4545#include <ncSAMult.h> // for CMultiplier etc classes
    4646#include <ncSAFormula.h> // for CFormulaPowerMultiplier and enum Enum_ncSAType
     47
     48#ifdef HAVE_RATGRING
     49#include "ratgring.h"
     50#endif
    4751
    4852
     
    18961900  }
    18971901
    1898   poly m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
     1902  poly m;
     1903  if ( ! rIsRatGRing(currRing))
     1904  {
     1905    m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
     1906  }
     1907  else
     1908  {
     1909    /* rational version */
     1910    m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
     1911  }
    18991912
    19001913//  n_Delete(&p_GetCoeff(m, r), r);
  • kernel/kutil.cc

    r515422 r43cbc0  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.127 2009-02-23 13:32:35 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.128 2009-02-23 19:22:27 levandov Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    5353#include "shiftgb.h"
    5454#include "prCopy.h"
     55
     56#ifdef HAVE_RATGRING
     57#include "ratgring.h"
     58#endif
    5559
    5660#ifdef KDEBUG
     
    13661370*/
    13671371
    1368 
    13691372void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
    13701373{
     
    13821385  Lp.lcm = pInit();
    13831386
     1387#ifndef HAVE_RATGRING
    13841388  pLcm(p,strat->S[i],Lp.lcm);
     1389#elif defined(HAVE_RATGRING)
     1390  //  if (rIsRatGRing(currRing))
     1391  pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     1392#endif
    13851393  pSetm(Lp.lcm);
    13861394
     
    22982306    if (new_pair)
    22992307    {
     2308#ifdef HAVE_RATGRING
     2309      if (currRing->real_var_start>0)
     2310        chainCritPart(h,ecart,strat);
     2311      else
     2312#endif
    23002313      strat->chainCrit(h,ecart,strat);
    23012314    }
     
    55495562  {
    55505563     strat->chainCrit=chainCritPart;
     5564     /* enterOnePairNormal get rational part in it */
    55515565  }
    55525566#endif
     
    55655579#ifdef HAVE_PLURAL
    55665580  // and r is plural_ring
     5581  //  hence this holds for r a rational_plural_ring
    55675582  if( rIsPluralRing(currRing) || (rIsSCA(currRing) && !strat->z2homog) )
    55685583  {    //or it has non-quasi-comm type... later
     
    71957210    if (new_pair)
    71967211    {
    7197 #ifdef HAVE_RATGRING
    7198       if (currRing->real_var_start>0)
    7199         chainCritPart(h,ecart,strat);
    7200       else
    7201 #endif
    72027212      strat->chainCrit(h,ecart,strat);
    72037213    }
  • kernel/ratgring.cc

    r515422 r43cbc0  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: ratgring.cc,v 1.14 2009-02-21 19:30:56 levandov Exp $
     9 *  Version: $Id: ratgring.cc,v 1.15 2009-02-23 19:22:27 levandov Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    3737  /* Don't do a pSetm here, otherwise hres/lres chockes */
    3838}
     39
     40/*2
     41* returns the rational LCM of the head terms of a and b
     42* without coefficient!!!
     43*/
     44poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
     45{
     46  poly m = // p_One( r);
     47          p_Init(r);
     48
     49  const int pVariables = r->N;
     50
     51  //  for (int i = pVariables; i>=r->real_var_start; i--)
     52  for (int i = r->real_var_end; i>=r->real_var_start; i--)
     53  {
     54    const int lExpA = p_GetExp (a, i, r);
     55    const int lExpB = p_GetExp (b, i, r);
     56
     57    p_SetExp (m, i, si_max(lExpA, lExpB), r);
     58  }
     59
     60  p_SetComp (m, lCompM, r);
     61  p_Setm(m,r);
     62  n_New(&(p_GetCoeff(m, r)), r);
     63
     64  return(m);
     65};
    3966
    4067// void pLcmRat(poly a, poly b, poly m, poly pshift)
  • kernel/ratgring.h

    r515422 r43cbc0  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ratgring.h,v 1.7 2009-02-21 19:30:56 levandov Exp $ */
     6/* $Id: ratgring.h,v 1.8 2009-02-23 19:22:27 levandov Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    2121void pLcmRat(poly a, poly b, poly m, int rat_shift);
    2222
    23 //void pLcmRat(poly a, poly b, poly m, poly pshift);
     23poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r);
    2424
    2525poly p_GetCoeffRat(poly p, int ishift, ring r);
Note: See TracChangeset for help on using the changeset viewer.