Changeset ec96d7 in git
- Timestamp:
- Jul 7, 2010, 5:51:59 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- e471bdd43569e854291611e8809c823f09178a34
- Parents:
- a23b2107d8a272d2243292dc7d9703920aa2bd55
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-07-07 17:51:59+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:23+01:00
- Location:
- polys
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
polys/Makefile.in
ra23b21 rec96d7 34 34 CXXFLAGS = -O3 -w -fomit-frame-pointer --no-rtti ${PIPE} 35 35 CXXTEMPLFLAGS = -fno-implicit-templates --no-exceptions 36 CPPFLAGS = -I${srcdir} -I${includedir} -I${srcdir}../misc/36 CPPFLAGS = -I${srcdir} -I${includedir} 37 37 DEFS = -DNDEBUG -DOM_NDEBUG -Dix86_Linux -DHAVE_CONFIG_H 38 38 -
polys/monomials/polys-impl.h
ra23b21 rec96d7 19 19 #include <coeffs.h> 20 20 21 /***************************************************************22 *23 * definition of the poly structure and its fields24 *25 ***************************************************************/26 27 struct spolyrec28 {29 poly next; // next needs to be the first field30 number coef; // and coef the second --- do not change this !!!31 unsigned long exp[1]; // make sure that exp is aligned32 };33 typedef struct spolyrec * poly;34 35 21 #define POLYSIZE (sizeof(poly) + sizeof(number)) 36 22 #define POLYSIZEW (POLYSIZE / sizeof(long)) … … 41 27 #endif 42 28 43 44 /***************************************************************45 *46 * What should be inlined and debugged?47 *48 ***************************************************************/49 // determines inlining of poly procs which iter through polys50 #if defined(DO_PINLINE0) && !defined(PDEBUG)51 #define PINLINE0 static inline52 #else53 #define PINLINE054 #endif55 56 // determines inlining of poly procs which iter over ExpVector57 #undef NO_PINLINE158 #if PDEBUG <= 0 && !defined(NO_INLINE1)59 #define PINLINE1 static inline60 #else61 #define PINLINE162 #define NO_PINLINE1 163 #endif64 65 // determines inlining of constant time poly procs66 #undef NO_PINLINE267 #if PDEBUG <= 1 && !defined(NO_INLINE2)68 #define PINLINE2 static inline69 #else70 #define PINLINE271 #define NO_PINLINE2 172 #endif73 74 // determines inlining of stuff from polys-impl.h75 #undef NO_PINLINE376 #if PDEBUG <= 2 && !defined(NO_INLINE3)77 #define PINLINE3 static inline78 #else79 #define PINLINE380 #define NO_PINLINE3 181 #endif82 83 /***************************************************************84 *85 * prepare debugging86 *87 ***************************************************************/88 89 #if defined(PDEBUG)90 91 extern BOOLEAN dPolyReportError(poly p, ring r, const char* fmt, ...);92 93 // macros for checking of polys94 #define pAssumeReturn(cond) \95 do \96 { \97 if (! (cond)) \98 { \99 dPolyReportError(NULL, NULL, "pAssume violation of: %s", \100 #cond); \101 return FALSE; \102 } \103 } \104 while (0)105 106 #define pAssume(cond) \107 do \108 { \109 if (! (cond)) \110 { \111 dPolyReportError(NULL, NULL, "pAssume violation of: %s", \112 #cond); \113 } \114 } \115 while (0)116 117 #define pPolyAssumeReturn(cond, p, r) \118 do \119 { \120 if (! (cond)) \121 { \122 dPolyReportError(p, r, "pPolyAssume violation of: %s", \123 #cond); \124 return FALSE; \125 } \126 } \127 while (0)128 129 #define pPolyAssume(cond,p,r) \130 do \131 { \132 if (! (cond)) \133 { \134 dPolyReportError(p, r, "pPolyAssume violation of: %s", \135 #cond); \136 } \137 } \138 while (0)139 140 #define pPolyAssumeReturnMsg(cond, msg, p, r) \141 do \142 { \143 if (! (cond)) \144 { \145 dPolyReportError(p, r, "%s ", msg); \146 return FALSE; \147 } \148 } \149 while (0)150 151 #define pFalseReturn(cond) do {if (! (cond)) return FALSE;} while (0)152 #if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)153 #define p_SetRingOfLm(p, r) omSetCustomOfAddr(p, r)154 void p_SetRingOfLeftv(leftv l, ring r);155 #else156 #define p_SetRingOfLm(p, r) ((void)0)157 #define p_SetRingOfLeftv(l, r) ((void)0)158 #endif159 160 #else // ! defined(PDEBUG)161 #define pFalseReturn(cond) ((void)0)162 #define pAssume(cond) ((void)0)163 #define pPolyAssume(cond, p,r) ((void)0)164 #define pPolyAssumeReturn(cond,p,r) ((void)0)165 #define p_SetRingOfLm(p, r) ((void)0)166 #define p_SetRingOfLeftv(l, r) ((void)0)167 #endif // defined(PDEBUG)168 169 #if PDEBUG >= 1170 #define pAssume1 pAssume171 #define pPolyAssume1 pPolyAssume172 #define pAssumeReturn1 pAssumeReturn173 #define pPolyAssumeReturn1 pPolyAssumeReturn174 #define _pPolyAssumeReturn1 _pPolyAssumeReturn175 #define p_LmCheckPolyRing1 p_LmCheckPolyRing176 #define p_CheckRing1 p_CheckRing177 #define pIfThen1 pIfThen178 #else179 #define pAssume1(cond) ((void)0)180 #define pPolyAssume1(cond) ((void)0)181 #define pAssumeReturn1(cond) ((void)0)182 #define pPolyAssumeReturn1(cond) ((void)0)183 #define p_LmCheckPolyRing1(p,r) ((void)0)184 #define p_CheckRing1(r) ((void)0)185 #define pIfThen1(cond, check) ((void)0)186 #endif // PDEBUG >= 1187 188 #if PDEBUG >= 2189 #define pAssume2 pAssume190 #define pPolyAssume2 pPolyAssume191 #define pAssumeReturn2 pAssumeReturn192 #define pPolyAssumeReturn2 pPolyAssumeReturn193 #define p_LmCheckPolyRing2 p_LmCheckPolyRing194 #define p_CheckRing2 p_CheckRing195 #define pIfThen2 pIfThen196 #else197 #define pAssume2(cond) ((void)0)198 #define pPolyAssume2(cond,p,r) ((void)0)199 #define pAssumeReturn2(cond,p,r) ((void)0)200 #define pPolyAssumeReturn2(cond,p,r) ((void)0)201 #define p_LmCheckPolyRing2(p,r) ((void)0)202 #define p_CheckRing2(r) ((void)0)203 #define pIfThen2(cond, check) ((void)0)204 #endif // PDEBUG >= 2205 206 /***************************************************************207 *208 * Macros for access/iteration209 *210 ***************************************************************/211 212 #define __p_GetComp(p, r) (p)->exp[r->pCompIndex]213 #define p_GetComp(p, r) ((long) (r->pCompIndex >= 0 ? __p_GetComp(p, r) : 0))214 29 215 30 /*************************************************************** -
polys/monomials/ring.h
ra23b21 rec96d7 11 11 /* includes */ 12 12 #include <coeffs.h> 13 #include "polys-impl.h" 14 15 #define SHORT_REAL_LENGTH 6 // use short reals for real <= 6 digits 16 17 // #ifdef HAVE_PLURAL 18 #if 0 19 enum nc_type 20 { 21 nc_error = -1, // Something's gone wrong! 22 nc_general = 0, /* yx=q xy+... */ 23 nc_skew, /*1*/ /* yx=q xy */ 24 nc_comm, /*2*/ /* yx= xy */ 25 nc_lie, /*3*/ /* yx=xy+... */ 26 nc_undef, /*4*/ /* for internal reasons */ 27 28 nc_exterior /*5*/ // Exterior Algebra(SCA): yx= -xy & (!:) x^2 = 0 29 }; 30 #endif 31 // #endif 13 //#include "polys-impl.h" 32 14 33 15 enum tHomog … … 38 20 }; 39 21 40 //extern ring currRing;41 //extern ideal currQuotient;42 //extern idhdl currRingHdl;43 44 45 22 void rChangeCurrRing(ring r); 46 void rSetHdl(idhdl h);47 ring rInit(sleftv* pn, sleftv* rv, sleftv* ord);23 //void rSetHdl(idhdl h); 24 //ring rInit(sleftv* pn, sleftv* rv, sleftv* ord); 48 25 idhdl rDefault(const char *s); 49 26 ring rDefault(int ch, int N, char **n); … … 53 30 int r_IsRingVar(const char *n, ring r); 54 31 void rWrite(ring r); 55 void rKill(idhdl h);32 //void rKill(idhdl h); 56 33 void rKill(ring r); 57 34 ring rCopy(ring r); … … 105 82 void rNGetSComps(int** currComponents, long** currShiftedComponents, ring r = currRing); 106 83 107 idhdl rFindHdl(ring r, idhdl n, idhdl w);108 idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n);84 //idhdl rFindHdl(ring r, idhdl n, idhdl w); 85 //idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n); 109 86 const char * rSimpleOrdStr(int ord); 110 87 int rOrderName(char * ordername); … … 113 90 char * rCharStr(ring r); 114 91 char * rString(ring r); 115 int rChar(ring r =currRing);92 int rChar(ring r); 116 93 #define rPar(r) (r->P) 117 94 #define rVar(r) (r->N) … … 125 102 void rUnComplete(ring r); 126 103 127 #define rInternalChar(r) ((r)->ch) 128 129 BOOLEAN rRing_is_Homog(ring r=currRing); 130 BOOLEAN rRing_has_CompLastBlock(ring r=currRing); 104 BOOLEAN rRing_is_Homog(ring r); 105 BOOLEAN rRing_has_CompLastBlock(ring r); 131 106 132 107 #ifdef HAVE_RINGS 133 static inline BOOLEAN rField_is_Ring_2toM(ring r =currRing)108 static inline BOOLEAN rField_is_Ring_2toM(ring r) 134 109 { return (r->ringtype == 1); } 135 110 136 static inline BOOLEAN rField_is_Ring_ModN(ring r =currRing)111 static inline BOOLEAN rField_is_Ring_ModN(ring r) 137 112 { return (r->ringtype == 2); } 138 113 139 static inline BOOLEAN rField_is_Ring_PtoM(ring r =currRing)114 static inline BOOLEAN rField_is_Ring_PtoM(ring r) 140 115 { return (r->ringtype == 3); } 141 116 142 static inline BOOLEAN rField_is_Ring_Z(ring r =currRing)117 static inline BOOLEAN rField_is_Ring_Z(ring r) 143 118 { return (r->ringtype == 4); } 144 119 145 static inline BOOLEAN rField_is_Ring(ring r =currRing)120 static inline BOOLEAN rField_is_Ring(ring r) 146 121 { return (r->ringtype != 0); } 147 122 148 static inline BOOLEAN rField_is_Domain(ring r =currRing)123 static inline BOOLEAN rField_is_Domain(ring r) 149 124 { return (r->ringtype == 4 || r->ringtype == 0); } 150 125 151 static inline BOOLEAN rField_has_Units(ring r =currRing)126 static inline BOOLEAN rField_has_Units(ring r) 152 127 { return ((r->ringtype == 1) || (r->ringtype == 2) || (r->ringtype == 3)); } 153 128 #else … … 162 137 163 138 #ifdef HAVE_RINGS 164 static inline BOOLEAN rField_is_Zp(ring r =currRing)139 static inline BOOLEAN rField_is_Zp(ring r) 165 140 { return (r->ringtype == 0) && (r->ch > 1) && (r->parameter==NULL); } 166 141 … … 168 143 { return (r->ringtype == 0) && (r->ch > 1 && r->ch == ABS(p) && r->parameter==NULL); } 169 144 170 static inline BOOLEAN rField_is_Q(ring r =currRing)145 static inline BOOLEAN rField_is_Q(ring r) 171 146 { return (r->ringtype == 0) && (r->ch == 0) && (r->parameter==NULL); } 172 147 173 static inline BOOLEAN rField_is_numeric(ring r =currRing) /* R, long R, long C */148 static inline BOOLEAN rField_is_numeric(ring r) /* R, long R, long C */ 174 149 { return (r->ringtype == 0) && (r->ch == -1); } 175 150 176 static inline BOOLEAN rField_is_R(ring r =currRing)151 static inline BOOLEAN rField_is_R(ring r) 177 152 { 178 153 if (rField_is_numeric(r) && (r->float_len <= (short)SHORT_REAL_LENGTH)) … … 181 156 } 182 157 183 static inline BOOLEAN rField_is_GF(ring r =currRing)158 static inline BOOLEAN rField_is_GF(ring r) 184 159 { return (r->ringtype == 0) && (r->ch > 1) && (r->parameter!=NULL); } 185 160 … … 187 162 { return (r->ringtype == 0) && (r->ch == q); } 188 163 189 static inline BOOLEAN rField_is_Zp_a(ring r =currRing)164 static inline BOOLEAN rField_is_Zp_a(ring r) 190 165 { return (r->ringtype == 0) && (r->ch < -1); } 191 166 … … 193 168 { return (r->ringtype == 0) && (r->ch < -1 ) && (-(r->ch) == ABS(p)); } 194 169 195 static inline BOOLEAN rField_is_Q_a(ring r =currRing)170 static inline BOOLEAN rField_is_Q_a(ring r) 196 171 { return (r->ringtype == 0) && (r->ch == 1); } 197 172 198 static inline BOOLEAN rField_is_long_R(ring r =currRing)173 static inline BOOLEAN rField_is_long_R(ring r) 199 174 { 200 175 if (rField_is_numeric(r) && (r->float_len >(short)SHORT_REAL_LENGTH)) … … 203 178 } 204 179 205 static inline BOOLEAN rField_is_long_C(ring r =currRing)180 static inline BOOLEAN rField_is_long_C(ring r) 206 181 { 207 182 if (rField_is_numeric(r)) … … 210 185 } 211 186 #else 212 static inline BOOLEAN rField_is_Zp(ring r =currRing)187 static inline BOOLEAN rField_is_Zp(ring r) 213 188 { return (r->ch > 1) && (r->parameter==NULL); } 214 189 … … 216 191 { return (r->ch > 1 && r->ch == ABS(p) && r->parameter==NULL); } 217 192 218 static inline BOOLEAN rField_is_Q(ring r =currRing)193 static inline BOOLEAN rField_is_Q(ring r) 219 194 { return (r->ch == 0) && (r->parameter==NULL); } 220 195 221 static inline BOOLEAN rField_is_numeric(ring r =currRing) /* R, long R, long C */196 static inline BOOLEAN rField_is_numeric(ring r) /* R, long R, long C */ 222 197 { return (r->ch == -1); } 223 198 224 static inline BOOLEAN rField_is_R(ring r =currRing)199 static inline BOOLEAN rField_is_R(ring r) 225 200 { 226 201 if (rField_is_numeric(r) && (r->float_len <= (short)SHORT_REAL_LENGTH)) … … 229 204 } 230 205 231 static inline BOOLEAN rField_is_GF(ring r =currRing)206 static inline BOOLEAN rField_is_GF(ring r) 232 207 { return (r->ch > 1) && (r->parameter!=NULL); } 233 208 … … 235 210 { return (r->ch == q); } 236 211 237 static inline BOOLEAN rField_is_Zp_a(ring r =currRing)212 static inline BOOLEAN rField_is_Zp_a(ring r) 238 213 { return (r->ch < -1); } 239 214 … … 241 216 { return (r->ch < -1 ) && (-(r->ch) == ABS(p)); } 242 217 243 static inline BOOLEAN rField_is_Q_a(ring r =currRing)218 static inline BOOLEAN rField_is_Q_a(ring r) 244 219 { return (r->ch == 1); } 245 220 246 static inline BOOLEAN rField_is_long_R(ring r =currRing)221 static inline BOOLEAN rField_is_long_R(ring r) 247 222 { 248 223 if (rField_is_numeric(r) && (r->float_len >(short)SHORT_REAL_LENGTH)) … … 251 226 } 252 227 253 static inline BOOLEAN rField_is_long_C(ring r =currRing)228 static inline BOOLEAN rField_is_long_C(ring r) 254 229 { 255 230 if (rField_is_numeric(r)) … … 259 234 #endif 260 235 261 static inline BOOLEAN rField_has_simple_inverse(ring r =currRing)236 static inline BOOLEAN rField_has_simple_inverse(ring r) 262 237 /* { return (r->ch>1) || (r->ch== -1); } *//* Z/p, GF(p,n), R, long_R, long_C*/ 263 238 #ifdef HAVE_RINGS … … 267 242 #endif 268 243 269 static inline BOOLEAN rField_has_simple_Alloc(ring r =currRing)244 static inline BOOLEAN rField_has_simple_Alloc(ring r) 270 245 { return (rField_is_Zp(r) 271 246 || rField_is_GF(r) … … 276 251 277 252 /* Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies*/ 278 static inline BOOLEAN rField_is_Extension(ring r =currRing)253 static inline BOOLEAN rField_is_Extension(ring r) 279 254 { return (rField_is_Q_a(r)) || (rField_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/ 280 255 … … 385 360 386 361 // return TRUE if p->exp[r->pOrdIndex] holds total degree of p */ 387 //inline BOOLEAN rHasGlobalOrdering(const ring r =currRing)362 //inline BOOLEAN rHasGlobalOrdering(const ring r) 388 363 //{ return (r->OrdSgn==1); } 389 364 #define rHasGlobalOrdering(R) ((R)->OrdSgn==1) 390 365 #define rHasGlobalOrdering_currRing() (pOrdSgn==1) 391 //inline BOOLEAN rHasLocalOrMixedOrdering(const ring r =currRing)366 //inline BOOLEAN rHasLocalOrMixedOrdering(const ring r) 392 367 //{ return (r->OrdSgn==-1); } 393 368 #define rHasLocalOrMixedOrdering(R) ((R)->OrdSgn==-1) 394 369 #define rHasLocalOrMixedOrdering_currRing() (pOrdSgn==-1) 395 BOOLEAN rOrd_is_Totaldegree_Ordering(ring r =currRing);370 BOOLEAN rOrd_is_Totaldegree_Ordering(ring r ); 396 371 397 372 /// return TRUE if p_SetComp requires p_Setm -
polys/pDebug.cc
ra23b21 rec96d7 23 23 // #define PDEBUG 2 24 24 25 #include "p_polys.h"25 //#include "p_polys.h" 26 26 #include <output.h> 27 27 #include <omalloc.h> 28 #include " ring.h"28 #include "monomials/ring.h" 29 29 #include <coeffs.h> 30 30 … … 346 346 #endif // PDEBUG 347 347 348 #include <kernel/pInline1.h>349 350 348 #if defined(PDEBUG) || defined(PDIV_DEBUG) 351 349 static unsigned long pDivisibleBy_number = 1; -
polys/pInline0.cc
ra23b21 rec96d7 11 11 #ifndef PINLINE0_CC 12 12 13 #include <kernel/mod2.h>13 #include "config.h" 14 14 15 15 #define PINLINE0_CC
Note: See TracChangeset
for help on using the changeset viewer.