Changeset 90aec7 in git for libpolys


Ignore:
Timestamp:
Sep 29, 2011, 2:59:11 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
09c65dc1c677f39d71809535df717f92fa2c03b3
Parents:
61a05011eb6c7b5ce19f060abf2ce176727b964e
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-29 14:59:11+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:48+01:00
Message:
fix: p_Content for alg.ext.
fix: p_Monic
Location:
libpolys/polys/monomials
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/monomials/p_polys.cc

    r61a050 r90aec7  
    14821482   is well-defined;
    14831483   modifies p */
    1484 void p_Monic(poly &p, ring r)
     1484void p_Monic(poly p, const ring r)
    14851485{
    14861486  if (p == NULL) return;
     1487  number n = n_Init(1, r->cf);
     1488  if (p->next==NULL) { p_SetCoeff(p,n,r); return; }
    14871489  poly pp = p;
    14881490  number lc = p_GetCoeff(p, r);
    14891491  if (n_IsOne(lc, r->cf)) return;
    14901492  number lcInverse = n_Invers(lc, r->cf);
    1491   number n = n_Init(1, r->cf);
    14921493  p_SetCoeff(p, n, r);   // destroys old leading coefficient!
    1493   p = pIter(p);
     1494  pIter(p);
    14941495  while (p != NULL)
    14951496  {
    14961497    number n = n_Mult(p_GetCoeff(p, r), lcInverse, r->cf);
     1498    n_Normalize(n,r->cf);
    14971499    p_SetCoeff(p, n, r);   // destroys old leading coefficient!
    14981500    p = pIter(p);
     
    20722074            pIter(c_n);
    20732075          }
     2076          pIter(p);
    20742077        }
    2075         pIter(p);
    20762078        /* hzz contains the 1/lcm of all denominators in c_n_n*/
    20772079        h=n_Invers(hzz,r->cf->extRing->cf);
  • libpolys/polys/monomials/p_polys.h

    r61a050 r90aec7  
    18551855   is well-defined;
    18561856   modifies p */
    1857 void      p_Monic(poly &p, ring r);
     1857void      p_Monic(poly p, const ring r);
    18581858
    18591859/* assumes that p and q are univariate polynomials in r,
Note: See TracChangeset for help on using the changeset viewer.