Functions
walkProc.cc File Reference
#include <kernel/mod2.h>
#include <kernel/structs.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include <polys/monomials/ring.h>
#include <polys/monomials/maps.h>
#include <omalloc/omalloc.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/fglm/fglm.h>
#include <kernel/groebner_walk/walkMain.h>
#include <kernel/groebner_walk/walkSupport.h>
#include <kernel/groebner_walk/walkProc.h>
#include <polys/prCopy.h>

Go to the source code of this file.

Functions

WalkState walkConsistency (ring sring, ring dring, int *vperm)
 
WalkState fractalWalkConsistency (ring sring, ring dring, int *vperm)
 

Function Documentation

§ fractalWalkConsistency()

WalkState fractalWalkConsistency ( ring  sring,
ring  dring,
int *  vperm 
)

Definition at line 223 of file walkProc.cc.

224 {
225  int k;
226  WalkState state= WalkOk;
227 
228  if ( rChar(sring) != rChar(dring) )
229  {
230  WerrorS( "rings must have same characteristic" );
231  state= WalkIncompatibleRings;
232  }
233 
234  if ( (rHasLocalOrMixedOrdering(sring))
235  || (rHasLocalOrMixedOrdering(dring)) )
236  {
237  WerrorS( "only works for global orderings" );
238  state= WalkIncompatibleRings;
239  }
240 
241  if ( rVar(sring) != rVar(dring) )
242  {
243  WerrorS( "rings must have same number of variables" );
244  state= WalkIncompatibleRings;
245  }
246 
247  if ( rPar(sring) != rPar(dring) )
248  {
249  WerrorS( "rings must have same number of parameters" );
250  state= WalkIncompatibleRings;
251  }
252 
253  if ( state != WalkOk ) return state;
254 
255  // now the rings have the same number of variables resp. parameters.
256  // check if the names of the variables resp. parameters do agree:
257  int nvar = sring->N;
258  int npar = rPar(sring);
259  int * pperm;
260  char **snames;
261  char **dnames;
262 
263  if ( npar > 0 )
264  {
265  snames=sring->cf->extRing->names;
266  dnames=dring->cf->extRing->names;
267  pperm= (int *)omAlloc0( (npar+1)*sizeof( int ) );
268  }
269  else
270  {
271  pperm= NULL;
272  snames=NULL;
273  dnames=NULL;
274  }
275 
276  maFindPerm( sring->names, nvar, snames, npar,
277  dring->names, nvar, dnames, npar, vperm, pperm,
278  dring->cf->type);
279 
280  for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
281  if ( vperm[k] <= 0 )
282  {
283  WerrorS( "variable names do not agree" );
284  state= WalkIncompatibleRings;
285  }
286 
287  for ( k= npar; (k > 0) && (state == WalkOk); k-- )
288  if ( pperm[k-1] >= 0 )
289  {
290  WerrorS( "parameter names do not agree" );
291  state= WalkIncompatibleRings;
292  }
293 
294  //check if order of variables resp. parameters does agree
295  //remove this to if you want to allow permutations of variables
296  for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
297  if ( vperm[k] != (k) )
298  {
299  WerrorS( "orders of variables do not agree" );
300  state= WalkIncompatibleRings;
301  }
302 
303  //remove this to if you want to allow permutations of parameters
304  for ( k= npar; (k > 0) && (state == WalkOk); k-- )
305  if ( pperm[k-1] != (-k) )
306  {
307  WerrorS( "orders of parameters do not agree" );
308  state= WalkIncompatibleRings;
309  }
310 
311  if (pperm != NULL)
312  omFreeSize( (ADDRESS)pperm, (npar+1)*sizeof( int ) );
313 
314  if ( state != WalkOk ) return state;
315 
316  // check if any of the rings are qrings or not
317  if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
318  {
319  WerrorS( "rings are not allowed to be qrings");
320  return WalkIncompatibleRings;
321  }
322 
323  int i=0;
324  while(dring->order[i]!=0){
325  if( !(dring->order[i]==ringorder_lp) &&
326  !(dring->order[i]==ringorder_dp) &&
327  !(dring->order[i]==ringorder_Dp) &&
328  !(dring->order[i]==ringorder_wp) &&
329  !(dring->order[i]==ringorder_Wp) &&
330  !(dring->order[i]==ringorder_C) &&
331  !(dring->order[0]==ringorder_M)
332  )
333  {
335  }
336  i++;
337  }
338 
339  i=0;
340  while(sring->order[i]!=0)
341  {
342  if( !(sring->order[i]==ringorder_lp) &&
343  !(sring->order[i]==ringorder_dp) &&
344  !(sring->order[i]==ringorder_Dp) &&
345  !(sring->order[i]==ringorder_wp) &&
346  !(sring->order[i]==ringorder_Wp) &&
347  !(sring->order[i]==ringorder_C) &&
348  !(dring->order[0]==ringorder_M)
349  )
350  {
352  }
353  i++;
354  }
355 
356  return state;
357 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:747
WalkState
Definition: walkMain.h:7
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int rChar(ring r)
Definition: ring.cc:684
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
void * ADDRESS
Definition: auxiliary.h:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
int i
Definition: cfEzgcd.cc:123
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition: maps.cc:169
#define NULL
Definition: omList.c:10
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ walkConsistency()

WalkState walkConsistency ( ring  sring,
ring  dring,
int *  vperm 
)

Definition at line 57 of file walkProc.cc.

58 {
59  int k;
60  WalkState state= WalkOk;
61 
62  if ( rChar(sring) != rChar(dring) )
63  {
64  WerrorS( "rings must have same characteristic" );
65  state= WalkIncompatibleRings;
66  }
67  else if ( (rHasLocalOrMixedOrdering(sring))
68  || (rHasLocalOrMixedOrdering(dring)) )
69  {
70  WerrorS( "only works for global orderings" );
71  state= WalkIncompatibleRings;
72  }
73  else if ( sring->N != dring->N )
74  {
75  WerrorS( "rings must have same number of variables" );
76  state= WalkIncompatibleRings;
77  }
78  else if ( rPar(sring) != rPar(dring) )
79  {
80  WerrorS( "rings must have same number of parameters" );
81  state= WalkIncompatibleRings;
82  }
83 
84  if ( state != WalkOk ) return state;
85  // now the rings have the same number of variables resp. parameters.
86  // check if the names of the variables resp. parameters do agree:
87 
88  int nvar = rVar(sring);
89  int npar = rPar(sring);
90  int * pperm;
91  char **snames;
92  char **dnames;
93  if ( npar > 0 )
94  {
95  snames=sring->cf->extRing->names;
96  dnames=dring->cf->extRing->names;
97  pperm= (int *)omAlloc0( (npar+1)*sizeof( int ) );
98  }
99  else
100  {
101  snames=NULL;
102  dnames=NULL;
103  pperm= NULL;
104  }
105 
106  maFindPerm( sring->names, nvar, snames, npar,
107  dring->names, nvar, dnames, npar, vperm, pperm,
108  dring->cf->type);
109 
110  for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
111  if ( vperm[k] <= 0 )
112  {
113  WerrorS( "variable names do not agree" );
114  state= WalkIncompatibleRings;
115  }
116 
117  for ( k= npar-1; (k >= 0) && (state == WalkOk); k-- )
118  if ( pperm[k] >= 0 )
119  {
120  WerrorS( "parameter names do not agree" );
121  state= WalkIncompatibleRings;
122  }
123 
124  //remove this to if you want to allow permutations of variables
125  for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
126  if ( vperm[k] != (k) )
127  {
128  WerrorS( "orders of variables do not agree" );
129  state= WalkIncompatibleRings;
130  }
131 
132  //remove this to if you want to allow permutations of parameters
133  for ( k= npar; (k > 0) && (state == WalkOk); k-- )
134  if ( pperm[k-1] != (-k) )
135  {
136  WerrorS( "orders of parameters do not agree" );
137  state= WalkIncompatibleRings;
138  }
139 
140  if (pperm != NULL)
141  omFreeSize( (ADDRESS)pperm, (npar+1)*sizeof( int ) );
142 
143  if ( state != WalkOk ) return state;
144 
145  // check if any of the rings are qrings or not
146  if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
147  {
148  WerrorS( "rings are not allowed to be qrings");
149  return WalkIncompatibleRings;
150  }
151 
152  int i=0;
153  while(dring->order[i]!=0)
154  {
155  if(
156  !(dring->order[i]==ringorder_a) &&
157  !(dring->order[i]==ringorder_a64) &&
158  !(dring->order[i]==ringorder_lp) &&
159  !(dring->order[i]==ringorder_dp) &&
160  !(dring->order[i]==ringorder_Dp) &&
161  !(dring->order[i]==ringorder_wp) &&
162  !(dring->order[i]==ringorder_Wp) &&
163  !(dring->order[i]==ringorder_C) &&
164  !(dring->order[i]==ringorder_M)
165  )
166  {
168  }
169  i++;
170  }
171 
172  i=0;
173  while(sring->order[i]!=0)
174  {
175  if(
176  !(sring->order[i]==ringorder_a) &&
177  !(sring->order[i]==ringorder_a64) &&
178  !(sring->order[i]==ringorder_lp) &&
179  !(sring->order[i]==ringorder_dp) &&
180  !(sring->order[i]==ringorder_Dp) &&
181  !(sring->order[i]==ringorder_wp) &&
182  !(sring->order[i]==ringorder_Wp) &&
183  !(sring->order[i]==ringorder_C) &&
184  !(sring->order[i]==ringorder_M)
185  )
186  {
188  }
189  i++;
190  }
191 
192  return state;
193 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:747
for int64 weights
Definition: ring.h:79
WalkState
Definition: walkMain.h:7
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:587
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
int rChar(ring r)
Definition: ring.cc:684
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
void * ADDRESS
Definition: auxiliary.h:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
int i
Definition: cfEzgcd.cc:123
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition: maps.cc:169
#define NULL
Definition: omList.c:10
#define omAlloc0(size)
Definition: omAllocDecl.h:211