Changeset 331fd0 in git for libpolys/polys/ext_fields


Ignore:
Timestamp:
Sep 27, 2011, 2:50:46 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6f6b9df159c9c68abfcfe9d2008f357892b7191a
Parents:
7f10dcde67f050fefbfeef12ce8d0108889fb6cc
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-27 14:50:46+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:37+01:00
Message:
fix: naSetMap
Location:
libpolys/polys/ext_fields
Files:
2 edited

Legend:

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

    r7f10dc r331fd0  
    4545
    4646#include "ext_fields/algext.h"
     47#define TRANSEXT_PRIVATES 1
     48#include "ext_fields/transext.h"
    4749
    4850#ifdef LDEBUG
     
    562564}
    563565
     566number naCopyExt(number a, const coeffs src, const coeffs dst)
     567{
     568  fraction fa=(fraction)a;
     569  return (number)p_Copy(NUM(fa),src->extRing);
     570}
     571
    564572/* assumes that src = Q, dst = Z/p(a) */
    565573number naMap0P(number a, const coeffs src, const coeffs dst)
     
    603611  int h = 0; /* the height of the extension tower given by dst */
    604612  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
     613  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
    605614 
    606615  /* for the time being, we only provide maps if h = 1 and if b is Q or
    607616     some field Z/pZ: */
     617  if (h==0)
     618  {
     619    if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))
     620      return naMap00;                            /// Q     -->  Q(a)
     621    if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
     622      return naMapP0;                            /// Z/p   -->  Q(a)
     623    if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
     624      return naMap0P;                            /// Q      --> Z/p(a)
     625    if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
     626    {
     627      if (src->ch == dst->ch) return naMapPP;    /// Z/p    --> Z/p(a)
     628      else return naMapUP;                       /// Z/u    --> Z/p(a)
     629    }
     630  }
    608631  if (h != 1) return NULL;
    609632  if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
    610  
    611   if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))
    612     return naMap00;                                      /// Q     -->  Q(a)
    613  
    614   if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
    615     return naMapP0;                                      /// Z/p   -->  Q(a)
    616  
    617   if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
    618     return naMap0P;                                      /// Q      --> Z/p(a)
    619  
    620   if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
    621   {
    622     if (src->ch == dst->ch) return naMapPP;              /// Z/p    --> Z/p(a)
    623     else return naMapUP;                                 /// Z/u    --> Z/p(a)
    624   }
    625  
    626   coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
    627   if (h != 1) return NULL;
    628633  if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q(bSrc))) return NULL;
    629634 
     
    632637    if (strcmp(rRingVar(0, src->extRing),
    633638               rRingVar(0, dst->extRing)) == 0)
    634       return naCopyMap;                                  /// Q(a)   --> Q(a)
     639    {
     640      if (src->type==n_algExt)
     641         return naCopyMap;                       /// Q(a)   --> Q(a)
     642      else
     643         return naCopyExt;
     644    }
    635645    else
    636       return NULL;                                       /// Q(b)   --> Q(a)
     646      return NULL;                               /// Q(b)   --> Q(a)
    637647  }
    638648 
     
    641651    if (strcmp(rParameter(src->extRing)[0],
    642652               rParameter(dst->extRing)[0]) == 0)
    643       return naCopyMap;                                  /// Z/p(a) --> Z/p(a)
     653    {
     654      if (src->type==n_algExt)
     655        return naCopyMap;                        /// Z/p(a) --> Z/p(a)
     656      else
     657         return naCopyExt;
     658    }
    644659    else
    645       return NULL;                                       /// Z/p(b) --> Z/p(a)
     660      return NULL;                               /// Z/p(b) --> Z/p(a)
    646661  }
    647662 
  • libpolys/polys/ext_fields/transext.cc

    r7f10dc r331fd0  
    899899  else
    900900  { /* return pa*pb/gcd */
     901    poly newNum = singclap_pdivide(NUM(fa), pGcd, ntRing);
    901902    p_Delete(&pGcd,ntRing);
    902     poly newNum = singclap_pdivide(NUM(fa), pGcd, ntRing);
    903903    fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
    904904    NUM(result) = p_Mult_q(p_Copy(DEN(fb),ntRing),newNum,ntRing);
     
    10971097  int h = 0; /* the height of the extension tower given by dst */
    10981098  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
     1099  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
    10991100 
    11001101  /* for the time being, we only provide maps if h = 1 and if b is Q or
     
    11221123     of the form t_1, ..., t_w with w <= s. */
    11231124 
    1124   coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
    1125   if (h != 1) return NULL;
    11261125  if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q(bSrc))) return NULL;
    11271126 
Note: See TracChangeset for help on using the changeset viewer.