Changeset ab76b4 in git for kernel/f5lists.cc


Ignore:
Timestamp:
Mar 8, 2010, 11:49:06 AM (14 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
c1a5fdccad23660f683eef44f4ca207fa4050c1c
Parents:
56b0c82650ffab78c72a5629796b5fe751482448
Message:
latest F5 version including F5,F5R,F5C & F5+

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

Legend:

Unmodified
Added
Removed
  • kernel/f5lists.cc

    r56b0c8 rab76b4  
    1919#include "f5lists.h"
    2020
     21/**
     22 * functions working on the class PNode
     23 */
     24PNode::PNode(poly p, PNode* n) {
     25  data  = p;
     26  next  = n;
     27}
     28
     29poly PNode::getPoly() {
     30  return this->data;
     31}
     32
     33PNode* PNode::getNext() {
     34  return this->next;
     35}
     36PNode* PNode::insert(poly p) {
     37  poly q = pOne();
     38  q = pCopy(p);
     39  PNode* temp = this;
     40  if(NULL == temp) {
     41    PNode* pn = new PNode(q,temp);
     42    return pn;
     43  }
     44  if(1 == pLmCmp(q,temp->getPoly())) {
     45    PNode* pn = new PNode(q,temp);
     46    return pn;
     47  }
     48  if(0 == pLmCmp(q,temp->getPoly())) {
     49    return this;
     50  }
     51  if(-1 == pLmCmp(q,temp->getPoly())) {
     52    while(NULL != temp->getNext() && -1 == pLmCmp(q,temp->getNext()->getPoly())) {
     53      temp = temp->getNext();
     54    }
     55    if(NULL == temp->getNext() || 1 == pLmCmp(q,temp->getNext()->getPoly())) {
     56      PNode* pn = new PNode(q,temp->getNext());
     57      temp->next = pn;
     58      return this;
     59    }
     60    if(0 == pLmCmp(q,temp->getNext()->getPoly())) {
     61      return this;
     62    }
     63  }
     64}
     65/*
     66PNode* PNode::insert(poly p) {
     67  PNode* pn = new PNode(p,this);
     68  return pn;
     69}
     70*/
     71/**
     72 * functions working on the class PList
     73 */
     74PList::PList() {
     75  first = NULL;
     76}
     77
     78
     79void PList::insert(poly p) {
     80  first = first->insert(p);
     81}
     82 
     83
     84/*
     85PNode* PList::insert(poly p) {
     86  PNode* temp = first;
     87  PNode* pn   = new PNode(p,temp);
     88  first       = pn;
     89  return first;
     90}
     91*/
     92bool PList::check(poly p) {
     93  PNode* temp = first;
     94  //Print("\nCHECK: \n");
     95  //pWrite(p);
     96  //Print("-----\n");
     97  while(NULL != temp) {
     98    //pWrite(temp->getPoly());
     99    //pWrite(p);
     100    //Print("COMAPRE: %d\n",pLmEqual(p,temp->getPoly()));
     101    if(1 == pLmEqual(p,temp->getPoly())) {
     102      //Print("YES!\n");
     103      //pWrite(pHead(temp->getPoly()));
     104      //Print("YES!\n");
     105      return 1;
     106    }
     107    temp = temp->getNext();
     108  }
     109  //Print("NOTHING!\n");
     110  return 0;
     111}
     112
     113void PList::print() {
     114  Print("-----LIST-----\n");
     115  PNode* temp = first;
     116  while(NULL != temp) {
     117    pWrite(temp->getPoly());
     118    temp = temp->getNext();
     119  }
     120}
    21121/*
    22122====================================
     
    293393    LNode* temp = this;
    294394    Print("___________________List of S-polynomials______________________:\n");
    295     Print("%p\n",this);
    296395    while(NULL != temp && NULL != temp->data) {
    297396        Print("Index: %d\n",temp->getIndex());
     
    300399        Print("Poly: ");
    301400        pWrite(temp->getPoly());
    302         Print("%p\n",temp->getPoly());
    303         Print("DELETE? %d\n",temp->getDel());
    304401        temp = temp->next;
    305402    }
     
    695792}
    696793
     794
     795CNode* CNode::insertWithoutSort(CPairOld* cp) {
     796    CNode* newElement = new CNode(cp);
     797    newElement->next  = this;
     798    return newElement;
     799}
     800
     801
    697802// get the first elements from CListOld which by the above sorting have minimal degree
    698803CNode* CNode::getMinDeg() {
     
    831936}
    832937
     938void CListOld::insertWithoutSort(CPairOld* c) {
     939    first = first->insertWithoutSort(c);
     940}
     941
    833942CNode* CListOld::getFirst() {
    834943    return first;
Note: See TracChangeset for help on using the changeset viewer.