Changeset 488808e in git for libpolys/coeffs/coeffs.h


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/coeffs/coeffs.h

    r73a9ffb r488808e  
    4545typedef struct snumber *   number;
    4646
    47 struct snumber;
    48 typedef struct snumber *   number;
    49 
    5047/* standard types */
    5148#ifdef HAVE_RINGS
     
    5855
    5956struct n_Procs_s;
    60 typedef struct  n_Procs_s  n_Procs_s;
    6157typedef struct  n_Procs_s  *coeffs;
    6258
     
    182178//-------------------------------------------
    183179
    184   /// For Zp_a, Q_a we need polynomials (due to polys)
    185   ring          algring; //< implementation of extensions needs polynomials...
    186   // // for Q_a/Zp_a, rInit
     180  /* for extension fields we need to be able to represent polynomials,
     181     so here is the polynomial ring: */
     182  ring          algring;
     183
    187184  //number     minpoly;  //< no longer needed: replaced by
    188185  //                     //<  algring->minideal->[0]
     
    222219                     intermediate extension fields, i.e., in this case
    223220                     it is redundant along the chain of field extensions;
    224                      CONTRARY to SINGULAR as it was, we do NOT LONGER use
    225                      negative values for ch. */
     221                     CONTRARY to SINGULAR as it was, we do NO LONGER use
     222                     negative values for ch;
     223                     for rings, ch will also be set and is - per def -
     224                     the smallest number of 1's that sum up to zero;
     225                     however, in this case ch may not fit in an int,
     226                     thus ch may contain a faulty value */
    226227
    227228  short      float_len; /* additional char-flags, rInit */
     
    233234  // for n_GF
    234235
    235   int m_nfCharQ;  ///< the number of elemts: q
     236  int m_nfCharQ;  ///< the number of elements: q
    236237  int m_nfM1;       ///< representation of -1
    237238  int m_nfCharP;  ///< the characteristic: p
     
    438439
    439440static inline BOOLEAN nCoeff_is_Zp(const coeffs r, int p)
    440 { assume(r != NULL); return (getCoeffType(r)  && (r->ch == ABS(p))); }
     441{ assume(r != NULL); return (getCoeffType(r)  && (r->ch == p)); }
    441442
    442443static inline BOOLEAN nCoeff_is_Q(const coeffs r)
     
    447448// (r->ringtype == 0) && (r->ch ==  -1); ??
    448449
    449 
    450450static inline BOOLEAN nCoeff_is_R(const coeffs r)
    451451{ assume(r != NULL); return getCoeffType(r)==n_R; }
     
    457457{ assume(r != NULL); return (getCoeffType(r)==n_GF) && (r->ch == q); }
    458458
    459 /* TRUE iff an extension tower is build upon some Zp, i.e., the bottom
    460    field in this tower is Zp */
     459/* TRUE iff r represents an algebraic or transcendental extension field */
     460static inline BOOLEAN nCoeff_is_Extension(const coeffs r)
     461{
     462  assume(r != NULL);
     463  return (getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt);
     464}
     465
     466/* DO NOT USE (only kept for compatibility reasons towards the SINGULAR
     467   svn trunk);
     468   intension: should be TRUE iff the given r is an extension field above
     469   some Z/pZ;
     470   actually: TRUE iff the given r is an extension tower of arbitrary
     471   height above some field of characteristic p (may be Z/pZ or some
     472   Galois field of characteristic p) */
    461473static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r)
    462474{
    463475  assume(r != NULL);
    464   return (r->ringtype == 0) &&
    465          ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
    466          (r->ch != 0);
    467 }
    468 
    469 /* TRUE iff an extension tower is build upon Zp (p as provided), i.e.,
    470    the bottom field in this tower is Zp */
     476  return ((r->ringtype == 0) && (r->ch != 0) && nCoeff_is_Extension(r));
     477}
     478
     479/* DO NOT USE (only kept for compatibility reasons towards the SINGULAR
     480   svn trunk);
     481   intension: should be TRUE iff the given r is an extension field above
     482   Z/pZ (with p as provided);
     483   actually: TRUE iff the given r is an extension tower of arbitrary
     484   height above some field of characteristic p (may be Z/pZ or some
     485   Galois field of characteristic p) */
    471486static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p)
    472487{
    473488  assume(r != NULL);
    474   return (r->ringtype == 0) &&
    475          ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
    476          (r->ch != 0) && (r->ch == p);
    477 }
    478 
    479 /* TRUE iff an extension tower is build upon Q, i.e.,
    480    the bottom field in this tower is Q */
     489  return ((r->ringtype == 0) && (r->ch == p) && nCoeff_is_Extension(r));
     490}
     491
     492/* DO NOT USE (only kept for compatibility reasons towards the SINGULAR
     493   svn trunk);
     494   intension: should be TRUE iff the given r is an extension field
     495   above Q;
     496   actually: TRUE iff the given r is an extension tower of arbitrary
     497   height above some field of characteristic 0 (may be Q, R, or C) */
    481498static inline BOOLEAN nCoeff_is_Q_a(const coeffs r)
    482499{
    483500  assume(r != NULL);
    484   return (r->ringtype == 0) &&
    485          ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) &&
    486          (r->ch == 0);
     501  return ((r->ringtype == 0) && (r->ch == 0) && nCoeff_is_Extension(r));
    487502}
    488503
     
    507522// #endif
    508523
    509 
    510 
    511524/// TRUE if n_Delete/n_New are empty operations
    512525static inline BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
     
    520533//             || rField_is_R(r)); }
    521534
    522 /* TRUE iff r represents an algebraic or transcendental extension field */
    523 static inline BOOLEAN nCoeff_is_Extension(const coeffs r)
    524 {
    525   assume(r != NULL);
    526   return (getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt);
    527 }
    528 
    529535/* TRUE iff r represents an algebraic extension field */
    530536static inline BOOLEAN nCoeff_is_algExt(const coeffs r)
Note: See TracChangeset for help on using the changeset viewer.