source: git/Singular/lists.h @ 666c90

spielwiese
Last change on this file since 666c90 was bfcb41, checked in by Hans Schönemann <hannes@…>, 20 years ago
*hannes: optimization from 2-0 git-svn-id: file:///usr/local/Singular/svn/trunk@7516 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.8 KB
Line 
1#ifndef LISTS_H
2#define LISTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: lists.h,v 1.19 2004-10-05 13:01:15 Singular 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
21extern omBin slists_bin;
22class slists
23{
24  public:
25    void Clean(ring r=currRing)
26    {
27      if (this!=NULL)
28      {
29        if (nr>=0)
30        {
31          int i;
32          for(i=nr;i>=0;i--)
33          {
34            if (m[i].rtyp!=DEF_CMD) m[i].CleanUp(r);
35          }
36          omFreeSize((ADDRESS)m, (nr+1)*sizeof(sleftv));
37          nr=-1;
38        }
39        //omFreeSize((ADDRESS)this, sizeof(slists));
40        omFreeBin((ADDRESS)this,slists_bin);
41      }
42    }
43  INLINE_THIS void Init(int l=0);
44    int    nr; /* the number of elements in the list -1 */
45               /* -1: empty list */
46    sleftv  *m;  /* field of sleftv */
47};
48
49lists lCopy(lists L);
50lists lInsert0(lists ul, leftv v, int pos);
51BOOLEAN lInsert(leftv res, leftv u, leftv v);
52BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w);
53BOOLEAN lAppend(leftv res, leftv u, leftv v);
54BOOLEAN lDelete(leftv res, leftv u, leftv v);
55BOOLEAN lAdd(leftv res, leftv u, leftv v);
56BOOLEAN lRingDependend(lists L);
57char* lString(lists l, BOOLEAN typed = FALSE, int dim = 1);
58
59
60lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec ** weights);
61resolvente liFindRes(lists L, int * len, int *typ0,intvec *** weights=NULL);
62
63#if ! defined(MDEBUG) || defined(LISTS_CC)
64INLINE_THIS void slists::Init(int l)
65      { nr=l-1; m=(sleftv *)((l>0) ? omAlloc0(l*sizeof(sleftv)): NULL);
66      }
67#endif
68
69#undef INLINE_THIS
70
71#endif
Note: See TracBrowser for help on using the repository browser.