Changeset d1f231 in git for kernel/clapsing.cc


Ignore:
Timestamp:
Oct 16, 2009, 12:35:00 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
e9806890fa4b234b8c11d976584cab53f617eb21
Parents:
aaf310683d51b31671eaa0c71091bd597e94f3a5
Message:
*hannes: more ring dep.


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

Legend:

Unmodified
Added
Removed
  • kernel/clapsing.cc

    raaf310 rd1f231  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapsing.cc,v 1.45 2009-09-16 12:26:26 Singular Exp $
     5// $Id: clapsing.cc,v 1.46 2009-10-16 10:35:00 Singular Exp $
    66/*
    77* ABSTRACT: interface between Singular and factory
     
    8787        CanonicalForm F( convSingAPFactoryAP( f,a,r ) ),
    8888                      G( convSingAPFactoryAP( g,a,r ) );
    89         res= convFactoryAPSingAP( gcd( F, G ) );
     89        res= convFactoryAPSingAP( gcd( F, G ),currRing );
    9090        if (!b) Off(SW_USE_QGCD);
    9191      }
     
    181181      CanonicalForm F( convSingAPFactoryAP( f,a,currRing ) ),
    182182                    G( convSingAPFactoryAP( g,a,currRing ) );
    183       res= convFactoryAPSingAP( resultant( F, G, X ) );
     183      res= convFactoryAPSingAP( resultant( F, G, X ),currRing );
    184184    }
    185185    else
     
    329329        return TRUE;
    330330      }
    331       res= convFactoryAPSingAP( extgcd( F, G, Fa, Gb ) );
    332       pa=convFactoryAPSingAP(Fa);
    333       pb=convFactoryAPSingAP(Gb);
     331      res= convFactoryAPSingAP( extgcd( F, G, Fa, Gb ),currRing );
     332      pa=convFactoryAPSingAP(Fa,currRing);
     333      pb=convFactoryAPSingAP(Gb,currRing);
    334334    }
    335335    else
     
    406406        return TRUE;
    407407      }
    408       res= convFactoryAPSingAP( extgcd( F, G, Fa, Gb ) );
    409       pa=convFactoryAPSingAP(Fa);
    410       pb=convFactoryAPSingAP(Gb);
     408      res= convFactoryAPSingAP( extgcd( F, G, Fa, Gb ),currRing );
     409      pa=convFactoryAPSingAP(Fa,currRing);
     410      pb=convFactoryAPSingAP(Gb,currRing);
    411411    }
    412412    else
     
    456456      CanonicalForm F( convSingAPFactoryAP( f,a,currRing ) ),
    457457                    G( convSingAPFactoryAP( g,a,currRing ) );
    458       res= convFactoryAPSingAP(  F / G  );
     458      res= convFactoryAPSingAP(  F / G,currRing  );
    459459    }
    460460    else
     
    462462      CanonicalForm F( convSingTrPFactoryP( f ) ), G( convSingTrPFactoryP( g ) );
    463463      res= convFactoryPSingTrP(  F / G  );
     464    }
     465  }
     466  #if 0 // not yet working
     467  else if (rField_is_GF())
     468  {
     469    //Print("GF(%d^%d)\n",nfCharP,nfMinPoly[0]);
     470    setCharacteristic( nfCharP,nfMinPoly[0], currRing->parameter[0][0] );
     471    CanonicalForm F( convSingGFFactoryGF( f ) ), G( convSingGFFactoryGF( g ) );
     472    res = convFactoryGFSingGF( F / G );
     473  }
     474  #endif
     475  else
     476    WerrorS( feNotImplemented );
     477  Off(SW_RATIONAL);
     478  return res;
     479}
     480
     481poly singclap_pdivide_r ( poly f, poly g, const ring r )
     482{
     483  poly res=NULL;
     484  On(SW_RATIONAL);
     485  if (rField_is_Zp(r) || rField_is_Q(r))
     486  {
     487    setCharacteristic( n_GetChar(r) );
     488    CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g,r ) );
     489    res = convFactoryPSingP( F / G,r );
     490  }
     491  else if (rField_is_Extension(r))
     492  {
     493    if (rField_is_Q_a(r)) setCharacteristic( 0 );
     494    else               setCharacteristic( -n_GetChar(r) );
     495    if (r->minpoly!=NULL)
     496    {
     497      CanonicalForm mipo=convSingPFactoryP(((lnumber)r->minpoly)->z,
     498                                                 r->algring);
     499      Variable a=rootOf(mipo);
     500      CanonicalForm F( convSingAPFactoryAP( f,a,r ) ),
     501                    G( convSingAPFactoryAP( g,a,r ) );
     502      res= convFactoryAPSingAP(  F / G, r  );
     503    }
     504    else
     505    {
     506      CanonicalForm F( convSingTrPFactoryP( f,r ) ), G( convSingTrPFactoryP( g,r ) );
     507      res= convFactoryPSingTrP(  F / G,r  );
    464508    }
    465509  }
     
    640684          if (currRing->minpoly!=NULL)
    641685          {
    642             q= convFactoryAPSingAP(  Q  );
     686            q= convFactoryAPSingAP(  Q,currRing  );
    643687          }
    644688          else
     
    918962        else
    919963        {
    920           if (!count_Factors(res,w,j,ff,convFactoryAPSingAP( J.getItem().factor() )))
     964          if (!count_Factors(res,w,j,ff,convFactoryAPSingAP( J.getItem().factor(),currRing )))
    921965          {
    922966            if (w!=NULL)
     
    12171261          res->m[j]=convFactoryPSingTrP( J.getItem().factor() );
    12181262        else
    1219           res->m[j]=convFactoryAPSingAP( J.getItem().factor() );
     1263          res->m[j]=convFactoryAPSingAP( J.getItem().factor(),currRing );
    12201264      }
    12211265    }
     
    14941538        }
    14951539      }
    1496       res= convFactoryAPSingAP( determinant(M,r) ) ;
     1540      res= convFactoryAPSingAP( determinant(M,r),currRing ) ;
    14971541    }
    14981542    else
     
    15521596
    15531597   // calculate lcm
    1554    res= convFactoryASingA( (F/GCD)*G );
     1598   res= convFactoryASingA( (F/GCD)*G,currRing );
    15551599 }
    15561600 else
     
    15911635   if ((GCD!=1) && (GCD!=0))
    15921636   {
    1593      ff= convFactoryASingA( F/ GCD );
    1594      gg= convFactoryASingA( G/ GCD );
     1637     ff= convFactoryASingA( F/ GCD, currRing );
     1638     gg= convFactoryASingA( G/ GCD, currRing );
    15951639   }
    15961640 }
Note: See TracChangeset for help on using the changeset viewer.