source: git/kernel/lplist.cc @ fec53d

fieker-DuValspielwiese
Last change on this file since fec53d was 599326, checked in by Kai Krüger <krueger@…>, 14 years ago
Anne, Kai, Frank: - changes to #include "..." statements to allow cleaner build structure - affected directories: omalloc, kernel, Singular - not yet done: IntergerProgramming git-svn-id: file:///usr/local/Singular/svn/trunk@13032 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.8 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id$ */
5/*
6* ABSTRACT: list interface
7*/
8#include <kernel/mod2.h>
9
10#ifdef HAVE_F5
11
12#include <kernel/kutil.h>
13#include <kernel/structs.h>
14#include <omalloc.h>
15#include <kernel/polys.h>
16#include <kernel/p_polys.h>
17#include <kernel/ideals.h>
18#include <kernel/febase.h>
19#include <kernel/kstd1.h>
20#include <kernel/khstd.h>
21#include <kernel/kbuckets.h>
22#include <kernel/weight.h>
23#include <kernel/intvec.h>
24#include <kernel/pInline1.h>
25#include <kernel/lpolynomial.h>
26#include <kernel/lplist.h>
27
28
29/*
30=========================================
31=========================================
32implementation of the functions of list.h
33=========================================
34=========================================
35*/
36
37
38
39
40/*
41===========================
42insert general node in list
43===========================
44*/
45Node* GenNode::insert(LPoly* d) {
46    int ret = data->compare(*d);
47    switch(ret) {
48        case 0: case -1: {
49            next = next->insert(d);
50            return this;
51        }
52        case 1: {   
53            GenNode* newNode = new GenNode(d,this);
54            return newNode;
55        }
56    }           
57    return this;
58}
59
60/*
61========================
62get general node in list
63========================
64*/
65void GenNode::get() {
66    data->get();
67    next->get();
68}
69
70/*
71=========================
72insert first node in list
73=========================
74*/
75Node* FirstNode::insert(LPoly* d) {
76    next = next->insert(d);
77    return this;
78}
79
80/*
81===========================================================================================
82get first node in list (no element in this place, so go on to the next element in the list)
83===========================================================================================
84*/
85void FirstNode::get() {
86    next->get();
87}
88
89/*
90=======================
91insert end node in list
92=======================
93*/
94Node* EndNode::insert(LPoly* d) {
95    GenNode* data = new GenNode(d,this);
96    return data;
97}
98
99/*
100===============================================================================
101get end node in list (nothing to do, as there are no more elements in the list)
102===============================================================================
103*/
104void EndNode::get() {
105}
106
107/*
108=========================
109insert an element in list
110=========================
111*/
112void LpList::insert(LPoly* d) {
113   start->insert(d);
114   // there is no return value also we get the address of the new element in the list
115   // returning this value in the other insert functions is due to their virtual
116   // declaration in the base class Node
117}
118
119/*
120==============================
121get all elements from the list
122==============================
123*/
124void LpList::get() {
125    start->get();
126}
127
128#endif
Note: See TracBrowser for help on using the repository browser.