Changeset 512a2b in git for Singular/pInline1.h
- Timestamp:
- Sep 18, 2000, 11:19:39 AM (24 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- d1655e92ca71fb37d1b57af88efdff5b65b8988b
- Parents:
- f3398d316400fe1ee1677fc397cacb80566ac664
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/pInline1.h
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline1.h,v 1. 2 2000-09-14 13:04:38obachman Exp $9 * Version: $Id: pInline1.h,v 1.3 2000-09-18 09:19:24 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE1_H … … 13 13 14 14 #ifndef PDIV_DEBUG 15 // define to enable debugging/statistics of p ShortDivisibleBy15 // define to enable debugging/statistics of pLmShortDivisibleBy 16 16 #undef PDIV_DEBUG 17 17 #endif … … 43 43 44 44 #ifdef PDIV_DEBUG 45 BOOLEAN pDebug ShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,45 BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, 46 46 poly p2, unsigned long not_sev_2, ring r_2); 47 47 #endif … … 51 51 #include "omalloc.h" 52 52 #include "numbers.h" 53 #include "p olys.h"53 #include "p_polys.h" 54 54 #include "p_MemAdd.h" 55 55 #include "p_MemCopy.h" … … 68 68 return p; 69 69 } 70 PINLINE1 poly p_ Init(poly p, ring r)70 PINLINE1 poly p_LmInit(poly p, ring r) 71 71 { 72 72 p_CheckPolyRing1(p, r); 73 73 poly np; 74 74 omTypeAllocBin(poly, np, r->PolyBin); 75 p_SetRingOfPoly(np, r); 75 76 p_ExpVectorCopy(np, p, r); 76 77 _pNext(np) = NULL; … … 78 79 return np; 79 80 } 80 PINLINE1 poly pInit()81 {82 return p_Init(currRing);83 }84 PINLINE1 poly pInit(poly p)85 {86 return p_Init(p, currRing);87 }88 81 PINLINE1 poly p_Head(poly p, ring r) 89 82 { … … 92 85 poly np; 93 86 omTypeAllocBin(poly, np, r->PolyBin); 87 p_SetRingOfPoly(np, r); 94 88 p_ExpVectorCopy(np, p, r); 95 89 _pNext(np) = NULL; 96 _pSetCoeff0(np, p_nCopy(_pGetCoeff(p), r));90 _pSetCoeff0(np, n_Copy(_pGetCoeff(p), r)); 97 91 return np; 98 92 } … … 231 225 } 232 226 233 PINLINE1 BOOLEAN p_LmEqual(poly p, poly q, ring r)234 {235 p_CheckPolyRing1(p, r);236 p_CheckPolyRing1(q, r);237 int i = r->ExpLSize;238 unsigned long *ep = p->exp;239 unsigned long *eq = q->exp;240 241 do242 {243 i--;244 if (ep[i] != eq[i]) return FALSE;245 }246 while (i);247 return p_nEqual(pGetCoeff(p), pGetCoeff(q), r);248 }249 227 250 228 /*************************************************************** … … 253 231 * 254 232 ***************************************************************/ 255 static inline BOOLEAN _p_ DivisibleBy2(poly a, poly b, ring r)233 static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, poly b, ring r) 256 234 { 257 235 int i=r->N; … … 266 244 return TRUE; 267 245 } 268 static inline BOOLEAN _p_ DivisibleBy2(poly a, ring r_a, poly b, ring r_b)246 static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, ring r_a, poly b, ring r_b) 269 247 { 270 248 int i=r_a->N; … … 280 258 return TRUE; 281 259 } 282 static inline BOOLEAN _p_ DivisibleBy1(poly a, poly b, ring r)260 static inline BOOLEAN _p_LmDivisibleBy(poly a, poly b, ring r) 283 261 { 284 262 if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r)) 285 return _p_ DivisibleBy2(a, b, r);263 return _p_LmDivisibleByNoComp(a, b, r); 286 264 return FALSE; 287 265 } 288 static inline BOOLEAN _p_ DivisibleBy1(poly a, ring r_a, poly b, ring r_b)266 static inline BOOLEAN _p_LmDivisibleBy(poly a, ring r_a, poly b, ring r_b) 289 267 { 290 268 if (p_GetComp(a, r_a) == 0 || p_GetComp(a,r_a) == p_GetComp(b,r_b)) 291 return _p_ DivisibleBy2(a, r_a, b, r_b);269 return _p_LmDivisibleByNoComp(a, r_a, b, r_b); 292 270 return FALSE; 293 271 } 294 295 PINLINE1 BOOLEAN p_DivisibleBy2(poly a, poly b, ring r) 272 PINLINE1 BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, ring r) 296 273 { 297 274 p_CheckPolyRing1(a, r); 298 275 p_CheckPolyRing1(b, r); 299 return _p_ DivisibleBy2(a, b, r);300 } 301 PINLINE1 BOOLEAN p_ DivisibleBy1(poly a, poly b, ring r)276 return _p_LmDivisibleByNoComp(a, b, r); 277 } 278 PINLINE1 BOOLEAN p_LmDivisibleBy(poly a, poly b, ring r) 302 279 { 303 280 p_CheckPolyRing1(b, r); 304 281 pIfThen1(a != NULL, p_CheckPolyRing1(b, r)); 305 282 if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r)) 306 return _p_ DivisibleBy2(a, b, r);283 return _p_LmDivisibleByNoComp(a, b, r); 307 284 return FALSE; 308 285 } 309 286 PINLINE1 BOOLEAN p_DivisibleBy(poly a, poly b, ring r) 310 287 { 311 p _CheckPolyRing1(b, r);288 pIfThen1(b!=NULL, p_CheckPolyRing1(b, r)); 312 289 pIfThen1(a!=NULL, p_CheckPolyRing1(a, r)); 313 290 314 291 if (a != NULL && (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))) 315 return _p_ DivisibleBy2(a,b,r);292 return _p_LmDivisibleByNoComp(a,b,r); 316 293 return FALSE; 317 294 } 318 319 PINLINE1 BOOLEAN p_ShortDivisibleBy(poly a, unsigned long sev_a, 295 PINLINE1 BOOLEAN p_LmDivisibleBy(poly a, ring r_a, poly b, ring r_b) 296 { 297 p_CheckPolyRing(a, r_a); 298 p_CheckPolyRing(b, r_b); 299 return _p_LmDivisibleBy(a, r_a, b, r_b); 300 } 301 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, 320 302 poly b, unsigned long not_sev_b, ring r) 321 303 { … … 328 310 if (sev_a & not_sev_b) 329 311 { 330 pAssume1(p_ DivisibleBy2(a, b, r) == FALSE);312 pAssume1(p_LmDivisibleByNoComp(a, b, r) == FALSE); 331 313 return FALSE; 332 314 } 333 return p_ DivisibleBy1(a, b, r);315 return p_LmDivisibleBy(a, b, r); 334 316 #else 335 return pDebug ShortDivisibleBy(a, sev_a, r, b, not_sev_b, r);336 #endif 337 } 338 339 PINLINE1 BOOLEAN p_ ShortDivisibleBy(poly a, unsigned long sev_a, ring r_a,317 return pDebugLmShortDivisibleBy(a, sev_a, r, b, not_sev_b, r); 318 #endif 319 } 320 321 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, ring r_a, 340 322 poly b, unsigned long not_sev_b, ring r_b) 341 323 { … … 348 330 if (sev_a & not_sev_b) 349 331 { 350 pAssume1(_p_ DivisibleBy2(a, r_a, b, r_b) == FALSE);332 pAssume1(_p_LmDivisibleByNoComp(a, r_a, b, r_b) == FALSE); 351 333 return FALSE; 352 334 } 353 return _p_ DivisibleBy1(a, r_a, b, r_b);335 return _p_LmDivisibleBy(a, r_a, b, r_b); 354 336 #else 355 return pDebug ShortDivisibleBy(a, sev_a, r_a, b, not_sev_b, r_b);337 return pDebugLmShortDivisibleBy(a, sev_a, r_a, b, not_sev_b, r_b); 356 338 #endif 357 339 }
Note: See TracChangeset
for help on using the changeset viewer.