Changeset 91d0e6 in git for kernel/clapsing.cc


Ignore:
Timestamp:
Aug 5, 2009, 7:29:12 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
3d6c38c30089200c989a79851a19bf43b565678e
Parents:
dc560f747a6867005b5ce262a19ac0d38e7137f9
Message:
*hannes: singclap_gcd_r


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

Legend:

Unmodified
Added
Removed
  • kernel/clapsing.cc

    rdc560f r91d0e6  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapsing.cc,v 1.37 2009-07-28 14:15:05 Singular Exp $
     5// $Id: clapsing.cc,v 1.38 2009-08-05 17:29:12 Singular Exp $
    66/*
    77* ABSTRACT: interface between Singular and factory
     
    196196
    197197
    198 poly singclap_gcd ( poly f, poly g )
     198poly singclap_gcd ( poly f, poly g, const ring r )
    199199{
    200200  poly res=NULL;
     
    288288  pDelete(&f);
    289289  pDelete(&g);
     290  pTest(res);
     291  return res;
     292}
     293
     294poly singclap_gcd_r ( poly f, poly g, const ring r )
     295{
     296  // assume pCleardenom is done
     297  // assume f!=0, g!=0
     298  poly res=NULL;
     299
     300  if (p_IsConstantPoly(f,r) || p_IsConstantPoly(g,r))
     301  {
     302    return pOne();
     303  }
     304
     305  // for now there is only the possibility to handle polynomials over
     306  // Q and Fp ...
     307  Off(SW_RATIONAL);
     308  if (rField_is_Q(r) || (rField_is_Zp(r)))
     309  {
     310    CanonicalForm newGCD(const CanonicalForm & A, const CanonicalForm & B);
     311    setCharacteristic( n_GetChar(r) );
     312    CanonicalForm F( conv_SingPFactoryP( f,r ) ), G( conv_SingPFactoryP( g, r ) );
     313    //if (nGetChar() > 1 )
     314    //{
     315    //  res=convFactoryPSingP( newGCD( F,G ));
     316    //  if (!nGreaterZero(pGetCoeff(res))) res=pNeg(res);
     317    //}
     318    //else
     319      res=conv_FactoryPSingP( gcd( F, G ) , r);
     320  }
     321  else
     322    WerrorS( feNotImplemented );
     323
     324  Off(SW_RATIONAL);
    290325  pTest(res);
    291326  return res;
Note: See TracChangeset for help on using the changeset viewer.