Changeset dad9fb in git for libpolys/polys


Ignore:
Timestamp:
Mar 15, 2012, 5:26:46 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
8066cd9340c30bf555310cdb3ca4a9c82b4f3e92a82c308b8fbf35f5d32c156ead224188e2610f7e
Parents:
788fdfc919bcf38d8b469a0f59374abf9046985dd841a16156c2e0b2a5e731384a7a5e454dffe2d8
Message:
Merge pull request #82 from mmklee/bug_fixes_sw

Bug fixes sw
Location:
libpolys/polys
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/transext.cc

    r788fdf rdad9fb  
    247247  if (IS0(a)) return NULL;
    248248  fraction f = (fraction)a;
    249   poly g = p_Copy(NUM(f), ntRing);
    250249  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
    251   NUM(result) = g;
    252   DEN(result) = NULL;
    253   COM(result) = 0;
     250  BOOLEAN denis1= DENIS1 (f);
     251  if (getCoeffType (ntCoeffs) == n_Q && !denis1)
     252    handleNestedFractionsOverQ (f, cf);
     253  NUM (result)= p_Copy (NUM (f), ntRing);
     254  DEN (result) = NULL;
     255  COM (result) = 0;
     256  if (getCoeffType (ntCoeffs) == n_Q && denis1)
     257  {
     258    if (!p_IsConstant (NUM (result), ntRing) && pNext (NUM(result)) != NULL)
     259      p_Cleardenom (NUM(result), ntRing);
     260    else
     261    {
     262      number g= p_GetAllDenom (NUM (result), ntRing);
     263      NUM (result)= p_Mult_nn (NUM (result), g, ntRing);
     264    }
     265  }
    254266  return (number)result;
    255267}
     
    260272  definiteGcdCancellation(a, cf, FALSE);
    261273  fraction f = (fraction)a;
    262   poly g;
    263   if (IS0(f) || DENIS1(f)) g = p_One(ntRing);
    264   else g = p_Copy(DEN(f), ntRing);
    265274  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
    266   NUM(result) = g;
    267   DEN(result) = NULL;
    268   COM(result) = 0;
     275  number g;
     276  if (IS0(f) || (DENIS1 (f) && getCoeffType (ntCoeffs) != n_Q))
     277  {
     278    NUM (result)= p_One(ntRing);
     279    DEN (result)= NULL;
     280    COM (result)= 0;
     281  }
     282  else if (DENIS1 (f))
     283  {
     284    poly num= p_Copy (NUM (f), ntRing);
     285    if (!p_IsConstant (num, ntRing) && pNext(num) != NULL)
     286      p_Cleardenom_n (num, ntRing, g);
     287    else
     288      g= p_GetAllDenom (num, ntRing);
     289    result= (fraction) ntSetMap (ntRing->cf, cf) (g, ntRing->cf, cf);
     290  }
     291  else
     292  {
     293    if (getCoeffType (ntCoeffs) == n_Q)
     294      handleNestedFractionsOverQ (f, cf);
     295    NUM (result)= p_Copy (DEN (f), ntRing);
     296    DEN (result) = NULL;
     297    COM (result) = 0;
     298  }
    269299  return (number)result;
    270300}
     
    10491079  if (n_IsZero(a, src)) return NULL;
    10501080  assume(src == dst->extRing->cf);
    1051   poly p = p_One(dst->extRing);
     1081  poly p = p_Init(dst->extRing);
    10521082  number na=n_Copy(a, src);
    10531083  n_Normalize(na, src);
    1054   p_SetCoeff(p, na, dst->extRing);
     1084  p_SetCoeff0(p, na, dst->extRing);
    10551085  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    10561086  NUM(f) = p; DEN(f) = NULL; COM(f) = 0;
  • libpolys/polys/monomials/p_polys.cc

    r788fdf rdad9fb  
    34143414       return NULL;
    34153415
    3416     if( !DENIS1(z) )
    3417       WarnS("Not implemented yet: Cannot permute a rational fraction and make a polynomial out of it! Ignorring the denumerator.");
     3416    //if( !DENIS1(z) )
     3417      //WarnS("Not implemented yet: Cannot permute a rational fraction and make a polynomial out of it! Ignorring the denumerator.");
    34183418  } else
    34193419     {
  • libpolys/polys/monomials/p_polys.h

    rd841a1 rdad9fb  
    437437    switch(r->typ[i].ord_typ)
    438438    {
     439      case ro_am:
    439440      case ro_wp_neg:
    440441        return (((long)((p)->exp[r->pOrdIndex]))-POLY_NEGWEIGHT_OFFSET);
  • libpolys/polys/monomials/ring.cc

    r788fdf rdad9fb  
    795795        r1->cf->ref++;
    796796      }
     797      else if ((getCoeffType (r2->cf)==n_algExt || getCoeffType (r2->cf)==n_transExt) && rChar(r2) == rChar(r1))
     798      {
     799        /*AlgExtInfo extParam;
     800        extParam.r = r2->cf->extRing;
     801        extParam.i = r2->cf->extRing->minideal;*/
     802        tmpR.cf=r2->cf;
     803        r2->cf->ref++;
     804      }
    797805      else
    798806      {
     
    809817    {
    810818      if (getCoeffType(r2->cf)==n_Zp)
     819      {
     820        tmpR.cf=r2->cf;
     821        r2->cf->ref++;
     822      }
     823      else if (getCoeffType(r2->cf)==n_algExt || getCoeffType(r2->cf)==n_transExt)
    811824      {
    812825        tmpR.cf=r2->cf;
Note: See TracChangeset for help on using the changeset viewer.