Changeset 37c7fc1 in git for libpolys/polys/monomials


Ignore:
Timestamp:
May 19, 2011, 8:45:43 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
09ed7738e7d4dd96c01950a6f0736d8581f333d2
Parents:
4a2260efc22c19ac8eaf58d529af8decbb9420bb
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-05-19 20:45:43+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:13+01:00
Message:
FIX: fixed a memory double destruction bug in p_Monic
File:
1 edited

Legend:

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

    r4a2260e r37c7fc1  
    14831483  number lc = p_GetCoeff(p, r);
    14841484  if (n_IsOne(lc, r->cf)) return;
    1485   number n = n_Init(1, r->cf);
    1486   p_SetCoeff(p, n, r);
     1485
     1486  if( pNext(p) == NULL )
     1487  {
     1488     p_SetCoeff(p, n_Init(1, r->cf), r); // will delete the leading coeff 1st!
     1489     return;
     1490  }
     1491   
     1492  // TODO: consider unsing 1xn_Inverse + n_Mult instead of multiple n_Div
     1493  p_SetCoeff0(p, n_Init(1, r->cf), r); // no coeff destruction!
     1494   
    14871495  p = pIter(p);
     1496   
    14881497  while (p != NULL)
    14891498  {
Note: See TracChangeset for help on using the changeset viewer.