62 for (
k=
IDELEMS( sourceIdeal )-1;
k >=0;
k-- )
63 (newSource->m)[
k]=
pCopy( (sourceIdeal->m)[
k] );
126 if ( sring->cf != dring->cf )
128 WerrorS(
"rings must have same characteristic" );
131 if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) )
133 WerrorS(
"only works for global orderings" );
136 if ( sring->N != dring->N )
138 WerrorS(
"rings must have same number of variables" );
143 WerrorS(
"rings must have same number of parameters" );
146 if ( state !=
FglmOk )
return state;
150 int npar =
rPar(sring);
153 pperm= (
int *)
omAlloc0( (npar+1)*
sizeof( int ) );
157 dring->names, nvar,
rParameter(dring), npar, vperm, pperm,
159 for (
k= nvar; (
k > 0) && (state ==
FglmOk);
k-- )
162 WerrorS(
"variable names do not agree" );
165 for (
k= npar-1; (
k >= 0) && (state ==
FglmOk);
k-- )
168 WerrorS(
"parameter names do not agree" );
173 if ( state !=
FglmOk )
return state;
175 if ( sring->qideal !=
NULL )
177 if ( dring->qideal ==
NULL )
179 WerrorS(
"source ring is a qring, destination ring not" );
187 for (
k=
IDELEMS( sring->qideal )-1;
k >= 0;
k-- )
188 (sqind->m)[
k]=
p_PermPoly( (sring->qideal->m)[
k], vperm, sring,
190 ideal sqindred =
kNF( dring->qideal,
NULL, sqind );
191 if ( !
idIs0( sqindred ) )
193 WerrorS(
"the quotients do not agree" );
199 if ( state !=
FglmOk )
return state;
201 int * dsvperm = (
int *)
omAlloc0( (nvar+1)*
sizeof( int ) );
203 dsvperm,
NULL, sring->cf->type);
206 for (
k=
IDELEMS( dring->qideal )-1;
k >= 0;
k-- )
207 (dqins->m)[
k]=
p_PermPoly( (dring->qideal->m)[
k], dsvperm, sring,
209 ideal dqinsred =
kNF( sring->qideal,
NULL, dqins );
210 if ( !
idIs0( dqinsred ) )
212 WerrorS(
"the quotients do not agree" );
218 if ( state !=
FglmOk )
return state;
222 if ( dring->qideal !=
NULL )
224 WerrorS(
"source ring is a qring, destination ring not" );
249 poly
p = (theIdeal->m)[
k];
283 ideal destIdeal =
NULL;
284 ring sourceRing = (ring)first->
Data();
288 int * vperm = (
int *)
omAlloc0( (sourceRing->N+1)*
sizeof( int ) );
298 if ( sourceRing->qideal !=
NULL )
321 (destIdeal->m)[0]=
pOne();
325 WerrorS(
"source ring and current ring are incompatible" );
329 Werror(
"Can't find ideal %s in source ring", second->
Name() );
333 Werror(
"The ideal %s has to be 0-dimensional", second->
Name() );
337 Werror(
"The ideal %s has to be given by a reduced SB", second->
Name() );
345 result->data= (
void *)destIdeal;
354 ideal sourceIdeal = first;
356 ideal destIdeal =
NULL;
377 (destIdeal->m)[0]=
pOne();
381 WerrorS(
"The ideal has to be 0-dimensional" );
385 WerrorS(
"The poly has to be reduced" );
391 for (
k=
IDELEMS( sourceIdeal )-1;
k >=0;
k-- )
392 (destIdeal->m)[
k]=
pCopy( (sourceIdeal->m)[
k] );
397 (destIdeal->m)[0]=
pOne();
416 ideal sourceIdeal = (ideal)first->
Data();
417 poly quot = (poly)second->
Data();
418 ideal destIdeal =
NULL;
440 (destIdeal->m)[0]=
pOne();
444 Werror(
"The ideal %s has to be 0-dimensional", first->
Name() );
448 Werror(
"The poly %s has to be reduced", second->
Name() );
454 for (
k=
IDELEMS( sourceIdeal )-1;
k >=0;
k-- )
455 (destIdeal->m)[
k]=
pCopy( (sourceIdeal->m)[
k] );
460 (destIdeal->m)[0]=
pOne();
468 result->data= (
void *)destIdeal;
477 ideal destIdeal =
NULL;
490 for (
k=
IDELEMS( sourceIdeal ) - 1;
k >= 0;
k-- )
494 if (purePowers[
i-1]==0)
519 (destIdeal->m)[0]=
pOne();
523 WerrorS(
"The ideal has to be 0-dimensional" );
527 Werror(
"The ideal has to be reduced" );
544 ideal destIdeal =
NULL;
547 sourceIdeal = (ideal)first->
Data();
558 for (
k=
IDELEMS( sourceIdeal ) - 1;
k >= 0;
k-- )
562 if (purePowers[
i-1]==0)
587 (destIdeal->m)[0]=
pOne();
591 Werror(
"The ideal %s has to be 0-dimensional", first->
Name() );
595 Werror(
"The ideal %s has to be reduced", first->
Name() );
603 result->data= (
void *)destIdeal;
const CanonicalForm CFMap CFMap & N
idhdl get(const char *s, int lev)
Class used for (list of) interpreter objects.
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)
ideal fglmQuot(ideal first, poly second)
BOOLEAN fglmProc(leftv result, leftv first, leftv second)
FglmState fglmConsistency(ring sring, ring dring, int *vperm)
BOOLEAN fglmQuotProc(leftv result, leftv first, leftv second)
FglmState fglmIdealcheck(const ideal theIdeal)
ideal fglmUpdatesource(const ideal sourceIdeal)
void fglmUpdateresult(ideal &result)
BOOLEAN findUniProc(leftv result, leftv first)
ideal findUni(ideal first)
BOOLEAN FindUnivariateWrapper(ideal source, ideal &destIdeal)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define fglmASSERT(ignore1, ignore2)
BOOLEAN fglmzero(ring sourceRing, ideal &sourceIdeal, ring destRing, ideal &destideal, BOOLEAN switchBack=TRUE, BOOLEAN deleteIdeal=FALSE)
BOOLEAN fglmquot(ideal sourceIdeal, poly quot, ideal &destIdeal)
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)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pIsConstant(p)
like above, except that Comp must be 0
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
#define pCopy(p)
return a copy of the poly
void Werror(const char *fmt,...)
static int rPar(const ring r)
(r->cf->P)
static char const ** rParameter(const ring r)
(r->cf->parameter)
int status int void size_t count
ideal idInit(int idsize, int rank)
initialise an ideal / module
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
BOOLEAN assumeStdFlag(leftv h)