129 ring dring =
IDRING( dringHdl );
130 ring sring =
IDRING( sringHdl );
134 WerrorS(
"rings must have same characteristic" );
137 if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) )
139 WerrorS(
"only works for global orderings" );
142 if ( sring->N != dring->N )
144 WerrorS(
"rings must have same number of variables" );
149 WerrorS(
"rings must have same number of parameters" );
152 if ( state !=
FglmOk )
return state;
156 int npar =
rPar(sring);
159 pperm= (
int *)
omAlloc0( (npar+1)*
sizeof( int ) );
163 dring->names, nvar,
rParameter(dring), npar, vperm, pperm,
165 for (
k= nvar; (
k > 0) && (state ==
FglmOk);
k-- )
168 WerrorS(
"variable names do not agree" );
171 for (
k= npar-1; (
k >= 0) && (state ==
FglmOk);
k-- )
174 WerrorS(
"parameter names do not agree" );
179 if ( state !=
FglmOk )
return state;
181 if ( sring->qideal !=
NULL )
183 if ( dring->qideal ==
NULL )
185 Werror(
"%s is a qring, current ring not", sringHdl->
id );
193 for (
k=
IDELEMS( sring->qideal )-1;
k >= 0;
k-- )
194 (sqind->m)[
k]=
p_PermPoly( (sring->qideal->m)[
k], vperm, sring,
196 ideal sqindred =
kNF( dring->qideal,
NULL, sqind );
197 if ( !
idIs0( sqindred ) )
199 WerrorS(
"the quotients do not agree" );
205 if ( state !=
FglmOk )
return state;
207 int * dsvperm = (
int *)
omAlloc0( (nvar+1)*
sizeof( int ) );
209 dsvperm,
NULL, sring->cf->type);
212 for (
k=
IDELEMS( dring->qideal )-1;
k >= 0;
k-- )
213 (dqins->m)[
k]=
p_PermPoly( (dring->qideal->m)[
k], dsvperm, sring,
215 ideal dqinsred =
kNF( sring->qideal,
NULL, dqins );
216 if ( !
idIs0( dqinsred ) )
218 WerrorS(
"the quotients do not agree" );
224 if ( state !=
FglmOk )
return state;
228 if ( dring->qideal !=
NULL )
230 Werror(
"current ring is a qring, %s not", sringHdl->
id );
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void WerrorS(const char *s)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
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)
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void Werror(const char *fmt,...)
static char const ** rParameter(const ring r)
(r->cf->parameter)
static int rPar(const ring r)
(r->cf->P)
ideal idInit(int idsize, int rank)
initialise an ideal / module