source: git/Singular/lists.h @ c4bbf1f

spielwiese
Last change on this file since c4bbf1f was 6ae4f5, checked in by Hans Schönemann <hannes@…>, 27 years ago
* hannes: - corrected scanner.l: parsing of strings in blocks: if (1) { write("","}"); } - corrected ipassign.cc: assignment of "dummy" types: DEF, NONE - corrected sleftv::Print(_), initialisation of _ - added conversion int->def - added CopyD(DEF) - in insert(..): object should not be of type NONE (lists.cc:lInsert0) - added int*intvec, int*intmat to iparith.cc git-svn-id: file:///usr/local/Singular/svn/trunk@145 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.3 1997-04-09 12:19:55 Singular 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);
53#endif
Note: See TracBrowser for help on using the repository browser.