Changeset 141342 in git


Ignore:
Timestamp:
May 25, 2011, 11:13:13 AM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f0797cc6a47f909e14515d7d07179ce7dbb9c8b7
Parents:
48a994659e87a54916c1ebffdba59be9375387e4
git-author:
Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-25 11:13:13+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:52+01:00
Message:
nExt replaced by n_algExt and n_transExt
Location:
libpolys
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    r48a994 r141342  
    2727  n_GF,
    2828  n_long_R,
    29   n_Ext,  // used for all extensions (of Zp, of Q AND OF EXTENSIONS THEREOF)
     29  n_algExt,  /* used for all algebraic extensions, i.e.,
     30                the top-most extension in an extension tower
     31                is algebraic */
     32  n_transExt,  /* used for all transcendental extensions, i.e.,
     33                  the top-most extension in an extension tower
     34                  is transcendental */
    3035  n_long_C,
    3136  // only used if HAVE_RINGS is defined:
     
    442447{ assume(r != NULL); return (getCoeffType(r)==n_GF) && (r->ch == q); }
    443448
     449/* TRUE iff an extension tower is build upon some Zp, i.e., the bottom
     450   field in this tower is Zp */
    444451static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r)
    445452{
    446453  assume(r != NULL);
    447   return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1);
    448 }
    449 
     454printf("###### %d, %d\n", r->ringtype, r->ch);
     455printf("###### %d, %d, %d\n", getCoeffType(r), n_algExt, n_transExt);
     456  return (r->ringtype == 0) &&
     457         ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
     458         (r->ch < -1);
     459}
     460
     461/* TRUE iff an extension tower is build upon Zp (p as provided), i.e.,
     462   the bottom field in this tower is Zp */
    450463static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p)
    451464{
    452465  assume(r != NULL);
    453   return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1 )
    454                             && (-(r->ch) == ABS(p));
    455 }
    456 
     466  return (r->ringtype == 0) &&
     467         ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
     468         (r->ch < -1 ) && (-(r->ch) == p);
     469}
     470
     471/* TRUE iff an extension tower is build upon Q, i.e.,
     472   the bottom field in this tower is Q */
    457473static inline BOOLEAN nCoeff_is_Q_a(const coeffs r)
    458474{
    459475  assume(r != NULL);
    460   return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch == 0);
     476  return (r->ringtype == 0) &&
     477         ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
     478         (r->ch == 0);
    461479}
    462480
     
    494512//             || rField_is_R(r)); }
    495513
    496 
     514/* TRUE iff r represents an algebraic or transcendental extension field */
    497515static inline BOOLEAN nCoeff_is_Extension(const coeffs r)
    498 { assume(r != NULL); return (nCoeff_is_Q_a(r)) || (nCoeff_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/
     516{
     517  assume(r != NULL);
     518  return (getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt);
     519}
     520
     521/* TRUE iff r represents an algebraic extension field */
     522static inline BOOLEAN nCoeff_is_algExt(const coeffs r)
     523{ assume(r != NULL); return (getCoeffType(r)==n_algExt); }
     524
     525/* TRUE iff r represents a transcendental extension field */
     526static inline BOOLEAN nCoeff_is_transExt(const coeffs r)
     527{ assume(r != NULL); return (getCoeffType(r)==n_transExt); }
    499528
    500529/// BOOLEAN n_Test(number a, const coeffs r)
  • libpolys/coeffs/test.cc

    r48a994 r141342  
    160160      CASE(n_GF);
    161161      CASE(n_long_R);
    162       CASE(n_Ext);
     162      CASE(n_algExt);
     163      CASE(n_transExt);
    163164      CASE(n_long_C);
    164165      CASE(n_Z);
     
    372373#endif
    373374 
    374   // polynomial rings needed for: n_Ext !
     375  // polynomial rings needed for: n_algExt, n_transExt !
    375376 
    376377  return c;
  • libpolys/polys/ext_fields/algext.cc

    r48a994 r141342  
    523523nMapFunc naSetMap(const coeffs src, const coeffs dst)
    524524{
    525   /* dst is expected to be an (algebraic) extension field */
    526   assume(getCoeffType(dst) == n_Ext);
     525  /* dst is expected to be an algebraic extension field */
     526  assume(getCoeffType(dst) == n_algExt);
     527 
     528  /* ATTENTION: This code assumes that dst is an algebraic extension of Q
     529                or Zp. So, dst must NOT BE an algebraic extension of some
     530                extension etc. This code will NOT WORK for extension
     531                towers of height >= 2. */
    527532 
    528533  if (nCoeff_is_Q(src) && nCoeff_is_Q_a(dst))
     
    575580  assume(cf->algring->cf                 != NULL);      // algring->cf;
    576581  assume(getCoeffType(cf) == naID);                     // coeff type;
     582 
     583  cf->ch = cf->algring->cf->ch;   /* propagate characteristic up so that it
     584                                     becomes directly accessible in cf */
    577585 
    578586  #ifdef LDEBUG
  • libpolys/polys/ext_fields/algext.h

    r48a994 r141342  
    3737} ExtInfo;
    3838
    39 /// Get a mapping function from src into the domain of this type (n_Ext)
     39/// Get a mapping function from src into the domain of this type (n_algExt)
    4040nMapFunc naSetMap(const coeffs src, const coeffs dst);
    4141
     
    8484
    8585/* our own type */
    86 #define naID n_Ext
     86#define naID n_algExt
    8787
    8888/* polynomial ring in which our numbers live */
  • libpolys/polys/monomials/ring.cc

    r48a994 r141342  
    48814881  if (rField_is_GF(r))     return n_GF;
    48824882  if (rField_is_long_R(r)) return n_long_R;
    4883   if (rField_is_Zp_a(r))   return n_Ext;
    4884   if (rField_is_Q_a(r))    return n_Ext;
     4883  if (rField_is_Zp_a(r))   return getCoeffType(r->cf);
     4884  if (rField_is_Q_a(r))    return getCoeffType(r->cf);
    48854885  if (rField_is_long_C(r)) return n_long_C;
    48864886  #ifdef HAVE_RINGS
  • libpolys/tests/coeffs_test.h

    r48a994 r141342  
    488488
    489489   
    490    // polynomial rings needed for extentions: n_Ext !
     490   // polynomial rings needed for extentions: n_algExt, n_transExt !
    491491   
    492492};
  • libpolys/tests/common.h

    r48a994 r141342  
    3636      CASE(n_GF);
    3737      CASE(n_long_R);
    38       CASE(n_Ext);
     38      CASE(n_algExt);
     39      CASE(n_transExt);
    3940      CASE(n_long_C);
    4041      CASE(n_Z);
  • libpolys/tests/polys_test.h

    r48a994 r141342  
    560560    minIdeal->m[0] = minPoly;                       // minIdeal = < a^2 + 1 >
    561561
    562     n_coeffType type = nRegister(n_Ext, naInitChar);
    563     TS_ASSERT(type == n_Ext);
     562    n_coeffType type = nRegister(n_algExt, naInitChar);
     563    TS_ASSERT(type == n_algExt);
    564564
    565565    ExtInfo extParam;
     
    581581      n_CoeffWrite(cf); PrintLn();
    582582    }
     583   
     584    TS_ASSERT( nCoeff_is_algExt(cf) );
     585    TS_ASSERT( !nCoeff_is_transExt(cf) );
     586    TS_ASSERT( nCoeff_is_Q_a(cf) );
     587    TS_ASSERT( !nCoeff_is_Zp_a(cf) );
    583588   
    584589    // some tests for the coefficient field represented by cf:
     
    658663    minIdeal->m[0] = minPoly;                       // minIdeal = < b^7 + 17 >
    659664
    660     n_coeffType type = nRegister(n_Ext, naInitChar);
    661     TS_ASSERT(type == n_Ext);
     665    n_coeffType type = nRegister(n_algExt, naInitChar);
     666    TS_ASSERT(type == n_algExt);
    662667
    663668    ExtInfo extParam;
     
    679684      n_CoeffWrite(cf); PrintLn();
    680685    }
     686   
     687    TS_ASSERT( nCoeff_is_algExt(cf) );
     688    TS_ASSERT( !nCoeff_is_transExt(cf) );
     689    TS_ASSERT( nCoeff_is_Q_a(cf) );
     690    TS_ASSERT( !nCoeff_is_Zp_a(cf) );
    681691   
    682692    // some tests for the coefficient field represented by cf:
     
    799809    minIdeal->m[0] = minPoly;                       // minIdeal = < a^2 + 3 >
    800810
    801     n_coeffType type = nRegister(n_Ext, naInitChar);
    802     TS_ASSERT(type == n_Ext);
     811    n_coeffType type = nRegister(n_algExt, naInitChar);
     812    TS_ASSERT(type == n_algExt);
    803813
    804814    ExtInfo extParam;
     
    820830      n_CoeffWrite(cf); PrintLn();
    821831    }
     832   
     833    TS_ASSERT( nCoeff_is_algExt(cf) );
     834    TS_ASSERT( !nCoeff_is_transExt(cf) );
     835    TS_ASSERT( !nCoeff_is_Q_a(cf) );
     836    TS_ASSERT( nCoeff_is_Zp_a(cf) );
    822837   
    823838    // some tests for the coefficient field represented by cf:
     
    849864
    850865    Test(s);
    851    
     866    /*
    852867#ifdef HAVE_FACTORY
    853868    poly f = p_ISet(3, s);
     
    870885    p_Delete(&h, s);
    871886#endif
     887    */
    872888    rDelete(s); // kills 'cf' and 'r' as well
    873889  }
Note: See TracChangeset for help on using the changeset viewer.