source: git/Singular/lists.h @ 512a2b

spielwiese
Last change on this file since 512a2b was 512a2b, checked in by Olaf Bachmann <obachman@…>, 24 years ago
p_polys.h git-svn-id: file:///usr/local/Singular/svn/trunk@4606 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.9 KB
Line 
1#ifndef LISTS_H
2#define LISTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: lists.h,v 1.14 2000-09-18 09:19:12 obachman Exp $ */
7/*
8* ABSTRACT: handling of the list type
9*/
10#include "structs.h"
11#include "omalloc.h"
12#include "subexpr.h"
13#include "tok.h"
14
15#ifdef MDEBUG
16#define INLINE_THIS
17#else
18#define INLINE_THIS inline
19#endif
20
21class slists
22{
23  public:
24    void Clean()
25    {
26      if (this!=NULL)
27      {
28        if (nr>=0)
29        {
30          int i;
31          for(i=nr;i>=0;i--)
32          {
33            if (m[i].rtyp!=DEF_CMD) m[i].CleanUp();
34          }
35          omFreeSize((ADDRESS)m, (nr+1)*sizeof(sleftv));
36          nr=-1;
37        }
38        omFreeSize((ADDRESS)this, sizeof(slists));
39      }
40    }
41  INLINE_THIS void Init(int l=0);
42    int    nr; /* the number of elements in the list -1 */
43               /* -1: empty list */
44#ifdef HAVE_NAMESPACES_N
45    idhdl src_packhdl;
46#endif /* HAVE_NAMESPACES */
47    sleftv  *m;  /* field of sleftv */
48};
49
50lists lCopy(lists L);
51lists lInsert0(lists ul, leftv v, int pos);
52BOOLEAN lInsert(leftv res, leftv u, leftv v);
53BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w);
54BOOLEAN lAppend(leftv res, leftv u, leftv v);
55BOOLEAN lDelete(leftv res, leftv u, leftv v);
56BOOLEAN lAdd(leftv res, leftv u, leftv v);
57BOOLEAN lRingDependend(lists L);
58char* lString(lists l, BOOLEAN typed = FALSE, int dim = 1);
59
60
61lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec ** weights);
62resolvente liFindRes(lists L, int * len, int *typ0,intvec *** weights=NULL);
63
64#if ! defined(MDEBUG) || defined(LISTS_CC)
65INLINE_THIS void slists::Init(int l=0)
66      { nr=l-1; m=(sleftv *)((l>0) ? omAlloc0(l*sizeof(sleftv)): NULL);
67#ifdef HAVE_NAMESPACES_N
68        src_packhdl = namespaceroot->get(namespaceroot->name, 0, TRUE);
69#endif /* HAVE_NAMESPACES */
70      }
71#endif
72
73extern omBin slists_bin;
74#undef INLINE_THIS
75
76#endif
Note: See TracBrowser for help on using the repository browser.