source: git/Singular/comm.h @ 6123fa2

fieker-DuValspielwiese
Last change on this file since 6123fa2 was e48debd, checked in by Hans Schönemann <hannes@…>, 25 years ago
*hannes: no .h file should include mod2.h git-svn-id: file:///usr/local/Singular/svn/trunk@2766 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 KB
Line 
1#ifndef COMM_H
2#define COMM_H
3
4#include <sys/types.h>
5#include "silink.h"
6#include "intvec.h"
7#include "structs.h"
8//#include "febase.h"
9#include "structs.h"
10#include "kutil.h"
11
12#include <stdio.h>
13
14extern int pVariables;
15
16enum stdModus
17{
18  ModEnde,          // Berechnung sofort verlassen
19  ModRead,          // Nur zur besseren Lesbarkeit
20  ModWrite,         //  "   "     "         "
21  ModRun,           // Normales rechnen, Tupel versenden
22  ModStep,          // Tupel Empfangen, Rechenweg richtet sich nach Nachricht
23  ModCalc,          // Normale Rechnen Tupel nicht versenden
24  ModCheck,         // Nachrechnen
25  ModPosition       // Aktuelles Tupel wird beim Reduzieren
26                    // neu in der Liste strat->L positioniert.
27};
28
29enum linkModus
30{
31  lnRead,
32  lnWrite
33};
34
35
36enum stdMsg
37{
38                         // Wird gesendet wenn :
39  MsgEnd           = 2,  // schreibender Prozess die Berechnung beendet hat.
40  MsgTupelisZero   = 3,  // wenn aktuelles Tupel zu NULL geht
41  MsgTupel         = 4,  // wenn aktuelles Tupel nicht zu NULL geht
42  MsgTupelPosition = 5,  // wenn aktuelles Tupel in strat->Ll neu positioniert wird
43  MsgTupelHilb     = 6   // wenn ein Tupel mit Hilberfunktion elimiert wurde.
44};
45
46
47class sklinkvec;
48typedef class sklinkvec * linkvec;
49class sklinkvec
50{
51private:
52  si_link * link;
53public:
54  int nr;
55  sklinkvec(int l=1) {
56    nr=l;
57    link = (si_link *)Alloc0(sizeof(sip_link)*l);
58  }
59
60  si_link& operator[](int i) {
61    return link[i];
62  }
63};
64
65class skintarray;
66typedef class skintarray * intarray;
67class skintarray
68{
69private:
70   intvec * * vec;
71public:
72  int nr;
73  skintarray(int l=1) {
74    nr=l;
75     vec = (intvec **)Alloc0(sizeof(intvec*)*l);
76    for(int i=0; i<l ; i++)
77      vec[i] = NULL;
78  }
79
80  intvec*& operator[](int i) {
81    return vec[i];
82  }
83
84   ~skintarray() {
85     if(vec!=NULL)
86       {
87          for(int i=0; i<nr; i++)
88           {
89             if((vec[i])!=NULL)
90               delete (vec[i]);
91             vec[i]=NULL;
92           }
93       }
94     Free((ADDRESS)vec,sizeof(intvec*)*nr);
95     vec=NULL;
96   }
97};
98
99
100
101class skstdLink;
102typedef class skstdLink * stdLink;
103
104class skstdLink
105{
106public:
107  stdModus Modus;
108  BOOLEAN Verwaltung,
109          Receive,
110          TupelL,
111          TupelWarte,
112          SPoly,
113          Reduzieren,
114          TupelStore,
115          TupelMelden,
116          TupelTesten,
117          TupelPosition,
118          ResultSend;
119
120  void Init(leftv ,int);
121  void Start(kStrategy);
122
123  void Store(LObject);           // Speichert ein Polynom in der Liste l zur späteren Verarbeitung
124  BOOLEAN Restore(kStrategy);    // Holt das ein in l gespeicherten Polynom zur Verarbeitung heran.
125
126  BOOLEAN ReceiveMsg();
127  void SendTupel(kStrategy);
128  void ParseMessage(kStrategy);
129  void TupelDifferent(kStrategy);
130  void CheckPosition(kStrategy, int);
131  void CheckHilb(kStrategy, int);
132
133  void Kill();
134
135  BOOLEAN CheckEnd(kStrategy);
136  void End(kStrategy);
137  lists RestTupel();
138
139  void DispMsg(stdMsg);
140  void DispMod(int i=-1);
141private:
142  //  stdModus Modus;
143  linkModus lnModus;
144
145  LSet Warteliste;
146  int Wartelistemax, Wartelistel;
147  int aktuell;         // Index des Polynoms in l, das als nächstes verarbeitet wird.
148
149  int      procnum;
150  intarray res;
151  linkvec  links;
152  intvec * msg;
153
154  void ParseMessageFinal(kStrategy, int=0);
155  void SendMsg(kStrategy, stdMsg msg,int i =0);
156  BOOLEAN QueryRestore();
157  void SetModus(stdModus,kStrategy);
158  void KillChild(kStrategy,int=-1,BOOLEAN=TRUE);
159};
160
161
162#endif
Note: See TracBrowser for help on using the repository browser.