Loading...
Searching...
No Matches
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 "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 220 of file walkProc.cc.

{
int k;
WalkState state= WalkOk;
if ( rChar(sring) != rChar(dring) )
{
WerrorS( "rings must have same characteristic" );
state= WalkIncompatibleRings;
}
if ( (rHasLocalOrMixedOrdering(sring))
|| (rHasLocalOrMixedOrdering(dring)) )
{
WerrorS( "only works for global orderings" );
state= WalkIncompatibleRings;
}
if ( rVar(sring) != rVar(dring) )
{
WerrorS( "rings must have same number of variables" );
state= WalkIncompatibleRings;
}
if ( rPar(sring) != rPar(dring) )
{
WerrorS( "rings must have same number of parameters" );
state= WalkIncompatibleRings;
}
if ( state != WalkOk ) return state;
// now the rings have the same number of variables resp. parameters.
// check if the names of the variables resp. parameters do agree:
int nvar = sring->N;
int npar = rPar(sring);
int * pperm;
char **snames;
char **dnames;
if ( npar > 0 )
{
snames=sring->cf->extRing->names;
dnames=dring->cf->extRing->names;
pperm= (int *)omAlloc0( (npar+1)*sizeof( int ) );
}
else
{
pperm= NULL;
snames=NULL;
dnames=NULL;
}
maFindPerm( sring->names, nvar, snames, npar,
dring->names, nvar, dnames, npar, vperm, pperm,
dring->cf->type);
for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
if ( vperm[k] <= 0 )
{
WerrorS( "variable names do not agree" );
state= WalkIncompatibleRings;
}
for ( k= npar; (k > 0) && (state == WalkOk); k-- )
if ( pperm[k-1] >= 0 )
{
WerrorS( "parameter names do not agree" );
state= WalkIncompatibleRings;
}
//check if order of variables resp. parameters does agree
//remove this to if you want to allow permutations of variables
for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
if ( vperm[k] != (k) )
{
WerrorS( "orders of variables do not agree" );
state= WalkIncompatibleRings;
}
//remove this to if you want to allow permutations of parameters
for ( k= npar; (k > 0) && (state == WalkOk); k-- )
if ( pperm[k-1] != (-k) )
{
WerrorS( "orders of parameters do not agree" );
state= WalkIncompatibleRings;
}
if (pperm != NULL)
omFreeSize( (ADDRESS)pperm, (npar+1)*sizeof( int ) );
if ( state != WalkOk ) return state;
// check if any of the rings are qrings or not
if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
{
WerrorS( "rings are not allowed to be qrings");
return WalkIncompatibleRings;
}
int i=0;
while(dring->order[i]!=0){
if( !(dring->order[i]==ringorder_lp) &&
!(dring->order[i]==ringorder_dp) &&
!(dring->order[i]==ringorder_Dp) &&
!(dring->order[i]==ringorder_wp) &&
!(dring->order[i]==ringorder_Wp) &&
!(dring->order[i]==ringorder_C) &&
!(dring->order[0]==ringorder_M)
)
{
state=WalkIncompatibleDestRing;
}
i++;
}
i=0;
while(sring->order[i]!=0)
{
if( !(sring->order[i]==ringorder_lp) &&
!(sring->order[i]==ringorder_dp) &&
!(sring->order[i]==ringorder_Dp) &&
!(sring->order[i]==ringorder_wp) &&
!(sring->order[i]==ringorder_Wp) &&
!(sring->order[i]==ringorder_C) &&
!(dring->order[0]==ringorder_M)
)
{
state=WalkIncompatibleSourceRing;
}
i++;
}
return state;
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
maFindPerm
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:155
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
rChar
int rChar(ring r)
Definition ring.cc:719
rHasLocalOrMixedOrdering
static BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition ring.h:769
rPar
static int rPar(const ring r)
(r->cf->P)
Definition ring.h:605
ringorder_lp
@ ringorder_lp
Definition ring.h:78
ringorder_C
@ ringorder_C
Definition ring.h:74
ringorder_Dp
@ ringorder_Dp
Definition ring.h:81
ringorder_dp
@ ringorder_dp
Definition ring.h:79
ringorder_Wp
@ ringorder_Wp
Definition ring.h:83
ringorder_wp
@ ringorder_wp
Definition ring.h:82
ringorder_M
@ ringorder_M
Definition ring.h:75
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
WalkState
WalkState
Definition walkMain.h:7
WalkIncompatibleDestRing
@ WalkIncompatibleDestRing
Definition walkMain.h:28
WalkIncompatibleRings
@ WalkIncompatibleRings
Definition walkMain.h:9
WalkOk
@ WalkOk
Definition walkMain.h:30
WalkIncompatibleSourceRing
@ WalkIncompatibleSourceRing
Definition walkMain.h:29

## walkConsistency()

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

Definition at line 53 of file walkProc.cc.

{
int k;
WalkState state= WalkOk;
if ( sring->cf != dring->cf )
{
WerrorS( "rings must have same characteristic" );
state= WalkIncompatibleRings;
}
else if ( (rHasLocalOrMixedOrdering(sring))
|| (rHasLocalOrMixedOrdering(dring)) )
{
WerrorS( "only works for global orderings" );
state= WalkIncompatibleRings;
}
else if ( sring->N != dring->N )
{
WerrorS( "rings must have same number of variables" );
state= WalkIncompatibleRings;
}
else if ( rPar(sring) != rPar(dring) )
{
WerrorS( "rings must have same number of parameters" );
state= WalkIncompatibleRings;
}
if ( state != WalkOk ) return state;
// now the rings have the same number of variables resp. parameters.
// check if the names of the variables resp. parameters do agree:
int nvar = rVar(sring);
int npar = rPar(sring);
int * pperm;
char **snames;
char **dnames;
if ( npar > 0 )
{
snames=sring->cf->extRing->names;
dnames=dring->cf->extRing->names;
pperm= (int *)omAlloc0( (npar+1)*sizeof( int ) );
}
else
{
snames=NULL;
dnames=NULL;
pperm= NULL;
}
maFindPerm( sring->names, nvar, snames, npar,
dring->names, nvar, dnames, npar, vperm, pperm,
dring->cf->type);
for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
if ( vperm[k] <= 0 )
{
WerrorS( "variable names do not agree" );
state= WalkIncompatibleRings;
}
for ( k= npar-1; (k >= 0) && (state == WalkOk); k-- )
if ( pperm[k] >= 0 )
{
WerrorS( "parameter names do not agree" );
state= WalkIncompatibleRings;
}
//remove this to if you want to allow permutations of variables
for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
if ( vperm[k] != (k) )
{
WerrorS( "orders of variables do not agree" );
state= WalkIncompatibleRings;
}
//remove this to if you want to allow permutations of parameters
for ( k= npar; (k > 0) && (state == WalkOk); k-- )
{
if ( pperm[k-1] != (-k) )
{
WerrorS( "orders of parameters do not agree" );
state= WalkIncompatibleRings;
}
}
if (pperm != NULL)
omFreeSize( (ADDRESS)pperm, (npar+1)*sizeof( int ) );
if ( state != WalkOk ) return state;
// check if any of the rings are qrings or not
if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
{
WerrorS( "rings are not allowed to be qrings");
return WalkIncompatibleRings;
}
int i=0;
while(dring->order[i]!=0)
{
if(
!(dring->order[i]==ringorder_a) &&
!(dring->order[i]==ringorder_a64) &&
!(dring->order[i]==ringorder_lp) &&
!(dring->order[i]==ringorder_dp) &&
!(dring->order[i]==ringorder_Dp) &&
!(dring->order[i]==ringorder_wp) &&
!(dring->order[i]==ringorder_Wp) &&
!(dring->order[i]==ringorder_C) &&
!(dring->order[i]==ringorder_M)
)
{
state=WalkIncompatibleDestRing;
}
i++;
}
i=0;
while(sring->order[i]!=0)
{
if(
!(sring->order[i]==ringorder_a) &&
!(sring->order[i]==ringorder_a64) &&
!(sring->order[i]==ringorder_lp) &&
!(sring->order[i]==ringorder_dp) &&
!(sring->order[i]==ringorder_Dp) &&
!(sring->order[i]==ringorder_wp) &&
!(sring->order[i]==ringorder_Wp) &&
!(sring->order[i]==ringorder_C) &&
!(sring->order[i]==ringorder_M)
)
{
state=WalkIncompatibleSourceRing;
}
i++;
}
return state;
}
ringorder_a
@ ringorder_a
Definition ring.h:71
ringorder_a64
@ ringorder_a64
for int64 weights
Definition ring.h:72