Changeset 66ce6d in git for libpolys/coeffs/coeffs.h


Ignore:
Timestamp:
Jan 8, 2013, 1:07:50 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
2aee667644f2d68561171e8c9ca4258221af3702
Parents:
f3057e70e4aa29729c2cb61a6794e057fb4351b7
git-author:
Martin Lee <martinlee84@web.de>2013-01-08 13:07:50+01:00
git-committer:
Martin Lee <martinlee84@web.de>2013-01-17 18:24:09+01:00
Message:
chg: got rid of ringtype
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    rf3057e7 r66ce6d  
    9494{
    9595   coeffs next;
    96    unsigned int ringtype;  /* =0 => coefficient field,
     96   /*unsigned int ringtype;  =0 => coefficient field,
    9797                             !=0 => coeffs from one of the rings:
    9898                              =1 => Z/2^mZ
     
    609609// Tests:
    610610static inline BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
    611 { assume(r != NULL); return (r->ringtype == 1); }
     611{ assume(r != NULL); return (getCoeffType(r)==n_Z2m); }
    612612
    613613static inline BOOLEAN nCoeff_is_Ring_ModN(const coeffs r)
    614 { assume(r != NULL); return (r->ringtype == 2); }
     614{ assume(r != NULL); return (getCoeffType(r)==n_Zn); }
    615615
    616616static inline BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
    617 { assume(r != NULL); return (r->ringtype == 3); }
     617{ assume(r != NULL); return (getCoeffType(r)==n_Znm); }
    618618
    619619static inline BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
    620 { assume(r != NULL); return (r->ringtype == 4); }
     620{ assume(r != NULL); return (getCoeffType(r)==n_Z); }
    621621
    622622static inline BOOLEAN nCoeff_is_Ring(const coeffs r)
    623 { assume(r != NULL); return (r->ringtype != 0); }
     623{ assume(r != NULL); return ((getCoeffType(r)==n_Z) || (getCoeffType(r)==n_Z2m) || (getCoeffType(r)==n_Zn) || (getCoeffType(r)==n_Znm)); }
    624624
    625625/// returns TRUE, if r is not a field and r has no zero divisors (i.e is a domain)
     
    628628  assume(r != NULL);
    629629#ifdef HAVE_RINGS
    630   return (r->ringtype == 4 || r->ringtype == 0);
     630  return (getCoeffType(r)==n_Z || ((getCoeffType(r)!=n_Z2m) && (getCoeffType(r)!=n_Zn) && (getCoeffType(r)!=n_Znm)));
    631631#else
    632632  return TRUE;
     
    707707/// returns TRUE, if r is not a field and r has non-trivial units
    708708static inline BOOLEAN nCoeff_has_Units(const coeffs r)
    709 { assume(r != NULL); return ((r->ringtype == 1) || (r->ringtype == 2) || (r->ringtype == 3)); }
     709{ assume(r != NULL); return ((getCoeffType(r)==n_Zn) || (getCoeffType(r)==n_Z2m) || (getCoeffType(r)==n_Znm)); }
    710710
    711711static inline BOOLEAN nCoeff_is_Zp(const coeffs r)
Note: See TracChangeset for help on using the changeset viewer.