Changeset a8b44d in git for kernel/polys.cc


Ignore:
Timestamp:
Mar 21, 2011, 3:55:47 PM (12 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
9cd697732c2adbda992d49885d226fc966966251
Parents:
f4a33e267c2b5be378ef1fc5426935bee8f1e4d9
Message:
changed div check in Z/m, and command simplify over rings

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

Legend:

Unmodified
Added
Removed
  • kernel/polys.cc

    rf4a33e ra8b44d  
    9999* assumes that the head term of b is a multiple of the head term of a
    100100* and return the multiplicant *m
     101* Frank's observation: If LM(b) = LM(a)*m, then we may actually set
     102* negative(!) exponents in the below loop. I suspect that the correct
     103* comment should be "assumes that LM(a) = LM(b)*m, for some monomial m..."
    101104*/
    102105poly pDivide(poly a, poly b)
     
    130133  p_Test(q, r);
    131134  return q;
     135}
     136#endif
     137
     138static void printNumber(const number z)
     139{
     140  if (nIsZero(z)) printf("number = 0\n");
     141  else
     142  {
     143    poly p = pOne();
     144    pSetCoeff(p, nCopy(z));
     145    pSetm(p);
     146    printf("number = %s\n", pString(p));
     147    pDelete(&p);
     148  }
     149}
     150
     151#ifdef HAVE_RINGS
     152/* TRUE iff LT(f) | LT(g) */
     153BOOLEAN pDivisibleByRingCase(poly f, poly g)
     154{
     155  int exponent;
     156  for(int i = (int)pVariables; i; i--)
     157  {
     158    exponent = pGetExp(g, i) - pGetExp(f, i);
     159    if (exponent < 0) return FALSE;
     160  }
     161  return nDivBy(pGetCoeff(g), pGetCoeff(f));
    132162}
    133163#endif
     
    567597
    568598/*2
    569 *divides p1 by its leading coefficient
     599* divides p1 by its leading coefficient if it is a unit
     600* (this will always be true over fields; but not over coefficient rings)
    570601*/
    571602void pNorm(poly p1)
     
    574605  if (rField_is_Ring(currRing))
    575606  {
    576     Werror("pNorm not possible in the case of coefficient rings.");
    577   }
    578   else
     607    if (!nIsUnit(pGetCoeff(p1))) return;
     608  }
    579609#endif
    580610  if (p1!=NULL)
Note: See TracChangeset for help on using the changeset viewer.