Changeset de7a92 in git


Ignore:
Timestamp:
May 26, 2010, 6:54:17 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ba3e3ef698fa0b7c5867199959cc83330073d3cb')
Children:
e6f7ee11a6ff0c68107a46ec9037f45d921b1812
Parents:
c24143a27d35200ae938839a1c20b99c19c8df4a
Message:
gcd via fieldGCD/QGCD

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

Legend:

Unmodified
Added
Removed
  • kernel/clapsing.cc

    rc24143a rde7a92  
    5454  }
    5555  // and over Q(a) / Fp(a)
    56   else if (( n_GetChar(r)==1 ) /* Q(a) */
    57   || (n_GetChar(r) <-1))       /* Fp(a) */
    58   {
    59     if (n_GetChar(r)==1) setCharacteristic( 0 );
    60     else                 setCharacteristic( -n_GetChar(r) );
     56  else if ( rField_is_Extension(r))
     57  {
     58    if ( rField_is_Q_a(r)) setCharacteristic( 0 );
     59    else                   setCharacteristic( -n_GetChar(r) );
    6160    if (r->minpoly!=NULL)
    6261    {
    63     #if 0
    64       if (( n_GetChar(r)==1 ) /* Q(a) */ && (!isOn(SW_USE_QGCD)))
    65       {
    66       //  WerrorS( feNotImplemented );
    67         CanonicalForm mipo=convSingPFactoryP(((lnumber)r->minpoly)->z,r->algring);
    68         //Varlist ord;
    69         //ord.append(mipo.mvar());
    70         CFList as(mipo);
    71         Variable a=rootOf(mipo);
    72         //CanonicalForm F( convSingAPFactoryAP( f,a,r ) ), G( convSingAPFactoryAP( g,a,r ) );
    73         CanonicalForm F( convSingTrPFactoryP(f,r) ), G( convSingTrPFactoryP(g,r) );
    74         res= convFactoryAPSingAP( alg_gcd( F, G, as),r );
    75       }
    76       else
    77       #endif
    78       {
    79         bool b=isOn(SW_USE_QGCD);
    80         if ( rField_is_Q_a() ) On(SW_USE_QGCD);
    81         CanonicalForm mipo=convSingPFactoryP(((lnumber)r->minpoly)->z,
     62      bool b1=isOn(SW_USE_QGCD);
     63      bool b2=isOn(SW_USE_fieldGCD);
     64      if ( rField_is_Q_a() ) On(SW_USE_QGCD);
     65      else                   On(SW_USE_fieldGCD);
     66      CanonicalForm mipo=convSingPFactoryP(((lnumber)r->minpoly)->z,
    8267                                           r->algring);
    83         Variable a=rootOf(mipo);
    84         CanonicalForm F( convSingAPFactoryAP( f,a,r ) ),
    85                       G( convSingAPFactoryAP( g,a,r ) );
    86         res= convFactoryAPSingAP( gcd( F, G ),currRing );
    87         if (!b) Off(SW_USE_QGCD);
    88       }
     68      Variable a=rootOf(mipo);
     69      CanonicalForm F( convSingAPFactoryAP( f,a,r ) ),
     70                    G( convSingAPFactoryAP( g,a,r ) );
     71      res= convFactoryAPSingAP( gcd( F, G ),currRing );
     72      if (!b1) Off(SW_USE_QGCD);
     73      if (!b2) Off(SW_USE_fieldGCD);
    8974    }
    9075    else
     
    373358  res=NULL;pa=NULL;pb=NULL;
    374359  On(SW_SYMMETRIC_FF);
    375   if (( n_GetChar(r) == 0 || n_GetChar(r) > 1 )
    376   && (r->parameter==NULL))
     360  if ( rField_is_Q(r) || rField_is_Zp(r) )
    377361  {
    378362    setCharacteristic( n_GetChar(r) );
     
    394378  }
    395379  // and over Q(a) / Fp(a)
    396   else if (( n_GetChar(r)==1 ) /* Q(a) */
    397   || (n_GetChar(r) <-1))       /* Fp(a) */
    398   {
    399     if (n_GetChar(r)==1) setCharacteristic( 0 );
     380  else if ( rField_is_Extension(r))
     381  {
     382    if (rField_is_Q_a(r)) setCharacteristic( 0 );
    400383    else                 setCharacteristic( -n_GetChar(r) );
    401384    CanonicalForm Fa,Gb;
Note: See TracChangeset for help on using the changeset viewer.