Changeset 8e0242 in git
- Timestamp:
- May 3, 2010, 1:55:52 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 3aae0e3e34a42ae26c9f4be2d2e8beaefb6268b0
- Parents:
- 88e67079e82b521877fc5e0cb96a457cd3b458dc
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-05-03 13:55:52+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:50:25+01:00
- Location:
- coeffs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/coeffs.h
r88e670 r8e0242 74 74 n_Zp_a, 75 75 n_Q_a, 76 n_long_C 77 #ifdef HAVE_RINGS 78 ,n_Z,76 n_long_C, 77 // only used if HAVE_RINGS is defined 78 n_Z, 79 79 n_Zm, 80 80 n_Zpn, 81 81 n_Z2n 82 #endif83 82 }; 84 83 … … 111 110 112 111 coeffs next; 112 n_coeffType fieldtype; 113 unsigned int ringtype; /* 0 => coefficient field, 1 => coeffs from Z/2^m */ 114 113 115 // the union stuff 114 116 … … 128 130 // general stuff 129 131 numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv; 130 /// init with an integer 132 /// init with an integer 131 133 number (*cfInit)(int i,const coeffs r); 132 134 number (*nPar)(int i, const coeffs r); … … 193 195 194 196 #ifdef HAVE_RINGS 195 unsigned int ringtype; /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */196 197 int_number ringflaga; /* Z/(ringflag^ringflagb)=Z/nrnModul*/ 197 198 unsigned long ringflagb; -
coeffs/mpr_complex.h
r88e670 r8e0242 15 15 // must have gmp version >= 2 16 16 #include "si_gmp.h" 17 #include "numbers.h"18 17 #include "mpr_global.h" 19 18 -
coeffs/numbers.h
r88e670 r8e0242 73 73 #define nGetChar() n_GetChar(currRing) 74 74 75 void nInitChar(coeffs r); 76 void nKillChar(coeffs r); 77 void nSetChar(coeffs r); 75 void nInitChar(coeffs r); // do one-time initialisations 76 void nKillChar(coeffs r); // undo all initialisations 77 void nSetChar(coeffs r); // initialisations after each ring chage 78 78 79 79 #define nDivBy0 "div by 0" … … 83 83 84 84 // Tests: 85 #ifdef HAVE_RINGS86 85 static inline BOOLEAN nField_is_Ring_2toM(const coeffs r) 87 86 { return (r->ringtype == 1); } … … 104 103 static inline BOOLEAN nField_has_Units(const coeffs r) 105 104 { return ((r->ringtype == 1) || (r->ringtype == 2) || (r->ringtype == 3)); } 106 #else107 #define nField_is_Ring(A) (0)108 #endif109 105 110 106 … … 118 114 119 115 120 #ifdef HAVE_RINGS 116 static inline n_coeffType nField_is(const coeffs r) 117 { return r->fieldtype; } 121 118 static inline BOOLEAN nField_is_Zp(const coeffs r) 122 { return (r->ringtype == 0) && (r->ch > 1) && (r->parameter==NULL); }119 { return nField_is(r)==n_Zp; } 123 120 124 121 static inline BOOLEAN nField_is_Zp(const coeffs r, int p) 125 { return ( r->ringtype == 0) && (r->ch > 1 && r->ch == ABS(p) && r->parameter==NULL); }122 { return (nField_is_Zp(r) && (r->ch == ABS(p))); } 126 123 127 124 static inline BOOLEAN nField_is_Q(const coeffs r) 128 { return (r->ringtype == 0) && (r->ch == 0) && (r->parameter==NULL); } 129 125 { return nField_is(r)==n_Q; } 130 126 131 127 static inline BOOLEAN nField_is_numeric(const coeffs r) /* R, long R, long C */ 132 { return (r->ringtype == 0) && (r->ch == -1); }128 { return (nField_is(r)==n_R) || (nField_is(r)==n_long_R) || (nField_is(r)==n_long_C); } 133 129 134 130 static inline BOOLEAN nField_is_R(const coeffs r) 135 { 136 if (nField_is_numeric(r) && (r->float_len <= (short)SHORT_REAL_LENGTH)) 137 return (r->ringtype == 0) && (r->parameter==NULL); 138 return FALSE; 139 } 131 { return nField_is(r)==n_R; } 140 132 141 133 static inline BOOLEAN nField_is_GF(const coeffs r) 142 { return (r->ringtype == 0) && (r->ch > 1) && (r->parameter!=NULL); }134 { return nField_is(r)==n_GF; } 143 135 144 136 static inline BOOLEAN nField_is_GF(const coeffs r, int q) 145 { return ( r->ringtype == 0) && (r->ch == q); }137 { return (nField_is(r)==n_GF) && (r->ch == q); } 146 138 147 139 static inline BOOLEAN nField_is_Zp_a(const coeffs r) … … 155 147 156 148 static inline BOOLEAN nField_is_long_R(const coeffs r) 157 { 158 if (nField_is_numeric(r) && (r->float_len >(short)SHORT_REAL_LENGTH)) 159 return (r->ringtype == 0) && (r->parameter==NULL); 160 return FALSE; 161 } 149 { return nField_is(r)==n_long_R; } 162 150 163 151 static inline BOOLEAN nField_is_long_C(const coeffs r) 164 { 165 if (nField_is_numeric(r)) 166 return (r->ringtype == 0) && (r->parameter!=NULL); 167 return FALSE; 168 } 169 170 #else 171 172 173 static inline BOOLEAN nField_is_Zp(const coeffs r) 174 { return (r->ch > 1) && (r->parameter==NULL); } 175 176 static inline BOOLEAN nField_is_Zp(const coeffs r, int p) 177 { return (r->ch > 1 && r->ch == ABS(p) && r->parameter==NULL); } 178 179 static inline BOOLEAN nField_is_Q(const coeffs r) 180 { return (r->ch == 0) && (r->parameter==NULL); } 181 182 static inline BOOLEAN nField_is_numeric(const coeffs r) /* R, long R, long C */ 183 { return (r->ch == -1); } 184 185 static inline BOOLEAN nField_is_R(const coeffs r) 186 { 187 if (nField_is_numeric(r) && (r->float_len <= (short)SHORT_REAL_LENGTH)) 188 return (r->parameter==NULL); 189 return FALSE; 190 } 191 192 static inline BOOLEAN nField_is_GF(const coeffs r) 193 { return (r->ch > 1) && (r->parameter!=NULL); } 194 195 static inline BOOLEAN nField_is_GF(const coeffs r, int q) 196 { return (r->ch == q); } 197 198 static inline BOOLEAN nField_is_Zp_a(const coeffs r) 199 { return (r->ch < -1); } 200 201 static inline BOOLEAN nField_is_Zp_a(const coeffs r, int p) 202 { return (r->ch < -1 ) && (-(r->ch) == ABS(p)); } 203 204 static inline BOOLEAN nField_is_Q_a(const coeffs r) 205 { return (r->ch == 1); } 206 207 static inline BOOLEAN nField_is_long_R(const coeffs r) 208 { 209 if (nField_is_numeric(r) && (r->float_len >(short)SHORT_REAL_LENGTH)) 210 return (r->parameter==NULL); 211 return FALSE; 212 } 213 214 static inline BOOLEAN nField_is_long_C(const coeffs r) 215 { 216 if (nField_is_numeric(r)) 217 return (r->parameter!=NULL); 218 return FALSE; 219 } 220 #endif 152 { return nField_is(r)==n_long_C; } 221 153 222 154 static inline BOOLEAN nField_has_simple_inverse(const coeffs r)
Note: See TracChangeset
for help on using the changeset viewer.