Changeset 0ffc823 in git


Ignore:
Timestamp:
Feb 27, 2009, 8:30:47 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8066e80d7cea5de772f7b10b2b1930521cb72523
Parents:
f58aa61ada5934435d94d1d486fb70912543c11a
Message:
*levandov: early unit detection in rational GB


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

Legend:

Unmodified
Added
Removed
  • kernel/gr_kstd2.cc

    rf58aa6 r0ffc823  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gr_kstd2.cc,v 1.35 2009-02-27 16:56:51 levandov Exp $ */
     4/* $Id: gr_kstd2.cc,v 1.36 2009-02-27 19:30:47 levandov Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: noncomm. alg. of Buchberger
     
    11901190      /* enter P.p into s and L */
    11911191      {
     1192/* quick unit detection in the rational case */
     1193#ifdef HAVE_RATGRING
     1194        if( rIsRatGRing(currRing) )
     1195        {
     1196          if ( p_LmIsConstantRat(strat->P.p, currRing) )
     1197          {
     1198#ifdef PDEBUG
     1199             Print("unit element detected:");
     1200             p_wrp(strat->P.p,currRing);
     1201#endif
     1202            p_Delete(&strat->P.p,currRing, strat->tailRing);
     1203            strat->P.p = pOne();
     1204          }
     1205      }
     1206#endif
    11921207        strat->P.sev=0;
    11931208        int pos=posInS(strat,strat->sl,strat->P.p, strat->P.ecart);
  • kernel/polys1.cc

    rf58aa6 r0ffc823  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.36 2009-02-26 14:30:23 Singular Exp $ */
     4/* $Id: polys1.cc,v 1.37 2009-02-27 19:30:47 levandov Exp $ */
    55
    66/*
     
    10581058    if (rIsRatGRing(currRing))
    10591059    {
     1060      /* quick unit detection in the rational case is done in gr_nc_bba */
    10601061      pContentRat(ph);
    10611062      start=ph;
  • kernel/ratgring.cc

    rf58aa6 r0ffc823  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: ratgring.cc,v 1.22 2009-02-26 14:24:23 Singular Exp $
     9 *  Version: $Id: ratgring.cc,v 1.23 2009-02-27 19:30:47 levandov Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    416416  }
    417417
     418  if ( (p_LmIsConstantRat(p1,r)) || (p_LmIsConstantRat(p2,r)) )
     419  {
     420    p_Delete(&p1,r);
     421    p_Delete(&p2,r);
     422    return( NULL );
     423  }
     424
     425
    418426/* note: prod. crit does not apply! */
    419427  poly pL=pOne();
     
    528536    return(NULL);
    529537  }
     538
     539  if (p_LmIsConstantRat(p1,r))
     540  {
     541    return( NULL );
     542  }
     543
    530544
    531545  int is = ishift; /* TODO */
     
    794808  omFree(L);
    795809}
    796 #endif
     810
     811// test if monomial is a constant, i.e. if all exponents and the component
     812// is zero
     813BOOLEAN p_LmIsConstantRat(const poly p, const ring r)
     814{
     815  if (p_LmIsConstantCompRat(p, r))
     816    return (p_GetComp(p, r) == 0);
     817  return FALSE;
     818}
     819
     820// test if the monomial is a constant as a vector component
     821// i.e., test if all exponents are zero
     822BOOLEAN p_LmIsConstantCompRat(const poly p, const ring r)
     823{
     824  int i = r->real_var_end;
     825
     826  while ( (p_GetExp(p,i,r)==0) && (i>=r->real_var_start))
     827  {
     828    i--;
     829  }
     830  return ( i+1 == r->real_var_start );
     831}
     832
     833#endif
  • kernel/ratgring.h

    rf58aa6 r0ffc823  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ratgring.h,v 1.11 2009-02-26 14:24:32 Singular Exp $ */
     6/* $Id: ratgring.h,v 1.12 2009-02-27 19:30:47 levandov Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    117117void pContentRat(poly &ph);
    118118
     119BOOLEAN p_LmIsConstantRat(const poly p, const ring r);
     120
     121BOOLEAN p_LmIsConstantCompRat(const poly p, const ring r);
     122
    119123#endif /* HAVE_PLURAL */
    120124#endif
Note: See TracChangeset for help on using the changeset viewer.