Changeset 31c731 in git for libpolys/polys/ext_fields


Ignore:
Timestamp:
Sep 27, 2011, 12:05:01 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1577ebd5335ce968d500335fe1900d966692ef82
Parents:
e9039a74ae2d173584dadd1c33af0b75e429a59b
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-27 12:05:01+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:36+01:00
Message:
fix some mapping stuff: alg.ext -> transz. ext.
File:
1 edited

Legend:

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

    re9039a7 r31c731  
    270270  definiteGcdCancellation(a, cf, FALSE);
    271271  fraction f = (fraction)a;
    272   return DENIS1(f) && NUMIS1(f);
     272  return (f!=NULL) && DENIS1(f) && NUMIS1(f);
    273273}
    274274
     
    278278  definiteGcdCancellation(a, cf, FALSE);
    279279  fraction f = (fraction)a;
    280   if (!DENIS1(f)) return FALSE;
     280  if ((f==NULL) || (!DENIS1(f))) return FALSE;
    281281  poly g = NUM(f);
    282282  if (!p_IsConstant(g, ntRing)) return FALSE;
     
    983983}
    984984
     985number ntCopyAlg(number a, const coeffs src, const coeffs dst)
     986{
     987  if (n_IsZero(a, src)) return NULL;
     988  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
     989  NUM(f) = p_Copy((poly)a,src->extRing);// DEN(f) = NULL; COM(f) = 0;
     990  return (number)f;
     991}
     992
    985993/* assumes that src = Q, dst = Z/p(t_1, ..., t_s) */
    986994number ntMap0P(number a, const coeffs src, const coeffs dst)
     
    9991007  p_SetCoeff(g, q, dst->extRing);
    10001008  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    1001   NUM(f) = g; DEN(f) = NULL; COM(f) = 0;
     1009  NUM(f) = g; // DEN(f) = NULL; COM(f) = 0;
    10021010  return (number)f;
    10031011}
     
    10451053  /* for the time being, we only provide maps if h = 1 and if b is Q or
    10461054     some field Z/pZ: */
     1055  if (h==0)
     1056  {
     1057    if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))
     1058      return ntMap00;                                 /// Q       -->  Q(T)
     1059    if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
     1060      return ntMapP0;                                 /// Z/p     -->  Q(T)
     1061    if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
     1062      return ntMap0P;                                 /// Q       --> Z/p(T)
     1063    if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
     1064    {
     1065      if (src->ch == dst->ch) return ntMapPP;         /// Z/p     --> Z/p(T)
     1066      else return ntMapUP;                            /// Z/u     --> Z/p(T)
     1067    }
     1068  }
    10471069  if (h != 1) return NULL;
    10481070  if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
     
    10531075     of the form t_1, ..., t_w with w <= s. */
    10541076 
    1055   if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))
    1056     return ntMap00;                                      /// Q       -->  Q(T)
    1057  
    1058   if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
    1059     return ntMapP0;                                      /// Z/p     -->  Q(T)
    1060  
    1061   if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
    1062     return ntMap0P;                                      /// Q       --> Z/p(T)
    1063  
    1064   if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
    1065   {
    1066     if (src->ch == dst->ch) return ntMapPP;              /// Z/p     --> Z/p(T)
    1067     else return ntMapUP;                                 /// Z/u     --> Z/p(T)
    1068   }
    1069  
    10701077  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
    10711078  if (h != 1) return NULL;
     
    10781085      if (strcmp(rRingVar(i, src->extRing),
    10791086                 rRingVar(i, dst->extRing)) != 0) return NULL;
    1080       return ntCopyMap;                                  /// Q(T')   --> Q(T)
     1087      if (src->type==n_transExt)
     1088        return ntCopyMap;                              /// Q(T')   --> Q(T)
     1089      else
     1090        return ntCopyAlg;
    10811091  }
    10821092 
     
    10871097      if (strcmp(rRingVar(i, src->extRing),
    10881098                 rRingVar(i, dst->extRing)) != 0) return NULL;
    1089       return ntCopyMap;                                  /// Z/p(T') --> Z/p(T)
     1099      if (src->type==n_transExt)
     1100        return ntCopyMap;                              /// Z/p(T') --> Z/p(T)
     1101      else
     1102        return ntCopyAlg;
    10901103  }
    10911104 
     
    10931106}
    10941107
    1095 void ntKillChar(coeffs cf) {
     1108void ntKillChar(coeffs cf)
     1109{
    10961110  if ((--cf->extRing->ref) == 0)
    10971111    rDelete(cf->extRing);
Note: See TracChangeset for help on using the changeset viewer.