Changeset 8066e80 in git for kernel


Ignore:
Timestamp:
Feb 27, 2009, 11:22:30 PM (15 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ab1c364e790c486830be3f3070fa8f106c67d182
Parents:
0ffc8230cf8843aba541f656189c14bc57b1700f
Message:
deleted bugs in reduction(), mostly label stuff


git-svn-id: file:///usr/local/Singular/svn/trunk@11496 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    r0ffc823 r8066e80  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.cc,v 1.34 2009-02-26 09:01:52 ederc Exp $ */
     4/* $Id: f5gb.cc,v 1.35 2009-02-27 22:22:30 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    106106        // DEBUG STUFF FOR SPOLYLIST
    107107        LNode* temp     =   sPolyList->getFirst();
    108         while(NULL != temp && NULL != temp->getLPoly()) {
     108        //while(NULL != temp && NULL != temp->getLPoly()) {
    109109            //Print("Spolylist element: ");
    110110            //pWrite(temp->getPoly());
    111             temp    =   temp->getNext();
    112         }
     111            //temp    =   temp->getNext();
     112        //}
    113113        // reduction process of new S-polynomials and also adds new critical pairs to critPairs
    114114        reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev);
     
    186186        pSetCoeff(u2,nOne);
    187187        //if(gPrev->getLast()->getIndex()==5) {
    188         //    Print("IN CRITPAIRS\n");
     188            //Print("IN CRITPAIRS\n");
    189189        //    pWrite(u1);
    190190        //    Print("1st ELEMENT: ");
     
    219219    }
    220220    // for debugging
    221     if(NULL != critPairs && gPrev->getLast()->getIndex() == 4) {
     221    //if(NULL != critPairs) {
    222222        //critPairs->print();
    223223        //sleep(5);
    224     }
     224    //}
    225225}
    226226
     
    246246        //Print("TESTED ELEMENT: ");
    247247        //pWrite(l->getPoly());
     248        //pWrite(l->getTerm());
    248249        //pWrite(ppMult_qq(t,l->getTerm()));
    249250        //Print("%d\n\n",l->getIndex());
     
    280281            tempR   =   tempR->getNext();
    281282        }
    282 //Print("TESTED ELEMENT: ");
     283        //Print("TESTED ELEMENT: ");
    283284        //pWrite(l->getPoly());
     285        //pWrite(l->getTerm());
    284286        //pWrite(ppMult_qq(t,l->getTerm()));
    285287        //Print("%d\n\n",l->getIndex());
     
    348350    //Print("RULES: \n");
    349351        RNode* tempR    =   rules->getFirst();
    350         while(NULL != tempR->getRule()) {
     352        //while(NULL != tempR->getRule()) {
    351353            //pWrite(tempR->getRuleTerm());
    352354            //Print("%d\n\n",tempR->getRuleIndex());
    353             tempR   =   tempR->getNext();
    354         }
     355            //tempR   =   tempR->getNext();
     356        //}
    355357        //Print("TESTED ELEMENT: ");
    356358        //pWrite(l->getPoly());
     359        //pWrite(l->getTerm());
    357360        //pWrite(ppMult_qq(t,l->getTerm()));
    358361        //Print("%d\n\n",l->getIndex());
     
    421424                            //Print("RULE ADDED: \n");
    422425                            //pWrite(rules->getFirst()->getRuleTerm()); 
    423                             sPolyList->insertSP(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRule());
     426                            sPolyList->insertByLabel(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRule());
    424427                        }
    425428                        // data is saved in sPolyList or zero => delete sp
     
    528531            //Print("##################IN CRITPAIRS IN REDUCTION#####################\n");
    529532            criticalPair(gPrev,critPairs,lTag,rTag,rules);
     533            //Print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++H I E R++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
    530534        }
    531535        else {
     
    533537            LNode* tempLoop = gPrev->getFirst();
    534538            //Print("AUSGABE IN REDUCTION:\n");       
    535             while(NULL != tempLoop) {
     539            //while(NULL != tempLoop) {
    536540                //pWrite(tempLoop->getPoly());
    537                 tempLoop = tempLoop->getNext();
    538             }
     541                //tempLoop = tempLoop->getNext();
     542            //}
    539543            //sleep(10);
    540544        }
     
    555559    do {
    556560        LNode* tempRed  =   new LNode();
    557         Print("TESTED POLYNOMIAL IN THE FOLLOWING: ");
    558         pWrite(l->getPoly());
     561        //Print("TESTED POLYNOMIAL IN THE FOLLOWING: ");
     562        //pWrite(l->getPoly());
    559563        tempRed  =   findReductor(l,gPrev,rules,lTag,rTag);
    560564        //Print("--------------------------------HIER DEBUG 2----------------------------------\n");
     
    563567            // if label of reductor is greater than the label of l we have to built a new element
    564568            // and add it to sPolyList
    565             Print("REDUCTOR POLYNOMIAL: ");
    566             pWrite(tempRed->getPoly());
    567             Print("TERM: ");
    568             pWrite(tempRed->getTerm());
     569            //Print("REDUCTOR POLYNOMIAL: ");
     570            //pWrite(tempRed->getPoly());
     571            //Print("TERM: ");
     572            //pWrite(tempRed->getTerm());
    569573            if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) {
    570574                // needed sinc pSub destroys the arguments!
     575                //Print("H----------I------------E--------------R\n");
    571576                poly temp_poly_l    =   pInit();
    572577                temp_poly_l         =   pCopy(l->getPoly());
     
    594599                    //Print("%p\n",sPolyList->getFirst()->getLPoly());
    595600                    //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
     601                    //sPolyList->print();
     602                   
    596603                    sPolyList->insertByLabel(tempRed);
    597                 //Print("OH JE\n");
     604                    //sPolyList->print();
     605                    //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
     606                    //Print("OH JE\n");
    598607                }
    599608                else {
     
    635644            if(NULL != l->getPoly()) {
    636645                pNorm(l->getPoly());
    637                 Print("----------------------------------ADDED TO GPREV IN TOPREDUCTION:-------------------------------------- ");
    638                 pWrite(l->getPoly());
    639                 pWrite(l->getTerm());
    640                 Print("INDEX: %d\n\n\n", l->getIndex());
    641                
     646                //Print("----------------------------------ADDED TO GPREV IN TOPREDUCTION:-------------------------------------- ");
     647                //pWrite(l->getPoly());
     648                //pWrite(l->getTerm());
     649                //Print("INDEX: %d\n\n\n", l->getIndex());
     650                //sleep(20);
    642651                gPrev->insert(l->getLPoly());
    643652                //Print("GPREV: \n");
    644653                LNode* tempLoop = gPrev->getFirst();
    645                 while(NULL != tempLoop) {
     654                //while(NULL != tempLoop) {
    646655                    //Print("HERE\n");
    647656                    //pWrite(tempLoop->getPoly());
    648                     tempLoop = tempLoop->getNext();
    649                 }
     657                    //tempLoop = tempLoop->getNext();
     658                //}
    650659            }
    651660            break;
     
    685694        // does the head of the element of gPrev divides the head of
    686695        // the to be reduced element?
    687         //Print("-------------FOUND REDUCTORS----------------------\n");
    688         //Print("\n");
    689         //pWrite(temp->getPoly());
    690         //pWrite(temp->getTerm());
     696        Print("-------------FOUND REDUCTORS----------------------\n");
     697        Print("\n");
     698        pWrite(temp->getPoly());
     699        pWrite(temp->getTerm());
     700        pWrite(t);
     701        Print("HALLO\n");
    691702        if(pLmDivisibleByNoComp(temp->getPoly(),t)) {
     703        Print("HALLO\n");
    692704            // get all the information needed for the following tests
    693705            // of the criteria
    694706            u   =   pDivide(t,pHead(temp->getPoly()));
    695707            pSetCoeff(u,nOne);
    696             //pWrite(u);
    697             //Print("\n");
     708            pWrite(u);
     709            Print("\n");
    698710            red =   ppMult_qq(u,temp->getPoly());
    699711            pNorm(red);
     
    701713            //pSetCoeff(u,nOne);
    702714            // check if both have the same label
     715        Print("HALLO\n");
    703716            if(pLmCmp(u,l->getTerm()) != 0) {
     717        Print("HALLO\n");
    704718                // passing criterion2 ?
    705719                if(!criterion2(u,temp,rules,rTag)) {
     
    708722                            //Print("HIER DEBUG\n");
    709723                            l->setGPrevRedCheck(temp);
    710                             LNode* redNode  =   new LNode(u,temp->getIndex(),red,NULL,NULL);
     724                            LNode* redNode  =   new LNode(ppMult_qq(u,temp->getTerm()),temp->getIndex(),red,NULL,NULL);
    711725                            return redNode;
    712726                    }
     
    714728            }
    715729        }
     730        Print("%p\n",temp->getNext());
     731        pWrite(temp->getPoly());
     732        Print("HALLO\n");
    716733        temp = temp->getNext();
    717734    }
  • kernel/f5lists.cc

    r0ffc823 r8066e80  
    9191LNode* LNode::insertSP(LPoly* lp) {
    9292    LNode* newElement   =   new LNode(lp, this);
     93    Print("INSERTED IN SPOLYLIST: ");
     94    pWrite(lp->getTerm());
    9395    return newElement;
    9496}
     
    9698LNode* LNode::insertSP(poly t, int i, poly p, Rule* r) {
    9799    LNode* newElement   =   new LNode(t, i, p, r, NULL, this);
    98     return newElement;
     100     Print("INSERTED IN SPOLYLIST: ");
     101    pWrite(t);
     102return newElement;
    99103}
    100104// insert new elemets to the list w.r.t. increasing labels
    101105// only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
    102106LNode* LNode::insertByLabel(poly t, int i, poly p, Rule* r) {
    103     if(NULL == this || NULL == data) {
    104         LNode* newElement   =   new LNode(t, i, p, r, this);
     107    Print("ADDING SOLYS TO THE LIST\n");
     108    Print("new element: ");
     109    pWrite(t);
     110       if(NULL == this || NULL == data) {
     111        LNode* newElement   =   new LNode(t, i, p, r, NULL, this);
    105112        return newElement;
    106113    }
    107114    else {
     115         Print("tested element1: ");
     116    pWrite(this->getTerm());
    108117        if(-1 == pLmCmp(t,this->getTerm())) {
    109             LNode* newElement   =   new LNode(t, i, p, r, this);
     118            Print("HIERDRIN\n");
     119            LNode* newElement   =   new LNode(t, i, p, r, NULL, this);
     120            Print("%p\n",this);
     121            Print("%p\n",newElement->next);
    110122            return newElement;
    111123        }
     
    113125            LNode* temp = this;
    114126            while(NULL != temp->next && NULL != temp->next->data) {
    115                 if(-1 == pLmCmp(t,temp->next->getTerm())) {
    116                     LNode* newElement   =   new LNode(t, i, p, r, temp->next);
     127                Print("tested element: ");
     128                pWrite(temp->getTerm());
     129 if(-1 == pLmCmp(t,temp->next->getTerm())) {
     130                    LNode* newElement   =   new LNode(t, i, p, r, NULL, temp->next);
    117131                    temp->next          =   newElement;
    118132                    return this;
     
    127141            }
    128142        //Print("HIER\n");
    129             LNode* newElement   =   new LNode(t, i, p, r, temp->next);
     143            LNode* newElement   =   new LNode(t, i, p, r, NULL, temp->next);
    130144            temp->next          =   newElement;
    131145            return this;
     
    214228    Print("%p\n",this);
    215229    while(NULL != temp && NULL != temp->data) {
    216         Print("HIER\n");
    217230        Print("Index: %d\n",temp->getIndex());
    218231        Print("Term: ");
     
    220233        Print("Poly: ");
    221234        pWrite(temp->getPoly());
    222         Print("\n");
     235        Print("%p\n",temp->next);
    223236        temp = temp->next;
    224237    }
     238    Print("_______________________________________________________________\n");
    225239}
    226240
Note: See TracChangeset for help on using the changeset viewer.