source: git/Singular/lists.h @ 551fd7

spielwiese
Last change on this file since 551fd7 was 416465, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* bug-fixes from work with Thomas git-svn-id: file:///usr/local/Singular/svn/trunk@3826 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.12 1999-11-15 17:20:19 obachman Exp $ */
7/*
8* ABSTRACT: handling of the list type
9*/
10#include "structs.h"
11#include "mmemory.h"
12#include "subexpr.h"
13#include "tok.h"
14#if HAVE_ASO == 1
15#include "lists.aso"
16#endif
17
18#ifdef MDEBUG
19#define INLINE_THIS
20#else
21#define INLINE_THIS inline
22#endif
23
24class slists
25{
26  public:
27    void Clean()
28    {
29      if (this!=NULL)
30      {
31        if (nr>=0)
32        {
33          int i;
34          for(i=nr;i>=0;i--)
35          {
36            if (m[i].rtyp!=DEF_CMD) m[i].CleanUp();
37          }
38          Free((ADDRESS)m, (nr+1)*sizeof(sleftv));
39          nr=-1;
40        }
41        Free((ADDRESS)this, sizeof(slists));
42      }
43    }
44  INLINE_THIS void Init(int l=0);
45    int    nr; /* the number of elements in the list -1 */
46               /* -1: empty list */
47#ifdef HAVE_NAMESPACES_N
48    idhdl src_packhdl;
49#endif /* HAVE_NAMESPACES */
50    sleftv  *m;  /* field of sleftv */
51};
52
53lists lCopy(lists L);
54lists lInsert0(lists ul, leftv v, int pos);
55BOOLEAN lInsert(leftv res, leftv u, leftv v);
56BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w);
57BOOLEAN lAppend(leftv res, leftv u, leftv v);
58BOOLEAN lDelete(leftv res, leftv u, leftv v);
59BOOLEAN lAdd(leftv res, leftv u, leftv v);
60BOOLEAN lRingDependend(lists L);
61char* lString(lists l, BOOLEAN typed = FALSE, int dim = 1);
62
63
64lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec ** weights);
65resolvente liFindRes(lists L, int * len, int *typ0,intvec *** weights=NULL);
66
67#if ! defined(MDEBUG) || defined(LISTS_CC)
68INLINE_THIS void slists::Init(int l=0)
69      { nr=l-1; m=(sleftv *)((l>0) ? Alloc0(l*sizeof(sleftv)): NULL);
70#ifdef HAVE_NAMESPACES_N
71        src_packhdl = namespaceroot->get(namespaceroot->name, 0, TRUE);
72#endif /* HAVE_NAMESPACES */
73      }
74#endif
75
76#undef INLINE_THIS
77
78#endif
Note: See TracBrowser for help on using the repository browser.