Changeset 918ca0 in git


Ignore:
Timestamp:
Sep 10, 2013, 6:47:03 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c1c65551e4b3a0de0b13ddf30446f6e9569681b5')
Children:
061ea6700f4772007cf2ff429e82b76923253bb9
Parents:
e72a9a0b36ab67b560ee010e447ea91f5c46e273f3a5b874bdbab4185e05159353702c6b180a698d
Message:
Merge pull request #363 from mmklee/den

fix: delete DEN if it is 1
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rf3a5b8 r918ca0  
    40594059{
    40604060  lists L=(lists)omAllocBin(slists_bin);
    4061   if (rField_is_Zp(currRing)
    4062   || rField_is_Q(currRing)
    4063   || rField_is_Zp_a(currRing)
    4064   || rField_is_Q_a(currRing))
     4061  if (currRing->cf->convSingNFactoryN!=NULL) /* conversion to factory*/
    40654062  {
    40664063    ideal_list p,h;
     
    63846381  if ((ringvar=pVar(p))==0)
    63856382  {
    6386     if ((p!=NULL) && rField_is_Extension(currRing))
    6387     {
    6388       assume(currRing->cf->extRing!=NULL);
     6383    if ((p!=NULL) && (currRing->cf->extRing!=NULL))
     6384    {
    63896385      number n = pGetCoeff(p);
    63906386      ringvar= -n_IsParam(n, currRing);
  • Singular/ipshell.cc

    rf3a5b8 r918ca0  
    17981798  else if (rIsExtension(r))
    17991799  {
    1800     if ( rField_is_Extension(r) )// nCoeff_is_algExt(r->cf))
    1801     {
    1802       assume( r->cf != NULL );
    1803       assume( r->cf->extRing != NULL );
    1804 
     1800    if ( r->cf->extRing!=NULL )// nCoeff_is_algExt(r->cf))
     1801    {
    18051802      rDecomposeCF(&(L->m[0]), r->cf->extRing, r);
    18061803    }
  • Singular/subexpr.cc

    rf3a5b8 r918ca0  
    14831483        return;
    14841484      }
    1485       if(rField_is_Extension(currRing)&&((vnr=r_IsRingVar(id, currRing->cf->extRing))>=0))
     1485      if((currRing->cf->extRing!=NULL)
     1486      &&((vnr=r_IsRingVar(id, currRing->cf->extRing))>=0))
    14861487      {
    14871488        BOOLEAN ok=FALSE;
  • libpolys/polys/clapsing.cc

    rf3a5b8 r918ca0  
    119119  }
    120120  // and over Q(a) / Fp(a)
    121   else if ( rField_is_Extension(r))
     121  else if ( r->cf->extRing!=NULL )
    122122  {
    123123    if ( rField_is_Q_a(r)) setCharacteristic( 0 );
     
    175175  }
    176176  // and over Q(a) / Fp(a)
    177   else if ( rField_is_Extension(r))
     177  else if ( r->cf->extRing )
    178178  {
    179179    if ( rField_is_Q_a(r)) setCharacteristic( 0 );
     
    270270  }
    271271  // and over Q(a) / Fp(a)
    272   else if (rField_is_Extension(r))
     272  else if (r->cf->extRing!=NULL)
    273273  {
    274274    if (rField_is_Q_a(r)) setCharacteristic( 0 );
     
    416416  }
    417417  // and over Q(a) / Fp(a)
    418   else if ( rField_is_Extension(r))
     418  else if ( r->cf->extRing!=NULL )
    419419  {
    420420    if (rField_is_Q_a(r)) setCharacteristic( 0 );
     
    485485    res = convFactoryPSingP( F / G,r );
    486486  }
    487   else if (rField_is_Extension(r))
     487  else if (r->cf->extRing!=NULL)
    488488  {
    489489    if (rField_is_Q_a(r)) setCharacteristic( 0 );
     
    635635      FAC=convSingPFactoryP( fac,r );
    636636    }
    637     else if (rField_is_Extension(r))
     637    else if (r->cf->extRing!=NULL)
    638638    {
    639639      if (r->cf->extRing->qideal!=NULL)
     
    668668          q = convFactoryPSingP( Q,r );
    669669        }
    670         else if (rField_is_Extension(r))
     670        else if (r->cf->extRing!=NULL)
    671671        {
    672672          if (r->cf->extRing->qideal!=NULL)
     
    836836  }
    837837  // and over Q(a) / Fp(a)
    838   else if (rField_is_Extension(r))
     838  else if (r->cf->extRing!=NULL)
    839839  {
    840840    if (rField_is_Q_a (r)) setCharacteristic (0);
     
    898898        res->m[j] = convFactoryGFSingGF( J.getItem().factor() );
    899899#endif
    900       else if (rField_is_Extension(r))     /* Q(a), Fp(a) */
     900      else if (r->cf->extRing!=NULL)     /* Q(a), Fp(a) */
    901901      {
    902902#ifndef NDEBUG
     
    933933    }
    934934#ifndef NDEBUG
    935     if (rField_is_Extension(r) && (!p_IsConstantPoly(ff,r)))
     935    if ((r->cf->extRing!=NULL) && (!p_IsConstantPoly(ff,r)))
    936936    {
    937937      singclap_factorize_retry++;
     
    12071207    L = sqrFree( F );
    12081208  }
    1209   else if (rField_is_Extension(r))
     1209  else if (r->cf->extRing!=NULL)
    12101210  {
    12111211    if (rField_is_Q_a (r)) setCharacteristic (0);
     
    12711271      if (rField_is_Zp(r) || rField_is_Q(r))
    12721272        res->m[j] = convFactoryPSingP( J.getItem().factor(),r );
    1273       else if (rField_is_Extension(r))     /* Q(a), Fp(a) */
     1273      else if (r->cf->extRing!=NULL)     /* Q(a), Fp(a) */
    12741274      {
    12751275        if (r->cf->extRing->qideal==NULL)
  • libpolys/polys/ext_fields/transext.cc

    re72a9a r918ca0  
    14261426      NUM(f) = p_Neg(NUM(f), ntRing);
    14271427      DEN(f) = p_Neg(DEN(f), ntRing);
     1428      if (p_IsConstant(DEN(f), ntRing) &&
     1429        n_IsOne(p_GetCoeff(DEN(f), ntRing), ntCoeffs))
     1430      {
     1431        /* DEN(f) = 1 needs to be represented by NULL! */
     1432        p_Delete(&DEN(f), ntRing);
     1433        DEN (f) = NULL;
     1434      }
    14281435    }
    14291436#endif /* HAVE_FACTORY */
  • libpolys/polys/monomials/p_polys.cc

    rf3a5b8 r918ca0  
    36183618
    36193619  assume( !nCoeff_is_GF(srcCf) );
    3620   assume( rField_is_Extension(src) );
     3620  assume( src->cf->extRing!=NULL );
    36213621
    36223622  poly zz = NULL;
  • libpolys/polys/monomials/ring.cc

    rf3a5b8 r918ca0  
    33973397
    33983398  // set intStrategy
     3399  if ( (r->cf->extRing!=NULL)
     3400      || rField_is_Q(r)
    33993401#ifdef HAVE_RINGS
    3400   if (
    3401          rField_is_Extension(r)
    3402       || rField_is_Q(r)
    3403       || rField_is_Ring(r))
    3404 #else
    3405   if (rField_is_Extension(r) || rField_is_Q(r))
    3406 #endif
     3402      || rField_is_Ring(r)
     3403#endif
     3404  )
    34073405    r->options |= Sy_bit(OPT_INTSTRATEGY);
    34083406  else
     
    34103408
    34113409  // set redTail
    3412   if (r->LexOrder || r->OrdSgn == -1 || rField_is_Extension(r))
     3410  if (r->LexOrder || r->OrdSgn == -1 || (r->cf->extRing!=NULL))
    34133411    r->options &= ~Sy_bit(OPT_REDTAIL);
    34143412  else
  • libpolys/polys/monomials/ring.h

    rf3a5b8 r918ca0  
    493493static inline BOOLEAN rField_has_simple_Alloc(const ring r)
    494494{ assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_Alloc(r->cf); }
    495 
    496 /// Alg. or trans. ext.
    497 static inline BOOLEAN rField_is_Extension(const ring r)
    498 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Extension(r->cf); } /* Z/p(a) and Q(a)*/
    499495
    500496n_coeffType rFieldType(const ring r);
     
    646642  const coeffs C = r->cf;
    647643  assume(C != NULL);
    648 //  assume( (rParameter(r)!=NULL) == rField_is_Extension(r) ); // ?
    649644  return nCoeff_is_Extension(C) || nCoeff_is_GF(C) || nCoeff_is_long_C(C);
    650645}
  • libpolys/tests/polys_test.h

    rf3a5b8 r918ca0  
    20472047    TS_ASSERT( !rField_is_Zp(s, 13) );
    20482048    TS_ASSERT( !rField_is_GF(s) );
    2049     TS_ASSERT( rField_is_Extension(s) );
     2049    TS_ASSERT( (s->cf->extRing!=NULL) );
    20502050    TS_ASSERT( !rField_is_GF(s, 25) );
    20512051    TS_ASSERT_EQUALS(rVar(s), 2);
     
    21482148    TS_ASSERT( !rField_is_Zp(s, 13) );
    21492149    TS_ASSERT( !rField_is_GF(s) );
    2150     TS_ASSERT( rField_is_Extension(s) );
     2150    TS_ASSERT( (s->cf->extRing!=NULL) );
    21512151    TS_ASSERT( !rField_is_GF(s, 25) );
    21522152    TS_ASSERT_EQUALS(rVar(s), 3);
     
    22932293    TS_ASSERT( !rField_is_Zp(s, 17) );
    22942294    TS_ASSERT( !rField_is_GF(s) );
    2295     TS_ASSERT( rField_is_Extension(s) );
     2295    TS_ASSERT( (s->cf->extRing!=NULL) );
    22962296    TS_ASSERT( !rField_is_GF(s, 25) );
    22972297    TS_ASSERT_EQUALS(rVar(s), 3);
     
    23662366    TS_ASSERT( !rField_is_Zp(s, 17) );
    23672367    TS_ASSERT( !rField_is_GF(s) );
    2368     TS_ASSERT( rField_is_Extension(s) );
     2368    TS_ASSERT( (s->cf->extRing!=NULL) );
    23692369    TS_ASSERT( !rField_is_GF(s, 25) );
    23702370    TS_ASSERT_EQUALS(rVar(s), 3);
     
    24792479    TS_ASSERT( !rField_is_Zp(s, 17) );
    24802480    TS_ASSERT( !rField_is_GF(s) );
    2481     TS_ASSERT( rField_is_Extension(s) );
     2481    TS_ASSERT( (s->cf->extRing!=NULL) );
    24822482    TS_ASSERT( !rField_is_GF(s, 25) );
    24832483    TS_ASSERT_EQUALS(rVar(s), 1);
     
    25902590    TS_ASSERT( !rField_is_Zp(s, 17) );
    25912591    TS_ASSERT( !rField_is_GF(s) );
    2592     TS_ASSERT( rField_is_Extension(s) );
     2592    TS_ASSERT( (s->cf->extRing!=NULL) );
    25932593    TS_ASSERT( !rField_is_GF(s, 25) );
    25942594    TS_ASSERT_EQUALS(rVar(s), 3);
Note: See TracChangeset for help on using the changeset viewer.