Changeset 009d80 in git for kernel/polys.cc


Ignore:
Timestamp:
May 10, 2007, 10:12:44 AM (17 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
4cd2f891f36b9e1d58f0aeaa4683254f54088298
Parents:
4bebba7353438f052b4ad581ede34fa6f31e5a71
Message:
new compile switch: HAVE_RINGS
at total there are now: HAVE_RINGS, HAVE_RING2TOM, HAVE_RINGMODN

kspoly.cc, kstd1.cc, kstd2.cc, kutil.cc, kspoly.cc, polys.cc, ring.*:
adaption of new switches and rField_is_Ring method

numbers.*:
introduced new operation:
  nDivBy(a, b) = Is a divisible by b?

pDebig.cc, pInline1.h:
use of new nDivBy method

p_Mult_q:
new routine for rings

p_*, pp_*:
template switch HAVE_ZERODIVISOR

polys1.cc:
poly exponentation, switches

rmodulo*:
nDivBy implementation, DBTest

structs.h:
nDivBy, ringtype, ringflaga, ringflagb


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

Legend:

Unmodified
Added
Removed
  • kernel/polys.cc

    r4bebba r009d80  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.15 2007-05-03 13:50:09 wienand Exp $ */
     4/* $Id: polys.cc,v 1.16 2007-05-10 08:12:42 wienand Exp $ */
    55
    66/*
     
    141141  poly prev=NULL;
    142142  int i;
    143 #ifdef HAVE_RINGMODN
    144   if (currRing->cring == 2)
    145   {
    146     WarnS("Not implemenet, 2007-05-03 12:22:46");
    147   }   
    148 #endif
    149 #ifdef HAVE_RING2TOM
    150   bool unit = true;
    151   number inv = pGetCoeff(b);
    152   if ((currRing->cring == 1) && ((long) pGetCoeff(b) % 2 == 0))
    153   {
    154     unit = false;
    155   }
    156   if (unit) inv=nInvers(inv);
     143#ifdef HAVE_RINGS
     144  number inv=pGetCoeff(b);
    157145#else
    158146  number inv=nInvers(pGetCoeff(b));
     
    184172    }
    185173  }
    186 #ifdef HAVE_RING2TOM
    187   if (!unit)
    188   {
    189     pDiv_nn(result,inv);
    190   }
    191   else
     174#ifdef HAVE_RINGS
     175  pDiv_nn(result,inv);
     176#else
     177  pMult_nn(result,inv);
    192178#endif
    193   pMult_nn(result,inv);
    194179  nDelete(&inv);
    195180  pDelete(&b);
     
    704689}
    705690
    706 #ifdef HAVE_RING2TOM
     691#ifdef HAVE_RINGS  //HACK TODO Oliver
    707692number nGetUnit(number k) {
    708   long test = (long) k;
    709   while (test%2 == 0) {
    710     test = test / 2;
    711   }
    712   return (number) test;
     693  return (number) nIntDiv(k, nGcd(k, 0, currRing));
    713694}
    714695#endif
     
    721702  poly h;
    722703  number k, c;
    723 #ifdef HAVE_RINGMODN
    724   if (currRing->cring == 2)
    725   {
    726     WarnS("Not implemenet, 2007-05-03 12:22:46");
    727   }   
    728 #endif
    729 #ifdef HAVE_RING2TOM
    730   if (currRing->cring != 0)
     704#ifdef HAVE_RINGS
     705  if (rField_is_Ring(currRing))
    731706  {
    732707    if (p1!=NULL)
     
    735710      if (!nIsOne(k))
    736711      {
    737         k = nGetUnit(pGetCoeff(p1));
    738712        c = nDiv(pGetCoeff(p1), k);
    739713        pSetCoeff0(p1, c);
Note: See TracChangeset for help on using the changeset viewer.