Changeset 0ffc823 in git for kernel/ratgring.cc


Ignore:
Timestamp:
Feb 27, 2009, 8:30:47 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'd0474371d8c5d8068ab70bfb42719c97936b18a6')
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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.