source: git/kernel/lplist.h @ 99d8753

spielwiese
Last change on this file since 99d8753 was 99d8753, checked in by Christian Eder, 15 years ago
linked list of labeled polynomials git-svn-id: file:///usr/local/Singular/svn/trunk@11208 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: lplist.h,v 1.1 2008-11-27 17:16:45 ederc Exp $ */
5/*
6* ABSTRACT: list interface
7*/
8#include "lpolynomial.h"
9#ifndef LPLIST_HEADER
10#define LPLIST_HEADER
11
12#ifdef HAVE_F5
13
14
15
16
17
18/*
19=======================
20=======================
21linked lists for LPolys
22=======================
23=======================
24*/
25
26
27
28
29
30
31
32/*
33=================
34classes in a list
35=================
36*/
37class Node;
38class FirstNode;
39class LastNode;
40class GenNode;
41class LpList;
42
43/*
44===================
45abstract Node class
46===================
47*/
48class Node {
49    public:
50        Node() {};
51        virtual         ~Node() {};
52        // the following two functions have to be redefined in FirstNode, LastNode, and GenNode
53        virtual Node*   insert(LPoly* lp) = 0;
54        virtual void    get() = 0;
55};
56
57/*
58========================
59subclass GenNode of Node
60========================
61*/
62class GenNode : public Node {
63    private:
64        LPoly*  data;
65        Node*   next;
66    public:
67        GenNode(LPoly* d, Node* n) : data(d), next(n){};
68        ~GenNode() {
69            delete next;
70            delete data;
71        }
72        Node* insert(LPoly* d);
73        void get();
74};
75
76
77/*
78========================
79subclass EndNode of Node
80========================
81*/
82class EndNode : public Node {
83    public:
84        EndNode() {};
85        ~EndNode() {};
86        Node* insert(LPoly* d);
87        void get();
88};
89
90
91/*
92==========================
93subclass FirstNode of Node
94==========================
95*/
96class FirstNode : public Node {
97    private:
98        Node* next;
99    public:
100        FirstNode() {
101            next = new EndNode;
102        }
103        ~FirstNode() {};
104        Node* insert(LPoly* d);
105        void get();
106};
107
108
109/*
110============
111class LpList
112============
113*/
114class LpList {
115    private:
116        FirstNode *start;
117    public:
118        LpList() {
119            start = new FirstNode;
120        }
121        ~LpList() {
122            delete start;
123        }
124        void insert(LPoly* d);
125        void get();
126};
127
128
129
130#endif
131#endif
132 
Note: See TracBrowser for help on using the repository browser.