29#define MAX_MAP_DEG 128
94 for(
i=1;
i<=preimage_r->N;
i++)
99 if (theMap->m[
i-1]!=
NULL)
101 poly p1=theMap->m[
i-1];
155void maFindPerm(
char const *
const *
const preim_names,
int preim_n,
char const *
const *
const preim_par,
int preim_p,
156 char const *
const *
const names,
int n,
char const *
const *
const par,
int nop,
161 for (
i=0;
i<preim_n;
i++)
165 if (strcmp(preim_names[
i],names[
j])==0)
168 Print(
"// var %s: nr %d -> nr %d\n",preim_names[
i],
i+1,
j+1);
174 if ((perm[
i+1]==0)&&(par!=
NULL)
180 if (strcmp(preim_names[
i],par[
j])==0)
183 Print(
"// var %s: nr %d -> par %d\n",preim_names[
i],
i+1,
j+1);
192 for (
i=0;
i<preim_p;
i++)
196 if (strcmp(preim_par[
i],names[
j])==0)
199 Print(
"// par %s: par %d -> nr %d\n",preim_par[
i],
i+1,
j+1);
205 if ((par!=
NULL) && (par_perm[
i]==0))
209 if (strcmp(preim_par[
i],par[
j])==0)
212 Print(
"// par %s: nr %d -> par %d\n",preim_par[
i],
i+1,
j+1);
223void maFindPermLP(
char const *
const *
const preim_names,
int preim_n,
char const *
const *
const preim_par,
int preim_p,
224 char const *
const *
const names,
int n,
char const *
const *
const par,
int nop,
229 for (
b=0;
b<preim_n/lV;
b++)
231 for (
i=
b*lV;
i<(
b+1)*lV;
i++)
236 if (strcmp(preim_names[
i],names[
j])==0)
241 Print(
"// var %s: nr %d -> nr %d\n",preim_names[
i],
i+1,
j+1);
249 if ((perm[
i+1]==0)&&(par!=
NULL)
255 if (strcmp(preim_names[
i],par[
j])==0)
258 Print(
"// var %s: nr %d -> par %d\n",preim_names[
i],
i+1,
j+1);
268 for (
i=0;
i<preim_p;
i++)
272 if (strcmp(preim_par[
i],names[
j])==0)
275 Print(
"// par %s: par %d -> nr %d\n",preim_par[
i],
i+1,
j+1);
281 if ((par!=
NULL) && (par_perm[
i]==0))
285 if (strcmp(preim_par[
i],par[
j])==0)
288 Print(
"// par %s: nr %d -> par %d\n",preim_par[
i],
i+1,
j+1);
301 for (
int i = 0;
i < preimage_r->N + 1;
i++) { perm[
i] = 0; }
303 int preimage_lV = preimage_r->isLPring;
304 int r_lV = dst_r->isLPring;
306 int preimage_ncgens = preimage_r->LPncGenCount;
307 int r_ncges = dst_r->LPncGenCount;
309 int preimage_vars = preimage_lV - preimage_ncgens;
310 int r_vars = r_lV - r_ncges;
313 for (
int i = 0;
i <
si_min(preimage_r->N / preimage_lV, dst_r->N / r_lV);
i++)
316 for (
int j = 1;
j <=
si_min(preimage_vars, r_vars);
j++)
318 perm[(
i * preimage_lV) +
j] = (
i * r_lV) +
j;
322 for (
int j = 1;
j <=
si_min(preimage_ncgens, r_ncges);
j++)
324 perm[(
i * preimage_lV) + preimage_vars +
j] = (
i * r_lV) + r_vars +
j;
336 if(r==dst_r)
return p_Copy(
p,dst_r);
338 int *perm=(
int *)
omAlloc0((r->N+1)*
sizeof(
int));
342 perm,
NULL, dst_r->cf->type);
355 int N = preimage_r->N;
371 goto max_deg_fertig_id;
393 int N = preimage_r->N;
405 goto max_deg_fertig_p;
425 number one =
n_Init(1, C);
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
const CanonicalForm CFMap CFMap & N
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
map maCopy(map theMap, const ring r)
poly maEval(map theMap, poly p, ring preimage_r, nMapFunc nMap, ideal s, const ring dst_r)
void maFetchPermLP(const ring preimage_r, const ring dst_r, int *perm)
poly maIMap(ring r, poly p, const ring dst_r)
int maMaxDeg_P(poly p, ring preimage_r)
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)
static poly maEvalMonom(map theMap, poly p, ring preimage_r, ideal s, nMapFunc nMap, const ring dst_r)
void maFindPermLP(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, int lV)
poly maEvalVariable(poly p, int v, int pExp, ideal s, const ring dst_r)
int maMaxDeg_Ma(ideal a, ring preimage_r)
poly p_MinPolyNormalize(poly p, const ring r)
#define MATELEM(mat, i, j)
1-based access to matrix
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
The main handler for Singular numbers which are suitable for Singular polynomials.
#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)
poly p_Power(poly p, int i, const ring r)
void p_Normalize(poly p, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static int pLength(poly a)
static void p_LmDelete(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static void p_SetCompP(poly p, int i, ring r)
static number p_SetCoeff(poly p, number n, ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static void p_Delete(poly *p, const ring r)
static poly pp_Mult_qq(poly p, poly q, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static int rPar(const ring r)
(r->cf->P)
static char const ** rParameter(const ring r)
(r->cf->parameter)
static short rVar(const ring r)
define rVar(r) (r->N)
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
sBucket_pt sBucketCreate(const ring r)
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
ideal idInit(int idsize, int rank)
initialise an ideal / module