Changeset 0723d5 in git


Ignore:
Timestamp:
Feb 21, 2013, 11:03:42 AM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'cbf866d4f8c3861325311c042cb2033c053453b2')
Children:
507427e9e0bf212d166ab8f3bb970f562784a172
Parents:
644b311072b1277f612b8e3d8ad80e23a56d5ec087343b4d7f38df9831596b5fcc7ded4fcff5f407
Message:
Merge pull request #291 from mmklee/imap

Imap
Location:
libpolys/polys
Files:
2 edited

Legend:

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

    r644b31 r0723d5  
    921921#endif
    922922
    923 number naCopyExt(number a, const coeffs src, const coeffs)
    924 {
     923number naCopyTrans2AlgExt(number a, const coeffs src, const coeffs dst)
     924{
     925  assume (nCoeff_is_transExt (src));
     926  assume (nCoeff_is_algExt (dst));
    925927  fraction fa=(fraction)a;
    926   return (number)p_Copy(NUM(fa),src->extRing);
     928  assume( rSamePolyRep(src->extRing, dst->extRing) );
     929  poly p = p_Copy(NUM(fa),src->extRing);
     930  definiteReduce(p, dst->extRing->qideal->m[0], dst);
     931  assume (p_Test (p, dst->extRing));
     932  return (number)p;
    927933}
    928934
     
    9951001  if (nCoeff_is_Q(bSrc) && nCoeff_is_Q(bDst))
    9961002  {
    997     if (strcmp(rRingVar(0, src->extRing),
    998                rRingVar(0, dst->extRing)) == 0)
     1003    if (rSamePolyRep(src->extRing, dst->extRing) && (strcmp(rRingVar(0, src->extRing), rRingVar(0, dst->extRing)) == 0))
    9991004    {
    10001005      if (src->type==n_algExt)
    10011006         return ndCopyMap; // naCopyMap;         /// Q(a)   --> Q(a)
    10021007      else
    1003          return naCopyExt;
     1008         return naCopyTrans2AlgExt;
    10041009    }
    10051010    else
     
    10091014  if (nCoeff_is_Zp(bSrc) && nCoeff_is_Zp(bDst))
    10101015  {
    1011     if (strcmp(rRingVar(0,src->extRing),rRingVar(0,dst->extRing))==0)
     1016    if (rSamePolyRep(src->extRing, dst->extRing) && (strcmp(rRingVar(0,src->extRing),rRingVar(0,dst->extRing))==0))
    10121017    {
    10131018      if (src->type==n_algExt)
    10141019        return ndCopyMap; // naCopyMap;          /// Z/p(a) --> Z/p(a)
    10151020      else
    1016          return naCopyExt;
     1021         return naCopyTrans2AlgExt;
    10171022    }
    10181023    else
  • libpolys/polys/monomials/p_polys.cc

    r644b31 r0723d5  
    35363536  rWrite(dst);
    35373537
    3538   Print("\nOldPar: %d\n", OldPar);
     3538  /*Print("\nOldPar: %d\n", OldPar);
    35393539  for( int i = 1; i <= OldPar; i++ )
    35403540  {
    35413541    Print("par(%d) -> par/var (%d)\n", i, par_perm[i-1]);
    3542   }
     3542  }*/
    35433543#endif
    35443544  if( z == NULL )
     
    35933593  assume( nMap != NULL );
    35943594
    3595   poly qq = p_PermPoly(zz, par_perm - 1, srcExtRing, dst, nMap, NULL, rVar(srcExtRing) );
     3595  poly qq;
     3596
     3597  if ((par_perm == NULL) && (rPar(dst) != 0 && rVar (srcExtRing) > 0))
     3598  {
     3599    int* perm;
     3600    perm=(int *)omAlloc0((rVar(srcExtRing)+1)*sizeof(int));
     3601    perm[0]= 0;
     3602    for(int i=si_min(rVar(srcExtRing),rPar(dst));i>0;i--)
     3603      perm[i]=-i;
     3604    qq = p_PermPoly(zz, perm, srcExtRing, dst, nMap, NULL, rVar(srcExtRing)-1);
     3605    omFreeSize ((ADDRESS)perm, (rVar(srcExtRing)+1)*sizeof(int));
     3606  }
     3607  else
     3608    qq = p_PermPoly(zz, par_perm-1, srcExtRing, dst, nMap, NULL, rVar (srcExtRing)-1);
     3609
     3610  assume (p_Test (qq, dst));
     3611
    35963612//       poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst, nMapFunc nMap, int *par_perm, int OldPar)
    35973613
     
    36293645      qq = p_Init(dst);
    36303646      assume( nMap != NULL );
     3647
    36313648      number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf);
     3649
     3650      assume (n_Test (n,dst->cf));
    36323651
    36333652      if ( nCoeff_is_algExt(dst->cf) )
     
    37493768        }
    37503769      }
    3751       if ( mapped_to_par && nCoeff_is_algExt(dst->cf) )
     3770      if ( mapped_to_par && qq!= NULL && nCoeff_is_algExt(dst->cf) )
    37523771      {
    37533772        number n = p_GetCoeff(qq, dst);
Note: See TracChangeset for help on using the changeset viewer.