Changeset 35d0d1a in git
- Timestamp:
- Feb 9, 2009, 3:24:08 PM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 2c6535a8648691161a07a546e5c73a0b41b9ac06
- Parents:
- fcb80223d452f79f3b3e1a62b71d291a5fc64943
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
rfcb8022 r35d0d1a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.cc,v 1.2 4 2009-02-08 19:17:54ederc Exp $ */4 /* $Id: f5gb.cc,v 1.25 2009-02-09 14:24:08 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 26 26 27 27 int reductionsToZero = 0; 28 //*reductionsToZero = 0;29 28 30 29 /* … … 180 179 bool criterion1(poly* t, LNode* l, LTagList* lTag) { 181 180 // starts at the first element in gPrev with index = (index of l)-1, these tags are saved in lTag 182 183 181 LNode* testNode = lTag->get(l->getIndex()); 182 // save the monom t1*label_term(l) as it is tested various times in the following 184 183 poly u1 = ppMult_qq(*t,l->getTerm()); 185 184 while(NULL != testNode) { … … 188 187 return true; 189 188 } 190 testNode = testNode->getNext(); 191 } 189 //pWrite(testNode->getNext()->getPoly()); 190 testNode = testNode->getNext(); 191 } 192 Print("HIER DRIN CRITERION 1\n"); 193 192 194 return false; 193 195 } … … 201 203 */ 202 204 bool criterion2(poly* t, LNode* l, RTagList* rTag) { 205 Print("HIER DRIN CRITERION 2:=========================\n"); 203 206 // start at the previously added element to gPrev, as all other elements will have the same index for sure 204 RNode* testNode = rTag->get(l->getIndex()); 205 // save the monom t1*label_term(l) as it is tested various times in the following 207 RNode* testNode = rTag->get(l->getIndex()); 208 Print("ADDRESS TEST NODE: %p\n", testNode); 209 // save the monom t1*label_term(l) as it is tested various times in the following 206 210 poly u1 = ppMult_qq(*t,l->getTerm()); 211 Print("Poly u1: "); 212 pWrite(u1); 207 213 // first element added to rTag was NULL, check for this 208 while(NULL != testNode && testNode->getRule()->getOrigin() != l->getLPoly()) { 209 if(pLmDivisibleByNoComp(ppMult_qq(*t,l->getTerm()),testNode->getRuleTerm())) { 214 while(NULL != testNode && NULL != testNode->getRule() && testNode->getRule()->getOrigin() != l->getLPoly()) { 215 Print("----------------------------------------------------------------------------------------------------------------------------------------------------\n"); 216 pWrite(ppMult_qq(*t,l->getTerm())); 217 pWrite(testNode->getRuleTerm()); 218 if(pLmDivisibleBy(ppMult_qq(*t,l->getTerm()),testNode->getRuleTerm())) { 210 219 Print("Criterion 2 NOT passed!\n"); 211 220 return true; 212 221 } 213 testNode = testNode->getNext(); 222 Print("HIER AUCH DRIN?\n"); 223 Print("TEST NODE ADDRESS: %p\n",testNode->getNext()); 224 Print("TEST NODE LPOLY ADDRESS: %p\n",testNode->getNext()->getRule()); 225 testNode = testNode->getNext(); 214 226 } 215 227 return false; … … 225 237 bool criterion2(poly* t, LPoly* l, RTagList* rTag, Rule* lastRuleTested) { 226 238 // start at the previously added element to gPrev, as all other elements will have the same index for sure 227 239 RNode* testNode = rTag->getFirst(); 228 240 // save the monom t1*label_term(l) as it is tested various times in the following 229 241 poly u1 = ppMult_qq(*t,l->getTerm()); 230 231 while(NULL != testNode&& testNode->getRule() != lastRuleTested) {232 if(pLmDivisibleBy NoComp(ppMult_qq(*t,l->getTerm()),testNode->getRuleTerm())) {242 // first element added to rTag was NULL, check for this 243 while(NULL != testNode && NULL != testNode->getRule() && testNode->getRule() != lastRuleTested) { 244 if(pLmDivisibleBy(testNode->getRuleTerm(),ppMult_qq(*t,l->getTerm()))) { 233 245 Print("Criterion 2 NOT passed!\n"); 234 246 return true; 235 247 } 236 248 testNode = testNode->getNext(); 237 249 } 238 250 return false; … … 272 284 // will never be used again as it is zero => no problems with 273 285 // further criterion2() tests and termination conditions 274 reductionsToZero++; 286 Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 287 reductionsToZero++; 275 288 rules->insert(temp->getLp1Index(),temp->getT1(),NULL); 276 289 rTag->setFirst(rules->getFirst()); … … 298 311 // will never be used again as it is zero => no problems with 299 312 // further criterion2() tests and termination conditions 313 Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 300 314 reductionsToZero++; 301 315 rules->insert(temp->getLp1Index(),temp->getT1(),NULL); … … 346 360 if(0 == pLmCmp(temp->getPoly(),zero)) { 347 361 Print("HIER\n"); 362 Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 348 363 reductionsToZero++; 349 364 // TODO: sPolyList -> delete first element of list as it is zero and done
Note: See TracChangeset
for help on using the changeset viewer.