Changeset 7c81165 in git


Ignore:
Timestamp:
Mar 12, 2009, 10:43:53 AM (15 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
75e2e50e5ba0dbb6681ecbf8664330997a24b5e9
Parents:
47ca23dae2b0131537f61842055e75beb7836f77
Message:
updated list of critical pairs, thrown away some useless data


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

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    r47ca23 r7c81165  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.cc,v 1.42 2009-03-09 14:51:42 ederc Exp $ */
     4/* $Id: f5gb.cc,v 1.43 2009-03-12 09:43:53 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    9696    static LList* reducedLPolys     =   new LList();
    9797    // while there are critical pairs to be further checked and deleted/computed
    98     while(NULL != critPairs->getFirst()->getData()) {
     98    while(NULL != critPairs->getFirst()) {
    9999        // critPairs->getMinDeg() deletes the first elements of minimal degree from
    100100        // critPairs, thus the while loop is not infinite.
     
    105105        // added
    106106        computeSPols(critPairsMinDeg,rTag,rules,sPolyList);
    107        
     107        //Print("HIER2\n");
    108108        // DEBUG STUFF FOR SPOLYLIST
    109109        LNode* temp     =   sPolyList->getFirst();
     
    180180    Rule* testedRule    =   rules->getFirst()->getRule();
    181181    // computation of critical pairs
     182    //critPairs->print();
    182183    while( gPrev->getLast() != temp) {
    183184        //pWrite( *(gPrev->getFirst()->getPoly()) );
     
    206207            -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) {
    207208                //Print("zweites groesser\n");
     209               
    208210                CPair* cp   =   new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2,
    209211                                temp->getLPoly(), u1, newElement->getLPoly(), testedRule);                   
    210212                critPairs->insert(cp);
     213                //Print("LALA %p\n",critPairs->getFirst());
     214                //sleep(5);
    211215            }
    212216            else {
    213                 //Print("erstes groesser\n");
    214217                CPair* cp   =   new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1,
    215218                                newElement->getLPoly(), u2, temp->getLPoly(), testedRule);                   
     219                //Print("erstes groesser\n");
    216220                critPairs->insert(cp);
     221                //Print("LALA %p\n",critPairs->getFirst());
     222                //sleep(5);
    217223            }
    218224        }
     
    228234        //sleep(5);
    229235    //}
     236    //Print("END CRITPAIRS\n");
    230237}
    231238
     
    280287inline bool criterion2(poly t, LNode* l, RList* rules, RTagList* rTag) {
    281288    //Print("------------------------------IN CRITERION 2/1-----------------------------------------\n");
    282         //Print("RULES: \n");
    283         //RNode* tempR    =   rules->getFirst();
    284         //while(NULL != tempR->getRule()) {
    285             //Print("ADDRESS OF RNODE: %p\n",tempR);
    286             //Print("ADDRESS OF RULE: %p\n",tempR->getRule());
    287             //pWrite(tempR->getRuleTerm());
    288             //Print("ADDRESS OF TERM: %p\n",tempR->getRuleTerm());
    289             //Print("%d\n\n",tempR->getRuleIndex());
    290             //tempR   =   tempR->getNext();
    291         //}
     289    /*   
     290    Print("RULES: \n");
     291        RNode* tempR    =   rules->getFirst();
     292        int i   = 1;
     293        while(NULL != tempR->getRule()) {
     294            Print("ADDRESS OF %d RNODE: %p\n",i,tempR);
     295            Print("ADDRESS OF RULE: %p\n",tempR->getRule());
     296            pWrite(tempR->getRuleTerm());
     297            Print("ADDRESS OF TERM: %p\n",tempR->getRuleTerm());
     298            Print("%d\n\n",tempR->getRuleIndex());
     299            tempR   =   tempR->getNext();
     300            i++;
     301        }
     302       
    292303        //Print("TESTED ELEMENT: ");
    293304        //pWrite(l->getPoly());
     
    295306        //pWrite(ppMult_qq(t,l->getTerm()));
    296307        //Print("%d\n\n",l->getIndex());
     308        */
    297309// start at the previously added element to gPrev, as all other elements will have the same index for sure
    298310    RNode* testNode =   new RNode();
     
    376388    //Print("LAST RULE TESTED: %p",testedRule);
    377389    //Print("RULES: \n");
    378         RNode* tempR    =   rules->getFirst();
     390        //RNode* tempR    =   rules->getFirst();
    379391        //while(NULL != tempR->getRule()) {
    380392            //pWrite(tempR->getRuleTerm());
     
    418430    poly sp      =   pInit();
    419431    //Print("###############################IN SPOLS##############################\n");
    420     while(NULL != temp->getData()) {
     432    //first->print();
     433
     434    while(NULL != temp) {
     435        //Print("JA\n");
    421436        // only if a new rule was added since the last test in subalgorithm criticalPair()
    422437        //if(rules->getFirst() != rTag->getFirst()) {
    423             if(!criterion2(temp->getT1(),temp->getAdLp1(),rules,temp->getTestedRule())) {
     438        if(!criterion2(temp->getT1(),temp->getAdLp1(),rules,temp->getTestedRule())) {
    424439                // the second component is tested only when it has the actual index, otherwise there is
    425440                // no new rule to test since the last test in subalgorithm criticalPair()
     
    495510            }
    496511        //}
     512        //Print("%p\n",temp);
    497513        temp    =   temp->getNext();
     514        //Print("%p\n",temp);
     515        //Print("%p\n",temp->getData());
     516        //pWrite(temp->getLp1Poly());
    498517    }
    499518    // these critical pairs can be deleted now as they are either useless for further computations or
     
    854873        //pWrite(gPrevTag->getPoly());
    855874        gPrev   =   F5inc(i, id->m[i-1], gPrev, gbPrev, ONE, lTag, rules, rTag);
     875        //Print("____________________________________ITERATION STEP DONE________________________________________\n");
    856876       
    857877        // DEBUGGING STUFF
  • kernel/f5lists.cc

    r47ca23 r7c81165  
    489489// working only with linked, but not doubly linked lists due to memory usage we have to check the
    490490// insertion around the first element separately from the insertion around all other elements in the list
    491 CNode* CNode::insert(CPair* c, CNode* last) {
    492     if(NULL == this->data) {
     491CNode* CNode::insert(CPair* c) {
     492    if(NULL == this) {
    493493        CNode* newElement   =   new CNode(c, this);
    494494        return newElement;
     
    511511                //Print("Insert Deg\n");
    512512                CNode* temp = this;
    513                 while(  NULL != temp->next->data ) {
     513                while(  NULL != temp->next) {
    514514                    if(temp->next->data->getDeg() == c->getDeg() ) {
    515515                        if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) {
     
    528528                    }
    529529                }
    530                 CNode* newElement   =   new CNode(c, last);
     530                CNode* newElement   =   new CNode(c, NULL);
    531531                temp->next          =   newElement;
    532532                return this;
     
    535535        if( c->getDeg() > this->data->getDeg() ) { // greater degree than the first list element
    536536            CNode* temp =   this;
    537             while( NULL != temp->next->data ) {   
     537            while( NULL != temp->next ) {   
    538538                if( c->getDeg() < temp->next->data->getDeg() ) {
    539539                    CNode* newElement   =   new CNode(c, temp->next);
     
    549549                    else {
    550550                        temp = temp->next;
    551                         while(  NULL != temp->next->data ) {
     551                        while(  NULL != temp->next ) {
    552552                            if( temp->next->data->getDeg() == c->getDeg() ) {
    553553                                if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),
     
    567567                            }
    568568                        }
    569                         CNode* newElement   =   new CNode(c, last);
     569                        CNode* newElement   =   new CNode(c, NULL);
    570570                        temp->next          =   newElement;
    571571                        return this;
     
    576576                }
    577577            }
    578             CNode* newElement   =   new CNode(c, last);
     578            CNode* newElement   =   new CNode(c, NULL);
    579579            temp->next          =   newElement;
    580580            return this;
     
    586586CNode* CNode::getMinDeg() {
    587587    CNode* temp = this;
    588     while( NULL != temp->data ) {
    589         while(NULL != temp->next->data && temp->next->data->getDeg() == this->data->getDeg()) {
     588    while(NULL != temp) {
     589        while(NULL != temp->next && temp->next->data->getDeg() == this->data->getDeg()) {
    590590            temp = temp->next;
    591591        }
     
    593593        // every CList should end with a (NULL,NULL) element for a similar behaviour
    594594        // using termination conditions throughout the algorithm
    595         temp->next          =   new CNode();
     595        temp->next          =   NULL;
    596596        return returnCNode;
    597597    }
     
    663663    CNode* temp = this;
    664664    Print("___________________List of critical pairs______________________:\n");
    665     while(NULL != temp->data) {
     665    while(NULL != temp) {
    666666        Print("LP1 Index: %d\n",temp->getLp1Index());
    667667        Print("T1: ");
     
    690690// for initialization of CLists, last element alwas has data=NULL and next=NULL
    691691CList::CList() {
    692     first   =   new CNode();
    693     last    =   first;
     692    first   =   NULL;
    694693}
    695694
    696695CList::CList(CPair* c) {
    697696    first   =   new CNode(c);
    698     last    =   first;
    699697}
    700698
    701699CList::~CList() {
    702700    CNode* temp;
    703     while(first) {
     701    while(NULL != first) {
    704702        temp    =   first;
    705703        first   =   first->getNext();
     
    711709// note: as all critical pairs have the same index here, the second sort is done on the terms of the labels
    712710void CList::insert(CPair* c) {
    713     first = first->insert(c, last);
     711    first = first->insert(c);
    714712}
    715713
  • kernel/f5lists.h

    r47ca23 r7c81165  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5lists.h,v 1.14 2009-03-04 20:23:05 ederc Exp $ */
     4/* $Id: f5lists.h,v 1.15 2009-03-12 09:43:53 ederc Exp $ */
    55/*
    66* ABSTRACT: list interface
     
    201201                CNode(CPair* c, CNode* n);
    202202                ~CNode();
    203         CNode*  insert(CPair* c, CNode* last);
     203        CNode*  insert(CPair* c);
    204204        CNode*  getMinDeg();
    205205        CPair*  getData();
     
    230230    private:
    231231        CNode*  first;
    232         // last alway has data=NULL and next=NULL, for initialization purposes used
    233         CNode*  last;
    234232    public:
    235233                // for initialization of CLists, last element alwas has data=NULL and next=NULL
Note: See TracChangeset for help on using the changeset viewer.