source: git/kernel/old.lplist.cc @ 20e3062

spielwiese
Last change on this file since 20e3062 was ba5e9e, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Changed configure-scripts to generate individual public config files for each package: resources, libpolys, singular (main) fix: sources should include correct corresponding config headers.
  • Property mode set to 100644
File size: 2.8 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/*
5* ABSTRACT: list interface
6*/
7#ifdef HAVE_CONFIG_H
8#include "singularconfig.h"
9#endif /* HAVE_CONFIG_H */
10#include <kernel/mod2.h>
11
12#ifdef HAVE_F5
13
14#include <kernel/kutil.h>
15#include <kernel/structs.h>
16#include <omalloc/omalloc.h>
17#include <kernel/polys.h>
18#include <polys/monomials/p_polys.h>
19#include <kernel/ideals.h>
20#include <kernel/febase.h>
21#include <kernel/kstd1.h>
22#include <kernel/khstd.h>
23#include <polys/kbuckets.h>
24#include <polys/weight.h>
25#include <misc/intvec.h>
26#include <kernel/polys.h>
27#include <kernel/lpolynomial.h>
28#include <kernel/lplist.h>
29
30
31/*
32=========================================
33=========================================
34implementation of the functions of list.h
35=========================================
36=========================================
37*/
38
39
40
41
42/*
43===========================
44insert general node in list
45===========================
46*/
47Node* GenNode::insert(LPoly* d) {
48    int ret = data->compare(*d);
49    switch(ret) {
50        case 0: case -1: {
51            next = next->insert(d);
52            return this;
53        }
54        case 1: {   
55            GenNode* newNode = new GenNode(d,this);
56            return newNode;
57        }
58    }           
59    return this;
60}
61
62/*
63========================
64get general node in list
65========================
66*/
67void GenNode::get() {
68    data->get();
69    next->get();
70}
71
72/*
73=========================
74insert first node in list
75=========================
76*/
77Node* FirstNode::insert(LPoly* d) {
78    next = next->insert(d);
79    return this;
80}
81
82/*
83===========================================================================================
84get first node in list (no element in this place, so go on to the next element in the list)
85===========================================================================================
86*/
87void FirstNode::get() {
88    next->get();
89}
90
91/*
92=======================
93insert end node in list
94=======================
95*/
96Node* EndNode::insert(LPoly* d) {
97    GenNode* data = new GenNode(d,this);
98    return data;
99}
100
101/*
102===============================================================================
103get end node in list (nothing to do, as there are no more elements in the list)
104===============================================================================
105*/
106void EndNode::get() {
107}
108
109/*
110=========================
111insert an element in list
112=========================
113*/
114void LpList::insert(LPoly* d) {
115   start->insert(d);
116   // there is no return value also we get the address of the new element in the list
117   // returning this value in the other insert functions is due to their virtual
118   // declaration in the base class Node
119}
120
121/*
122==============================
123get all elements from the list
124==============================
125*/
126void LpList::get() {
127    start->get();
128}
129
130#endif
Note: See TracBrowser for help on using the repository browser.