Changeset f6c6b01 in git


Ignore:
Timestamp:
Apr 2, 2009, 2:59:59 PM (15 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
c4a041219a2ad7d07a655aa5c8e89a483611a985
Parents:
a9fa9287cfb2d0c548c023e5b34bb1397da303b0
Message:
updates in reduction


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

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    ra9fa92 rf6c6b01  
    123123        //}
    124124        // reduction process of new S-polynomials and also adds new critical pairs to critPairs
    125         int timer3  =   initTimer();
    126         startTimer();
     125        //int timer3  =   initTimer();
     126        //startTimer();
    127127        reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev);
    128         timer3      =  getTimer();
    129         reductionTime = reductionTime + timer3;
     128        //timer3      =  getTimer();
     129        //reductionTime = reductionTime + timer3;
    130130        //Print("REDUCTION TIMER: %d\n",timer3);
    131131        // DEBUG STUFF FOR GPREV
     
    619619    // check if sPolyList has any elements
    620620    // NOTE: due to initialization sPolyList always has a default NULL element
    621     LNode* temp;
    622     while(sPolyList->getLength() > 0) {
     621    LNode* temp = sPolyList->getFirst();
     622    while(NULL != temp) {
    623623        // temp is the first element in the sPolyList which should be reduced
    624624        // due to earlier sorting this is the element of minimal degree AND
    625625        // minimal label
    626         temp =   sPolyList->getFirst();
    627626        // delete the above first element from sPolyList, temp will be either reduced to
    628627        // zero or added to gPrev, but never come back to sPolyList
    629         if(NULL != temp) {
    630             sPolyList->setFirst(temp->getNext());
    631         }
    632         else {
    633             break;
    634         }
     628        sPolyList->setFirst(temp->getNext());
    635629        poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly());
    636630        if(NULL != tempNF) {
     
    640634            // with label index = current label index: this is done such that there
    641635            // is no label corruption during the reduction process
    642             topReduction(temp,sPolyList,gPrev,rules,lTag,rTag,gbPrev);
     636            topReduction(temp,sPolyList,gPrev,critPairs,rules,lTag,rTag,gbPrev);
    643637       
    644638        }
    645         if(NULL != temp->getPoly()) {
    646             criticalPair(gPrev,critPairs,lTag,rTag,rules);
    647         }
    648     }
     639        else {
     640            reductionsToZero++;
     641            delete temp;
     642        }
     643        //if(NULL != temp->getPoly()) {
     644        //    criticalPair(gPrev,critPairs,lTag,rTag,rules);
     645        //}
     646        temp =   sPolyList->getFirst();
     647    }
     648    //delete sPolyList;
    649649}   
    650650
     
    657657=====================================================================================
    658658*/
    659 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev) {
     659void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs,  RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev) {
    660660    //Print("##########################################In topREDUCTION!########################################\n");
    661661    // try l as long as there are reductors found by findReductor()
    662     LNode* gPrevRedCheck    =   new LNode(lTag->getFirstCurrentIdx());
    663     LNode* tempRed          =   new LNode();
     662    LNode* gPrevRedCheck    =   lTag->getFirstCurrentIdx();
     663    LNode* tempRed;
     664    poly pOne               =   pOne();
    664665    do {
     666        int timer5  =   initTimer();
     667        startTimer();
    665668        tempRed  =   findReductor(l,gPrevRedCheck,gPrev,rules,lTag,rTag);
     669        timer5  =   getTimer();
     670        reductionTime   =   reductionTime   +   timer5;
    666671        // if a reductor for l is found and saved in tempRed
    667672        if(NULL != tempRed) {
     
    670675            if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) {
    671676                // needed sinc pSub destroys the arguments!
    672                 poly temp_poly_l    =   pInit();
    673                 temp_poly_l         =   pCopy(l->getPoly());
    674                 poly temp           =   pSub(tempRed->getPoly(),temp_poly_l);
     677                //poly temp_poly_l    =   pInit();
     678                //temp_poly_l         =   pCopy(l->getPoly());
     679                //Print("VORHER: ");
     680                //pWrite(tempRed->getPoly());
     681                poly temp           =   pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly());
     682                //Print("NACHHER: ");
     683                //pWrite(tempRed->getPoly());
     684                //Print("TEMP: ");
     685                //pWrite(temp);
    675686                if(NULL != temp) {
    676687                    pNorm(temp);
     
    686697                    pDelete(&temp);
    687698                    reductionsToZero++;
    688                     delete tempRed;
     699                    //delete tempRed;
    689700                }
    690701            }
     
    694705            else {
    695706               
    696                 poly temp_poly_l    =   pInit();
    697                 temp_poly_l         =   pCopy(l->getPoly());
    698                 poly temp   =   pSub(temp_poly_l,tempRed->getPoly());
     707                //poly temp_poly_l    =   pInit();
     708                //temp_poly_l         =   pCopy(l->getPoly());
     709                poly temp   =   pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly());
    699710                if(NULL != temp) {
    700711                    pNorm(temp);
     
    723734                pNorm(l->getPoly());
    724735                gPrev->insert(l->getLPoly());
     736                criticalPair(gPrev,critPairs,lTag,rTag,rules);
    725737            }
    726738            break;
     
    802814    //Print("NUMBER: %d\n",r->N);
    803815   
    804     //int* ev = new int[r->N];
    805     //int  ev2;
    806     //for(i=0;i<IDELEMS(id);i++) {
    807         //pGetExpV(id->m[i],ev);
     816    int* ev = new int[r->N +1];
     817    int  ev2;
     818    for(i=0;i<IDELEMS(id);i++) {
     819        pGetExpV(id->m[i],ev);
    808820        //ev2  =   pGetExp(id->m[i],1);
    809821        //pWrite(id->m[i]);
     
    812824        //Print("EXP2: %d\n",ev[2]);
    813825        //Print("EXP3: %d\n\n",ev[3]);
    814     //}
     826    }
    815827    //delete ev;
    816828   
  • kernel/f5gb.h

    ra9fa92 rf6c6b01  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.h,v 1.33 2009-03-18 13:39:13 ederc Exp $ */
     4/* $Id: f5gb.h,v 1.34 2009-04-02 12:59:59 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    8888=====================================================================================
    8989*/
    90 inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev);
     90inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev);
    9191
    9292/*
Note: See TracChangeset for help on using the changeset viewer.