1 | #ifndef KUTIL_H |
---|
2 | #define KUTIL_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id: kutil.h,v 1.3 1997-04-09 12:19:54 Singular Exp $ */ |
---|
7 | /* |
---|
8 | * ABSTRACT: kernel: utils for std |
---|
9 | */ |
---|
10 | #include "structs.h" |
---|
11 | #include "mmemory.h" |
---|
12 | #include <string.h> |
---|
13 | |
---|
14 | #define setmax 16 |
---|
15 | |
---|
16 | typedef int* intset; |
---|
17 | |
---|
18 | struct sTObject{ |
---|
19 | poly p; |
---|
20 | int ecart,length; |
---|
21 | }; |
---|
22 | struct sLObject{ |
---|
23 | poly p; |
---|
24 | poly p1,p2; /*- the pair p comes from -*/ |
---|
25 | poly lcm; /*- the lcm of p1,p2 -*/ |
---|
26 | int ecart,length; |
---|
27 | }; |
---|
28 | typedef struct sTObject TObject; |
---|
29 | typedef struct sLObject LObject; |
---|
30 | typedef TObject * TSet; |
---|
31 | typedef LObject * LSet; |
---|
32 | |
---|
33 | //extern BOOLEAN interpt; |
---|
34 | //extern BOOLEAN kActive; |
---|
35 | //extern int cp,c3; |
---|
36 | //extern BOOLEAN homog; |
---|
37 | //extern BOOLEAN news; |
---|
38 | //extern ideal Shdl; |
---|
39 | //extern polyset S; |
---|
40 | //extern int sl; |
---|
41 | //extern intset ecartS; |
---|
42 | //extern intset fromQ; |
---|
43 | //extern TSet T; |
---|
44 | //extern int tl,tmax; |
---|
45 | //extern LSet L; |
---|
46 | //extern int Ll,Lmax; |
---|
47 | //extern BOOLEAN honey,sugarCrit; |
---|
48 | //extern BOOLEAN * NotUsedAxis; |
---|
49 | //extern void (*red)(LObject * L,kStrategy strat); |
---|
50 | //extern void (*initEcart)(LObject * L); |
---|
51 | //extern int (*posInT)(TSet T,int tl,LObject h); |
---|
52 | //extern int (*posInL)(LSet set, int length, LObject L,kStrategy strat); |
---|
53 | //extern void (*enterS)(LObject h, int pos,kStrategy strat); |
---|
54 | //extern void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG); |
---|
55 | //extern int ak; |
---|
56 | extern int HCord; |
---|
57 | //extern LObject P; |
---|
58 | //extern poly tail; |
---|
59 | //extern BOOLEAN fromT; |
---|
60 | //extern sleftv kIdeal; |
---|
61 | |
---|
62 | class skStrategy; |
---|
63 | typedef skStrategy * kStrategy; |
---|
64 | class skStrategy |
---|
65 | { |
---|
66 | public: |
---|
67 | kStrategy next; |
---|
68 | void (*red)(LObject * L,kStrategy strat); |
---|
69 | void (*initEcart)(LObject * L); |
---|
70 | int (*posInT)(TSet T,int tl,LObject h); |
---|
71 | int (*posInL)(LSet set, int length, LObject L,kStrategy strat); |
---|
72 | void (*enterS)(LObject h, int pos,kStrategy strat); |
---|
73 | void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG); |
---|
74 | int (*posInLOld)(LSet L,int Ll, LObject l,kStrategy strat); |
---|
75 | pFDegProc pOldFDeg; |
---|
76 | ideal Shdl; |
---|
77 | ideal D; /*V(S) is in D(D)*/ |
---|
78 | ideal M; /*set of minimal generators*/ |
---|
79 | polyset S; |
---|
80 | intset ecartS; |
---|
81 | intset fromQ; |
---|
82 | TSet T; |
---|
83 | LSet L; |
---|
84 | LSet B; |
---|
85 | poly kHEdge; |
---|
86 | poly kNoether; |
---|
87 | BOOLEAN * NotUsedAxis; |
---|
88 | LObject P; |
---|
89 | poly tail; |
---|
90 | leftv kIdeal; |
---|
91 | intvec * kModW; |
---|
92 | BOOLEAN *pairtest;/*used for enterOnePair*/ |
---|
93 | int cp,c3; |
---|
94 | int sl,mu; |
---|
95 | int tl,tmax; |
---|
96 | int Ll,Lmax; |
---|
97 | int Bl,Bmax; |
---|
98 | int ak,LazyDegree,LazyPass; |
---|
99 | int syzComp; |
---|
100 | int HCord; |
---|
101 | int lastAxis; |
---|
102 | int newIdeal; |
---|
103 | BOOLEAN interpt; |
---|
104 | BOOLEAN homog; |
---|
105 | BOOLEAN news; |
---|
106 | BOOLEAN newt;/*used for messageSets*/ |
---|
107 | BOOLEAN kHEdgeFound; |
---|
108 | BOOLEAN honey,sugarCrit; |
---|
109 | BOOLEAN Gebauer,noTailReduction; |
---|
110 | BOOLEAN fromT; |
---|
111 | BOOLEAN noetherSet; |
---|
112 | BOOLEAN update; |
---|
113 | BOOLEAN posInLOldFlag; |
---|
114 | /*FALSE, if posInL == posInL10*/ |
---|
115 | int minim; |
---|
116 | }; |
---|
117 | |
---|
118 | void deleteHC(poly *p, int *e, int *l, kStrategy strat); |
---|
119 | void deleteInS (int i,kStrategy strat); |
---|
120 | void enlargeT (TSet* T,int* length,int incr); |
---|
121 | void cleanT (kStrategy strat); |
---|
122 | LSet initL (); |
---|
123 | void enlargeL (LSet* L,int* length,int incr); |
---|
124 | void deleteInL(LSet set, int *length, int j,kStrategy strat); |
---|
125 | void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at); |
---|
126 | void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG); |
---|
127 | void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG); |
---|
128 | int posInS (polyset set,int length,poly p); |
---|
129 | int posInT0 (TSet set,int length,LObject p); |
---|
130 | int posInT1 (TSet set,int length,LObject p); |
---|
131 | int posInT2 (TSet set,int length,LObject p); |
---|
132 | int posInT11 (TSet set,int length,LObject p); |
---|
133 | int posInT13 (TSet set,int length,LObject p); |
---|
134 | int posInT15 (TSet set,int length,LObject p); |
---|
135 | int posInT17 (TSet set,int length,LObject p); |
---|
136 | int posInT19 (TSet set,int length,LObject p); |
---|
137 | void reorderS (int* suc,kStrategy strat); |
---|
138 | int posInL0 (LSet set, int length, LObject L,kStrategy strat); |
---|
139 | int posInL11 (LSet set, int length, LObject L,kStrategy strat); |
---|
140 | int posInL13 (LSet set, int length, LObject L,kStrategy strat); |
---|
141 | int posInL15 (LSet set, int length, LObject L,kStrategy strat); |
---|
142 | int posInL17 (LSet set, int length, LObject L,kStrategy strat); |
---|
143 | poly redtailBba (poly p,int pos,kStrategy strat); |
---|
144 | poly redtailSyz (poly p,int pos,kStrategy strat); |
---|
145 | poly redtail (poly p,int pos,kStrategy strat); |
---|
146 | void enterpairs (poly h, int k, int ec, int pos,kStrategy strat); |
---|
147 | void entersets (LObject h); |
---|
148 | void pairs (); |
---|
149 | void message (int i,int* reduc,int* olddeg,kStrategy strat); |
---|
150 | void messageStat (int srmax,int lrmax,int hilbcount,kStrategy strat); |
---|
151 | void messageSets (kStrategy strat); |
---|
152 | void initEcartNormal (LObject* h); |
---|
153 | void initEcartBBA (LObject* h); |
---|
154 | void initS (ideal F, ideal Q,kStrategy strat); |
---|
155 | void initSL (ideal F, ideal Q,kStrategy strat); |
---|
156 | void updateS(BOOLEAN toT,kStrategy strat); |
---|
157 | void enterSBba (LObject p, int pos,kStrategy strat); |
---|
158 | void enterT (LObject p,kStrategy strat); |
---|
159 | void enterTBba (LObject p, int pos,kStrategy strat); |
---|
160 | void cancelunit (LObject* p); |
---|
161 | void HEckeTest (poly pp,kStrategy strat); |
---|
162 | void redtailS (poly* h,int maxIndex); |
---|
163 | void redtailMora (poly* h,int maxIndex); |
---|
164 | void initBuchMoraCrit(kStrategy strat); |
---|
165 | void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat); |
---|
166 | void initBuchMoraPos(kStrategy strat); |
---|
167 | void initBuchMora (ideal F, ideal Q,kStrategy strat); |
---|
168 | void exitBuchMora (kStrategy strat); |
---|
169 | void updateResult(ideal r,ideal Q,kStrategy strat); |
---|
170 | void completeReduce (kStrategy strat); |
---|
171 | BOOLEAN homogTest(polyset F, int Fmax); |
---|
172 | BOOLEAN newHEdge(polyset S, int ak,kStrategy strat); |
---|
173 | |
---|
174 | inline TSet initT () { return (TSet)Alloc(setmax*sizeof(TObject)); } |
---|
175 | #ifdef KDEBUG |
---|
176 | #define kTest(A) K_Test(__FILE__,__LINE__,A) |
---|
177 | void K_Test(char *f, int i,kStrategy strat); |
---|
178 | #else |
---|
179 | #define kTest(A) |
---|
180 | #endif |
---|
181 | #endif |
---|