Changeset d51339 in git for kernel/f5lists.cc


Ignore:
Timestamp:
Feb 18, 2009, 9:43:05 PM (14 years ago)
Author:
Christian Eder
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
eab144e3329d02244a62975d1bb6e77d4754f131
Parents:
93a7f7b1c20c3c886dd4dff521c518039f3824e7
Message:
new written reduction process, still problems getting the right rules in criterion2()
->lastRuleTested shouldnt be part of the CPair as it is a characteristic of an LPoly


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

Legend:

Unmodified
Added
Removed
  • kernel/f5lists.cc

    r93a7f7 rd51339  
    7070}
    7171       
    72 // insert new elements to the list always in front (labeled / classical polynomial view)
     72// insert new elements to the list always at the end (labeled / classical polynomial view)
     73// needed for list gPrev
    7374LNode* LNode::insert(LPoly* lp) {
    74     Print("HIER\n");
    75     LNode* newElement = new LNode(lp, this);
     75    Print("INSERTION: \n");
     76    Print("LAST GPREV: ");
     77    pWrite(this->getPoly());
     78LNode* newElement   =   new LNode(lp, NULL);
     79    this->next          =   newElement;
    7680    return newElement;
    7781}
    7882       
    7983LNode* LNode::insert(poly t, int i, poly p, Rule* r) {
    80     LNode* newElement = new LNode(t, i, p, r, NULL, this);
     84    LNode* newElement   =   new LNode(t, i, p, r, NULL, NULL);
     85    this->next          =   newElement;
    8186    return newElement;
    8287}
    8388
    84 LNode* LNode::append(poly t, int i, poly p, Rule* r) {
    85     LNode* newElement   =   new LNode(t,i,p,r,NULL);
    86     this->next          =   newElement;
    87 }
    88 
     89// insert new elements to the list always in front (labeled / classical polynomial view)
     90// needed for sPolyList
     91LNode* LNode::insertSP(LPoly* lp) {
     92    LNode* newElement   =   new LNode(lp, this);
     93    return newElement;
     94}
     95       
     96LNode* LNode::insertSP(poly t, int i, poly p, Rule* r) {
     97    LNode* newElement   =   new LNode(t, i, p, r, NULL, this);
     98    return newElement;
     99}
    89100// insert new elemets to the list w.r.t. increasing labels
    90101// only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
     
    122133    return next;
    123134}
    124        
     135
    125136// get the LPoly* out of LNode*
    126137LPoly* LNode::getLPoly() {
     
    182193}
    183194
     195// for debugging
     196void LNode::print() {
     197    LNode* temp = this;
     198    Print("___________________List of S-polynomials______________________:\n");
     199    while(NULL != temp->data) {
     200        Print("Index: %d\n",temp->getIndex());
     201        Print("Term: ");
     202        pWrite(temp->getTerm());
     203        Print("Poly: ");
     204        pWrite(temp->getPoly());
     205        Print("\n");
     206        temp = temp->next;
     207    }
     208}
     209
     210
    184211/*
    185212====================================
     
    210237}
    211238
    212 // insertion in front of the list
     239// insertion at the end of the list, needed for gPrev
    213240void LList::insert(LPoly* lp) {
    214     first = first->insert(lp);
     241    last = last->insert(lp);
     242    Print("NEW LAST GPREV: ");
     243    pWrite(last->getPoly());
    215244    length++;
     245    Print("LENGTH %d\n",length);
    216246}
    217247
    218248void LList::insert(poly t,int i, poly p, Rule* r) {
    219     first = first->insert(t,i,p,r);
     249    last = last->insert(t,i,p,r);
    220250    length++;
    221 }
    222 
    223 void LList::append(poly t, int i, poly p, Rule* r) {
    224     last    =   last->append(t,i,p,r);
     251    Print("LENGTH %d\n",length);
     252}
     253
     254// insertion in front of the list, needed for sPolyList
     255void LList::insertSP(LPoly* lp) {
     256    first = first->insertSP(lp);
    225257    length++;
    226 }
     258    Print("LENGTH %d\n",length);
     259}
     260
     261void LList::insertSP(poly t,int i, poly p, Rule* r) {
     262    first = first->insertSP(t,i,p,r);
     263    length++;
     264    Print("LENGTH %d\n",length);
     265}
     266
    227267
    228268void LList::insertByLabel(poly t, int i, poly p, Rule* r) {
    229269    first = first->insertByLabel(t,i,p,r);
    230270    length++;
     271    Print("LENGTH %d\n",length);
    231272}
    232273
     
    234275    first = first->insertByLabel(l->getTerm(),l->getIndex(),l->getPoly(),l->getRule());
    235276    length++;
     277    Print("LENGTH %d\n",length);
    236278}
    237279
     
    252294}
    253295
    254 LNode* LList::getNext(LNode* l) {
    255     return l->getNext();
    256 }
    257 
    258296int LList::getLength() {
    259297    return length;
     
    261299
    262300void LList::setFirst(LNode* l) {
    263     LNode* temp =   first;
    264301    first       =   l;
    265     delete(temp);
    266302    length--;
    267303}
    268304
    269 
     305void LList::print() {
     306    first->print();
     307}
    270308
    271309/*
     
    302340LNode* LTagNode::getLNode() {
    303341    return this->data;
     342}
     343
     344LTagNode* LTagNode::getNext() {
     345    return next;
    304346}
    305347
     
    329371LTagList::LTagList() {
    330372    LTagNode* first =   new LTagNode();
     373   
    331374    length          =   0;
    332375}
     
    343386}
    344387
     388void LTagList::setFirstCurrentIdx(LNode* l) {
     389    firstCurrentIdx =   l;
     390}
     391
    345392LNode* LTagList::get(int idx) {
    346393    return first->get(idx, length);
     
    351398}
    352399
     400LNode* LTagList::getFirstCurrentIdx() {
     401    return firstCurrentIdx;
     402}
    353403
    354404/*
     
    579629void CNode::print() {
    580630    CNode* temp = this;
    581     Print("List of critical pairs:\n");
     631    Print("___________________List of critical pairs______________________:\n");
    582632    while(NULL != temp->data) {
    583         Print("Index: %d\n",temp->getLp1Index());
     633        Print("LP1 Index: %d\n",temp->getLp1Index());
    584634        Print("T1: ");
    585635        pWrite(temp->getT1());
    586         Print("Lp1 Term: ");
     636        Print("LP1 Term: ");
    587637        pWrite(temp->getLp1Term());
    588         Print("%d\n",temp->getLp2Index());
     638        Print("LP1 Poly: ");
     639        pWrite(temp->getLp1Poly());
     640        Print("LP2 Index: %d\n",temp->getLp2Index());
     641        Print("T2: ");
    589642        pWrite(temp->getT2());
     643        Print("LP2 Term: ");
    590644        pWrite(temp->getLp2Term());
     645        Print("LP2 Poly: ");
     646        pWrite(temp->getLp2Poly());
    591647        Print("\n");
    592648        temp = temp->next;
    593649    }
     650}
     651
     652void CNode::setLastRuleTested(Rule* r) {
     653    data->setLastRuleTested(r);
    594654}
    595655
Note: See TracChangeset for help on using the changeset viewer.