Ignore:
Timestamp:
May 26, 2011, 12:12:01 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
5a4b26f3e00776270c3ba83b16c92a69f3cca0e0
Parents:
73a9ffb72679635d0a4389f31022ac7b37564499
git-author:
Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-26 12:12:01+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:53+01:00
Message:
removed calls to nCoeff_is_Q_a and nCoeff_is_Zp_a (kept definitions for compatibility towards svn trunk); changed map in algext.cc
File:
1 edited

Legend:

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

    r73a9ffb r488808e  
    8787void definiteReduce(poly &p, poly reducer, const coeffs cf);
    8888
     89/* returns the bottom field in this field extension tower; if the tower
     90   is flat, i.e., if there is no extension, then r itself is returned;
     91   as a side-effect, the counter 'height' is filled with the height of
     92   the extension tower (in case the tower is flat, 'height' is zero) */
     93static coeffs nCoeff_bottom(const coeffs r, int &height)
     94{
     95  assume(r != NULL);
     96  coeffs cf = r;
     97  height = 0;
     98  while (nCoeff_is_Extension(cf))
     99  {
     100    assume(cf->algring != NULL); assume(cf->algring->cf != NULL);
     101    cf = cf->algring->cf;
     102    height++;
     103  }
     104  return cf;
     105}
     106
    89107BOOLEAN naIsZero(number a, const coeffs cf)
    90108{
     
    526544nMapFunc naSetMap(const coeffs src, const coeffs dst)
    527545{
    528   /* dst is expected to be an algebraic extension field */
     546  /* dst is expected to be an algebraic field extension */
    529547  assume(getCoeffType(dst) == n_algExt);
    530548 
    531   /* ATTENTION: This code assumes that dst is an algebraic extension of Q
    532                 or Zp. So, dst must NOT BE an algebraic extension of some
    533                 extension etc. This code will NOT WORK for extension
    534                 towers of height >= 2. */
    535  
    536   if (nCoeff_is_Q(src) && nCoeff_is_Q_a(dst))
     549  int h = 0; /* the height of the extension tower given by dst */
     550  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
     551 
     552  /* for the time being, we only provide maps if h = 1 and if b is Q or
     553     some field Z/pZ: */
     554  if (h != 1) return NULL;
     555  if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
     556 
     557  if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))
    537558    return naMap00;                                      /// Q     -->  Q(a)
    538559 
    539   if (nCoeff_is_Zp(src) && nCoeff_is_Q_a(dst))
     560  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
    540561    return naMapP0;                                      /// Z/p   -->  Q(a)
    541562 
    542   if (nCoeff_is_Q_a(src) && nCoeff_is_Q_a(dst))
     563  if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
     564    return naMap0P;                                      /// Q      --> Z/p(a)
     565 
     566  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
     567  {
     568    if (src->ch == dst->ch) return naMapPP;              /// Z/p    --> Z/p(a)
     569    else return naMapUP;                                 /// Z/u    --> Z/p(a)
     570  }
     571 
     572  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
     573  if (h != 1) return NULL;
     574  if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q(bSrc))) return NULL;
     575 
     576  if (nCoeff_is_Q(bSrc) && nCoeff_is_Q(bDst))
    543577  {
    544578    if (strcmp(rParameter(src->algring)[0],
     
    549583  }
    550584 
    551   if (nCoeff_is_Q(src) && nCoeff_is_Zp_a(dst))
    552     return naMap0P;                                      /// Q      --> Z/p(a)
    553  
    554   if (nCoeff_is_Zp(src) && nCoeff_is_Zp_a(dst))
    555   {
    556     if (src->ch == dst->ch) return naMapPP;              /// Z/p    --> Z/p(a)
    557     else return naMapUP;                                 /// Z/u    --> Z/p(a)
    558   }
    559  
    560   if (nCoeff_is_Zp_a(src) && nCoeff_is_Zp_a(dst))
     585  if (nCoeff_is_Zp(bSrc) && nCoeff_is_Zp(bDst))
    561586  {
    562587    if (strcmp(rParameter(src->algring)[0],
Note: See TracChangeset for help on using the changeset viewer.