Changeset 19567b in git


Ignore:
Timestamp:
Mar 31, 2009, 9:36:00 AM (15 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
798f72186f85eaf9224aef1590336c69ccc6a3f9
Parents:
0e61893242df08dedfa5b71b664d0ddac5cc7bd3
Message:
tests for timings


git-svn-id: file:///usr/local/Singular/svn/trunk@11607 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    r0e6189 r19567b  
    109109        // NOTE: inside there is a second check of criterion 2 if new rules are
    110110        // added
    111         int timer4  =   initTimer();
    112         startTimer();
     111        //int timer4  =   initTimer();
     112        //startTimer();
    113113        computeSPols(critPairsMinDeg,rTag,rules,sPolyList);
    114         timer4  =   getTimer();
    115         Print("SPOLS TIMER: %d\n",timer4);
    116         spolsTime  =   spolsTime  +   timer4;
     114        //timer4  =   getTimer();
     115        //Print("SPOLS TIMER: %d\n",timer4);
     116        //spolsTime  =   spolsTime  +   timer4;
    117117        // DEBUG STUFF FOR SPOLYLIST
    118118        LNode* temp     =   sPolyList->getFirst();
     
    128128        timer3      =  getTimer();
    129129        reductionTime = reductionTime + timer3;
    130         Print("REDUCTION TIMER: %d\n",timer3);
     130        //Print("REDUCTION TIMER: %d\n",timer3);
    131131        // DEBUG STUFF FOR GPREV
    132132        //temp    =   gPrev->getFirst();
     
    619619    // check if sPolyList has any elements
    620620    // NOTE: due to initialization sPolyList always has a default NULL element
     621    LNode* temp;
    621622    while(sPolyList->getLength() > 0) {
    622         //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
    623         if(sPolyList->getLength() > 1) {
    624         //Print("%p\n",sPolyList->getFirst());
    625         //Print("%p\n",sPolyList->getFirst()->getLPoly());
    626         //Print("%p\n",sPolyList->getFirst()->getNext());
    627         //Print("%p\n",sPolyList->getFirst()->getNext()->getLPoly());
    628         //Print("%p\n",sPolyList->getFirst());
    629         }
    630         //if(gPrev->getLast()->getIndex() == 5) {
    631             //sPolyList->print();
    632             //sleep(5);
    633         //}
    634        
    635623        // temp is the first element in the sPolyList which should be reduced
    636624        // due to earlier sorting this is the element of minimal degree AND
    637625        // minimal label
    638         LNode* temp =   sPolyList->getFirst();
    639         //pWrite(temp->getPoly());
     626        temp =   sPolyList->getFirst();
    640627        // delete the above first element from sPolyList, temp will be either reduced to
    641628        // zero or added to gPrev, but never come back to sPolyList
    642629        if(NULL != temp) {
    643630            sPolyList->setFirst(temp->getNext());
    644         //Print("HIER\n");
    645631        }
    646632        else {
    647633            break;
    648634        }
    649         //Print("HALLO %p\n",temp->getPoly());
    650         //Print("%p\n",temp->getPoly());
    651         //pWrite(temp->getPoly());
    652         //idShow(gbPrev);
    653635        poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly());
    654         //Print("LENGTH: %d\n",sPolyList->getLength());
    655         //pWrite(tempNF);
    656         //pWrite(temp->getPoly());
    657636        if(NULL != tempNF) {
    658637            pNorm(tempNF);
    659             // write the reduced polynomial in temp
    660638            temp->setPoly(tempNF);
    661639            // try further reductions of temp with polynomials in gPrev
     
    666644        }
    667645        if(NULL != temp->getPoly()) {
    668             //CList* newCritPairs = new CList;
    669             //Print("##################IN CRITPAIRS IN REDUCTION#####################\n");
    670646            criticalPair(gPrev,critPairs,lTag,rTag,rules);
    671             //Print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++H I E R++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
    672         }
    673         else {
    674             //delete temp;
    675             LNode* tempLoop = gPrev->getFirst();
    676             //Print("AUSGABE IN REDUCTION:\n");       
    677             //while(NULL != tempLoop) {
    678                 //pWrite(tempLoop->getPoly());
    679                 //tempLoop = tempLoop->getNext();
    680             //}
    681             //sleep(10);
    682         }
    683        
     647        }
    684648    }
    685649}   
     
    698662    do {
    699663        LNode* gPrevRedCheck    =   new LNode(lTag->getFirstCurrentIdx());
    700         //Print("gPrevCheckPOLY: ");
    701         //pWrite(gPrevRedCheck->getPoly());
    702664        LNode* tempRed          =   new LNode();
    703         //Print("TESTED POLYNOMIAL IN THE FOLLOWING: ");
    704         //pWrite(l->getPoly());
    705         //Print("HIER\n");
    706665        tempRed  =   findReductor(l,gPrevRedCheck,gPrev,rules,lTag,rTag);
    707         //Print("TEMPRED NEXT: %p\n",tempRed->getNext());
    708         //Print("--------------------------------HIER DEBUG 2----------------------------------\n");
    709666        // if a reductor for l is found and saved in tempRed
    710667        if(NULL != tempRed) {
    711668            // if label of reductor is greater than the label of l we have to built a new element
    712669            // and add it to sPolyList
    713             //Print("REDUCTOR POLYNOMIAL: ");
    714             //pWrite(tempRed->getPoly());
    715             //Print("TEMPRED: %p\n",tempRed);
    716             //Print("TERM: ");
    717             //pWrite(tempRed->getTerm());
    718670            if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) {
    719671                // needed sinc pSub destroys the arguments!
    720                 //Print("H----------I------------E--------------R\n");
    721672                poly temp_poly_l    =   pInit();
    722673                temp_poly_l         =   pCopy(l->getPoly());
    723                 //Print("POLYNOMIAL L: ");
    724                 //pWrite(l->getPoly());
    725                 //pWrite(temp_poly_l);
    726674                poly temp           =   pSub(tempRed->getPoly(),temp_poly_l);
    727                 //Print("POLYNOMIAL L: ");
    728                 //pWrite(l->getPoly());
    729                 //pWrite(temp_poly_l);
    730                 //Print("AFTER REDUCTION STEP: ");
    731                 //pWrite(temp);
    732                 //sleep(20);
    733                 //pWrite(temp);
    734675                if(NULL != temp) {
    735676                    pNorm(temp);
    736677                    tempRed->setPoly(temp);
    737678                    tempRed->setDel(1);
    738                     // for debugging
    739                     //pWrite(tempRed->getPoly());
    740                     //Print("RULE ADDED\n");
    741679                    rules->insert(tempRed->getIndex(),tempRed->getTerm());
    742680                    tempRed->getLPoly()->setRule(rules->getFirst()->getRule());
    743                     //Print("%p\n",sPolyList->getFirst());
    744                     //Print("%p\n",sPolyList->getFirst()->getLPoly());
    745                     //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
    746                     //sPolyList->print();
    747                    
    748681                    sPolyList->insertByLabel(tempRed);
    749                     //sPolyList->print();
    750                     //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
    751                     //Print("OH JE\n");
    752682                }
    753683                else {
    754684                    pDelete(&temp);
    755685                    reductionsToZero++;
    756                     //Print("RULE ADDED\n");
    757                     //rules->insert(tempRed->getIndex(),tempRed->getTerm());
    758                     //pWrite(rules->getFirst()->getRuleTerm());
    759                     //Print("DELETE TEMPRED\n");
    760686                    delete tempRed;
    761687                }
     
    765691            // after subtraction
    766692            else {
     693               
    767694                poly temp_poly_l    =   pInit();
    768695                temp_poly_l         =   pCopy(l->getPoly());
    769696                poly temp   =   pSub(temp_poly_l,tempRed->getPoly());
    770                 //Print("AFTER REDUCTION STEP: ");
    771                 //pWrite(temp);
    772697                if(NULL != temp) {
    773698                    pNorm(temp);
    774699                    poly tempNF =   kNF(gbPrev,currQuotient,temp); 
    775700                    pNorm(tempNF);
    776                     //pWrite(tempNF);
    777701                    if(NULL == tempNF) {
    778702                        reductionsToZero++;
     
    783707                    l->setPoly(tempNF);
    784708                   
    785                     //pWrite(l->getPoly());
    786709                    gPrevRedCheck   =   lTag->getFirstCurrentIdx();
    787710                }
    788711                else {
    789                     //Print("ZERO REDUCTION!\n");
    790712                    reductionsToZero++;
    791713                    pDelete(&temp);
    792714                    l->setPoly(NULL);
    793                     //pWrite(gPrev->getLast()->getPoly());
    794715                    break;
    795716                }
     
    799720            if(NULL != l->getPoly()) {
    800721                pNorm(l->getPoly());
    801                 //Print("----------------------------------ADDED TO GPREV IN TOPREDUCTION:-------------------------------------- ");
    802                 //pWrite(l->getPoly());
    803                 //pWrite(l->getTerm());
    804                 //Print("INDEX: %d\n\n\n", l->getIndex());
    805                 //sleep(20);
    806722                gPrev->insert(l->getLPoly());
    807                 //Print("GPREV: \n");
    808                 LNode* tempLoop = gPrev->getFirst();
    809                 //while(NULL != tempLoop) {
    810                     //Print("HERE\n");
    811                     //pWrite(tempLoop->getPoly());
    812                     //tempLoop = tempLoop->getNext();
    813                 //}
    814723            }
    815724            break;
     
    826735LNode* findReductor(LNode* l, LNode* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag) {
    827736    // allociation of memory for the possible reductor
    828     //Print("IN FIND REDUCTOR\n");
    829737    poly u      =   pOne();
    830738    poly red    =   pOne();
     
    837745    // not from the first element of gPrev with the current index
    838746    temp    =   gPrevRedCheck;
    839     //temp    =   lTag->getFirstCurrentIdx(); 
    840     //Print("GPREVREDCHECK: %p\n",gPrevRedCheck);
    841     //pWrite(gPrevRedCheck->getPoly());
    842747    // search for reductors until we are at the end of gPrev resp. at the
    843748    // end of the elements of the current index
    844749    while(NULL != temp && temp->getIndex() == l->getIndex()) {
    845         //pWrite(temp->getPoly());
    846         //Print("INDEX: %d\n",temp->getIndex());
    847750        // does the head of the element of gPrev divides the head of
    848751        // the to be reduced element?
    849         //Print("-------------FOUND REDUCTORS----------------------\n");
    850         //Print("\n");
    851         //pWrite(temp->getPoly());
    852         //pWrite(temp->getTerm());
    853         //pWrite(t);
    854         //Print("HALLO\n");
    855752        if(pLmDivisibleByNoComp(pHead(temp->getPoly()),t)) {
    856         //Print("HALLO\n");
    857753            // get all the information needed for the following tests
    858754            // of the criteria
    859755            u   =   pDivide(t,pHead(temp->getPoly()));
    860756            pSetCoeff(u,nOne);
    861             //Print("HIER FINDRED\n");
    862             //pWrite(u);
    863             //Print("\n");
    864757            red =   ppMult_qq(u,temp->getPoly());
    865758            pNorm(red);
    866             //u   =   ppMult_qq(u,temp->getTerm());
    867             //pSetCoeff(u,nOne);
    868759            // check if both have the same label
    869         //Print("HALLO\n");
    870760            if(pLmCmp(u,l->getTerm()) != 0) {
    871         //Print("HALLO\n");
    872761                // passing criterion2 ?
    873762                if(!criterion2(gPrev->getFirst()->getIndex(), u,temp,rules,rTag)) {
    874763                    // passing criterion1 ?
    875764                    if(!criterion1(gPrev,u,temp,lTag)) {
    876                             //Print("HIER DEBUG\n");
    877765                            gPrevRedCheck   =   temp->getNext();
    878766                            LNode* redNode  =   new LNode(ppMult_qq(u,temp->getTerm()),temp->getIndex(),red,NULL,NULL);
     
    882770            }
    883771        }
    884         //Print("%p\n",temp->getNext());
    885         //pWrite(temp->getPoly());
    886         //Print("HALLO\n");
    887772        temp = temp->getNext();
    888773    }
    889774   
    890775//    delete temp;
    891    //Print("1st gPrev: ");
    892     //pWrite(gPrev->getFirst()->getPoly());
    893     //Print("2nd gPrev: ");
    894     //pWrite(gPrev->getFirst()->getNext()->getPoly());
    895776 return NULL;
    896777}
     
    1093974    timer   =   getTimer();
    1094975    Print("Highest Degree during computations: %d\n",highestDegree);
    1095     Print("Time for computations: %d/1000 seconds\n",timer);
     976    Print("Time for computations: %d/10000 seconds\n",timer);
    1096977    //LNode* temp    =   gPrev->getFirst();
    1097978    //while(NULL != temp) {
Note: See TracChangeset for help on using the changeset viewer.