lift.cc
Go to the documentation of this file.
1 #include <witness.h>
2 
3 /***
4  * Suppose r and s are the same ring but with two adjacent orderings,
5  * w is a weight vector in the relative interior of their common facet.
6  * Given a standard basis of an ideal I with respect to the ordering of r,
7  * a standard basis of its w-initial ideal inI with respect to
8  * the ordering of s, computes a standard basis of I with respect to
9  * the ordering of s.
10  **/
11 // ideal lift(const ideal I, const ring r, const ideal inI, const ring s)
12 // {
13 // nMapFunc identity = n_SetMap(r->cf,s->cf);
14 // int k = idSize(I); ideal Is = idInit(k);
15 // for (int i=0; i<k; i++)
16 // Is->m[i] = p_PermPoly(I->m[i],NULL,r,s,identity,NULL,0);
17 // ideal J = idInit(k);
18 // for (int i=0; i<k; i++)
19 // J->m[i] = witness(inI->m[i],Is,inI,s);
20 // id_Delete(&Is,s);
21 // return J;
22 // }
23 
24 ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
25 {
26  nMapFunc identity = n_SetMap(s->cf,r->cf);
27  int k = idSize(inI); ideal inIr = idInit(k);
28  for (int i=0; i<k; i++)
29  inIr->m[i] = p_PermPoly(inI->m[i],NULL,s,r,identity,NULL,0);
30  ideal Ir = witness(inIr,J,r);
31 
32  identity = n_SetMap(r->cf,s->cf);
33  ideal Is = idInit(k);
34  for (int i=0; i<k; i++)
35  Is->m[i] = p_PermPoly(Ir->m[i],NULL,r,s,identity,NULL,0);
36 
37  id_Delete(&inIr,r);
38  id_Delete(&Ir,r);
39  return Is;
40 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int k
Definition: cfEzgcd.cc:93
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
Definition: lift.cc:24
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3937
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:722
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
poly witness(const poly m, const ideal I, const ideal inI, const ring r)
Let w be the uppermost weight vector in the matrix defining the ordering on r.
Definition: witness.cc:34
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43