Changeset 5c8e18f in git


Ignore:
Timestamp:
Jan 23, 2014, 2:22:22 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
8baa377f0e7bdff672abd5ddeade4e629a51e405
Parents:
616d68556ae75bb7c49364150bb827162c506899
Message:
fix: access to chinese remainder, normalization of results
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r616d685 r5c8e18f  
    17871787    for(i=rl-1;i>=0;i--)
    17881788    {
    1789       q[i]=n_Init((*p)[i], currRing->cf);
     1789      q[i]=n_Init((*p)[i], coeffs_BIGINT);
    17901790    }
    17911791  }
     
    17961796      if (pl->m[i].Typ()==INT_CMD)
    17971797      {
    1798         if (return_type==BIGINT_CMD)
    1799           q[i]=n_Init((int)(long)pl->m[i].Data(),coeffs_BIGINT);
    1800         else
    1801           q[i]=n_Init((int)(long)pl->m[i].Data(),currRing->cf);
     1798        q[i]=n_Init((int)(long)pl->m[i].Data(),coeffs_BIGINT);
    18021799      }
    18031800      else if (pl->m[i].Typ()==BIGINT_CMD)
    18041801      {
    1805         if (return_type==BIGINT_CMD)
    1806           q[i]=n_Copy((number)(pl->m[i].Data()),coeffs_BIGINT);
    1807         else
    1808           q[i]=n_Init_bigint((number)(pl->m[i].Data()),coeffs_BIGINT,currRing->cf);
     1802        q[i]=n_Copy((number)(pl->m[i].Data()),coeffs_BIGINT);
    18091803      }
    18101804      else
    18111805      {
    18121806        Werror("bigint expected at pos %d",i+1);
    1813         if (return_type==BIGINT_CMD)
    18141807        for(i++;i<rl;i++)
    18151808        {
    18161809          n_Delete(&(q[i]),coeffs_BIGINT);
    18171810        }
    1818         else
    1819         for(i++;i<rl;i++)
    1820         {
    1821           n_Delete(&(q[i]),currRing);
    1822         }
    1823 
    18241811        omFree(x); // delete c
    18251812        omFree(q); // delete pl
     
    18401827    res->data=(char *)result;
    18411828  }
    1842   if (return_type==BIGINT_CMD)
    18431829  for(i=rl-1;i>=0;i--)
    18441830  {
    18451831    n_Delete(&(q[i]),coeffs_BIGINT);
    1846   }
    1847   else
    1848   for(i=rl-1;i>=0;i--)
    1849   {
    1850     n_Delete(&(q[i]),currRing);
    18511832  }
    18521833  omFree(q);
  • libpolys/coeffs/longrat.cc

    r616d685 r5c8e18f  
    26312631    nlDelete(&p,CF);
    26322632  }
     2633  nlNormalize(n,CF);
    26332634  return n;
    26342635}
  • libpolys/polys/ext_fields/transext.cc

    r616d685 r5c8e18f  
    23832383  omFreeSize(X,rl*sizeof(number));
    23842384  omFreeSize(P,rl*sizeof(poly*));
     2385  if (p_IsConstant(DEN(result), ntRing)
     2386  && n_IsOne(pGetCoeff(DEN(result)), ntCoeffs))
     2387  {
     2388    p_Delete(&DEN(result),ntRing);
     2389  }
    23852390  return ((number)result);
    23862391}
Note: See TracChangeset for help on using the changeset viewer.