58 if ( sring->cf != dring->cf )
60 WerrorS(
"rings must have same characteristic" );
66 WerrorS(
"only works for global orderings" );
69 else if ( sring->N != dring->N )
71 WerrorS(
"rings must have same number of variables" );
74 else if (
rPar(sring) !=
rPar(dring) )
76 WerrorS(
"rings must have same number of parameters" );
80 if ( state !=
WalkOk )
return state;
84 int nvar =
rVar(sring);
85 int npar =
rPar(sring);
91 snames=sring->cf->extRing->names;
92 dnames=dring->cf->extRing->names;
93 pperm= (
int *)
omAlloc0( (npar+1)*
sizeof( int ) );
103 dring->names, nvar, dnames, npar, vperm, pperm,
106 for (
k= nvar; (
k > 0) && (state ==
WalkOk);
k-- )
109 WerrorS(
"variable names do not agree" );
113 for (
k= npar-1; (
k >= 0) && (state ==
WalkOk);
k-- )
116 WerrorS(
"parameter names do not agree" );
121 for (
k= nvar; (
k > 0) && (state ==
WalkOk);
k-- )
122 if ( vperm[
k] != (
k) )
124 WerrorS(
"orders of variables do not agree" );
129 for (
k= npar; (
k > 0) && (state ==
WalkOk);
k-- )
131 if ( pperm[
k-1] != (-
k) )
133 WerrorS(
"orders of parameters do not agree" );
140 if ( state !=
WalkOk )
return state;
143 if ( (sring->qideal !=
NULL) || (dring->qideal !=
NULL) )
145 WerrorS(
"rings are not allowed to be qrings");
150 while(dring->order[
i]!=0)
170 while(sring->order[
i]!=0)
227 WerrorS(
"rings must have same characteristic" );
234 WerrorS(
"only works for global orderings" );
240 WerrorS(
"rings must have same number of variables" );
246 WerrorS(
"rings must have same number of parameters" );
250 if ( state !=
WalkOk )
return state;
255 int npar =
rPar(sring);
262 snames=sring->cf->extRing->names;
263 dnames=dring->cf->extRing->names;
264 pperm= (
int *)
omAlloc0( (npar+1)*
sizeof( int ) );
274 dring->names, nvar, dnames, npar, vperm, pperm,
277 for (
k= nvar; (
k > 0) && (state ==
WalkOk);
k-- )
280 WerrorS(
"variable names do not agree" );
284 for (
k= npar; (
k > 0) && (state ==
WalkOk);
k-- )
285 if ( pperm[
k-1] >= 0 )
287 WerrorS(
"parameter names do not agree" );
293 for (
k= nvar; (
k > 0) && (state ==
WalkOk);
k-- )
294 if ( vperm[
k] != (
k) )
296 WerrorS(
"orders of variables do not agree" );
301 for (
k= npar; (
k > 0) && (state ==
WalkOk);
k-- )
302 if ( pperm[
k-1] != (-
k) )
304 WerrorS(
"orders of parameters do not agree" );
311 if ( state !=
WalkOk )
return state;
314 if ( (sring->qideal !=
NULL) || (dring->qideal !=
NULL) )
316 WerrorS(
"rings are not allowed to be qrings");
321 while(dring->order[
i]!=0){
337 while(sring->order[
i]!=0)
void WerrorS(const char *s)
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)
#define omFreeSize(addr, size)
Compatibility layer for legacy polynomial operations (over currRing)
static int rPar(const ring r)
(r->cf->P)
@ ringorder_a64
for int64 weights
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
@ WalkIncompatibleDestRing
@ WalkIncompatibleSourceRing
WalkState fractalWalkConsistency(ring sring, ring dring, int *vperm)
WalkState walkConsistency(ring sring, ring dring, int *vperm)