source: git/Singular/lists.h @ d3e360

spielwiese
Last change on this file since d3e360 was 25003c, checked in by Thomas Siebert <siebert@…>, 26 years ago
*** empty log message *** git-svn-id: file:///usr/local/Singular/svn/trunk@1532 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1#ifndef LISTS_H
2#define LISTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: lists.h,v 1.4 1998-04-29 07:05:29 siebert 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
15class slists
16{
17  public:
18    void Clean()
19    {
20      if (this!=NULL)
21      {
22        if (nr>=0)
23        {
24          int i;
25          for(i=nr;i>=0;i--)
26          {
27            if (m[i].rtyp!=DEF_CMD) m[i].CleanUp();
28          }
29          Free((ADDRESS)m, (nr+1)*sizeof(sleftv));
30          nr=-1;
31        }
32        Free((ADDRESS)this, sizeof(slists));
33      }
34    }
35    inline void Init(int l=0)
36      { nr=l-1; m=(sleftv *)((l>0) ? Alloc0(l*sizeof(sleftv)): NULL); }
37    int    nr; /* the number of elements in the list -1 */
38               /* -1: empty list */
39    sleftv  *m;  /* field of sleftv */
40};
41
42lists lCopy(lists L);
43lists lInsert0(lists ul, leftv v, int pos);
44BOOLEAN lInsert(leftv res, leftv u, leftv v);
45BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w);
46BOOLEAN lAppend(leftv res, leftv u, leftv v);
47BOOLEAN lDelete(leftv res, leftv u, leftv v);
48BOOLEAN lAdd(leftv res, leftv u, leftv v);
49BOOLEAN lRingDependend(lists L);
50
51lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec ** weights);
52resolvente liFindRes(lists L, int * len, int *typ0,intvec *** weights=NULL);
53#endif
Note: See TracBrowser for help on using the repository browser.