Changeset 416ea2 in git for kernel/f5lists.cc


Ignore:
Timestamp:
Feb 16, 2009, 3:23:42 PM (14 years ago)
Author:
Christian Eder
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
d59666cfeced5db8d8654b6ae282bedc5855d28f
Parents:
61d32c91fe3976149b9b30938476f2c3c1257eee
Message:
new try on reduction procedures, no longer list of completed elements, adding a "last" node to LLists for more flexibility using the lists


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

Legend:

Unmodified
Added
Removed
  • kernel/f5lists.cc

    r61d32c r416ea2  
    3030    next                =   NULL;
    3131    gPrevRedCheck       =   NULL;
    32     completedRedCheck   =   NULL;
    3332}
    3433 LNode::LNode(LPoly* lp) {
     
    3635    next                =   NULL;
    3736    gPrevRedCheck       =   NULL;
    38     completedRedCheck   =   NULL;
    3937}
    4038       
     
    4442    next                =   l;
    4543    gPrevRedCheck       =   NULL;
    46     completedRedCheck   =   NULL;
    47 }
    48 
    49 LNode::LNode(poly t, int i, poly p, Rule* r, LNode* gPCheck, LNode* CompCheck) {
     44}
     45
     46LNode::LNode(poly t, int i, poly p, Rule* r, LNode* gPCheck) {
    5047LPoly* lp           =   new LPoly(t,i,p,r);
    5148data                =   lp;
    5249next                =   NULL;
    5350gPrevRedCheck       =   gPCheck;
    54 completedRedCheck   =   CompCheck;
    5551}
    5652       
    57 LNode::LNode(poly t, int i, poly p, Rule* r, LNode* gPCheck, LNode* CompCheck, LNode* l) {
     53LNode::LNode(poly t, int i, poly p, Rule* r, LNode* gPCheck, LNode* l) {
    5854    LPoly* lp           =   new LPoly(t,i,p,r);
    5955    data                =   lp;
    6056    next                =   l;
    6157    gPrevRedCheck       =   gPCheck;
    62     completedRedCheck   =   CompCheck;
    6358}
    6459
     
    6762    next                =   ln->getNext();
    6863    gPrevRedCheck       =   NULL;
    69     completedRedCheck   =   NULL;
    7064}
    7165       
    7266LNode::~LNode() {
    73     delete next;
     67    //delete next;
    7468    delete gPrevRedCheck;
    75     delete completedRedCheck;
    7669    delete data;   
    7770}
     
    8578       
    8679LNode* LNode::insert(poly t, int i, poly p, Rule* r) {
    87     LNode* newElement = new LNode(t, i, p, r, NULL, NULL, this);
     80    LNode* newElement = new LNode(t, i, p, r, NULL, this);
    8881    return newElement;
    8982}
    90        
     83
     84LNode* 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
    9189// insert new elemets to the list w.r.t. increasing labels
    9290// only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
     
    151149}
    152150
    153 LNode* LNode::getCompletedRedCheck() {
    154     return completedRedCheck;
    155 }
    156 
    157151// set the data from the LPoly saved in LNode
    158152void LNode::setPoly(poly p) {
     
    170164void LNode::setGPrevRedCheck(LNode* l) {
    171165    gPrevRedCheck   =   l;
    172 }
    173 
    174 void LNode::setCompletedRedCheck(LNode* l) {
    175     completedRedCheck   =   l;
    176166}
    177167
     
    200190LList::LList() {
    201191    first   =   new LNode();
     192    last    =   first;
    202193    length  =   0;
    203194}
     
    205196LList::LList(LPoly* lp) {
    206197    first   =   new LNode(lp);
     198    last    =   first;
    207199    length  =   1;
    208200}
     
    210202LList::LList(poly t,int i,poly p,Rule* r) {
    211203    first   =   new LNode(t,i,p,r);
     204    last    =   first;
    212205    length  =   1;
    213206}
     
    228221}
    229222
     223void LList::append(poly t, int i, poly p, Rule* r) {
     224    last    =   last->append(t,i,p,r);
     225    length++;
     226}
     227
    230228void LList::insertByLabel(poly t, int i, poly p, Rule* r) {
    231229    first = first->insertByLabel(t,i,p,r);
     
    248246LNode* LList::getFirst() {
    249247    return first;
     248}
     249
     250LNode* LList::getLast() {
     251    return last;
    250252}
    251253
     
    262264    first       =   l;
    263265    delete(temp);
     266    length--;
    264267}
    265268
Note: See TracChangeset for help on using the changeset viewer.