source: git/Singular/lists.h @ 47367fd

fieker-DuValspielwiese
Last change on this file since 47367fd was ecf019, checked in by Hans Schoenemann <hannes@…>, 12 years ago
chg: consider lists with only DEF_CMD as empty lists(print, delete)(from master)
  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[0e1846]1#ifndef LISTS_H
2#define LISTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT: handling of the list type
8*/
[b1dfaf]9#include <omalloc/omalloc.h>
[599326]10#include <kernel/structs.h>
11#include <kernel/ideals.h>
12#include <Singular/subexpr.h>
13#include <Singular/tok.h>
[b7b08c]14
[a3bc95e]15#ifdef MDEBUG
16#define INLINE_THIS
[0f1252]17#else
18#define INLINE_THIS inline
19#endif
[0e1846]20
[bfcb41]21extern omBin slists_bin;
[0e1846]22class slists
23{
24  public:
[16acb0]25    void Clean(ring r=currRing)
[0e1846]26    {
27      if (this!=NULL)
28      {
29        if (nr>=0)
30        {
31          int i;
32          for(i=nr;i>=0;i--)
33          {
[16acb0]34            if (m[i].rtyp!=DEF_CMD) m[i].CleanUp(r);
[0e1846]35          }
[c232af]36          omFreeSize((ADDRESS)m, (nr+1)*sizeof(sleftv));
[0e1846]37          nr=-1;
38        }
[bfcb41]39        //omFreeSize((ADDRESS)this, sizeof(slists));
40        omFreeBin((ADDRESS)this,slists_bin);
[0e1846]41      }
42    }
[0f1252]43  INLINE_THIS void Init(int l=0);
[0e1846]44    int    nr; /* the number of elements in the list -1 */
45               /* -1: empty list */
46    sleftv  *m;  /* field of sleftv */
47};
48
[f5a3a23]49typedef slists *           lists;
50
[ecf019]51int lSize(lists L);
[0e1846]52lists lCopy(lists L);
53lists lInsert0(lists ul, leftv v, int pos);
54BOOLEAN lInsert(leftv res, leftv u, leftv v);
55BOOLEAN lInsert3(leftv res, leftv u, leftv v, leftv w);
56BOOLEAN lAppend(leftv res, leftv u, leftv v);
57BOOLEAN lDelete(leftv res, leftv u, leftv v);
58BOOLEAN lAdd(leftv res, leftv u, leftv v);
59BOOLEAN lRingDependend(lists L);
[a79a128]60char* lString(lists l, BOOLEAN typed = FALSE, int dim = 1);
[4b2155]61
[0e1846]62
[f43a74]63lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec ** weights,int add_row_shift);
[25003c]64resolvente liFindRes(lists L, int * len, int *typ0,intvec *** weights=NULL);
[0f1252]65
66#if ! defined(MDEBUG) || defined(LISTS_CC)
[50cbdc]67INLINE_THIS void slists::Init(int l)
[c232af]68      { nr=l-1; m=(sleftv *)((l>0) ? omAlloc0(l*sizeof(sleftv)): NULL);
[0f1252]69      }
70#endif
71
72#undef INLINE_THIS
73
[0e1846]74#endif
Note: See TracBrowser for help on using the repository browser.