ideals.h
Go to the documentation of this file.
1 #ifndef IDEALS_H
2 #define IDEALS_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT - all basic methods to manipulate ideals
8 */
9 
10 #include <polys/monomials/ring.h>
12 #include <polys/simpleideals.h>
13 
14 #include <kernel/structs.h> // for tHomog
15 
16 //typedef struct sip_sideal * ideal;
17 //typedef struct sip_smap * map;
18 typedef ideal * resolvente;
19 
20 static inline ideal idCopyFirstK (const ideal ide, const int k)
21 {
22  return id_CopyFirstK(ide, k, currRing);
23 }
24 
25 void idKeepFirstK(ideal ide, const int k);
26 void idDelEquals(ideal id);
27 
28 /// delete an ideal
29 #define idDelete(H) id_Delete((H),currRing)
30 
31 /// initialise the maximal ideal (at 0)
32 //ideal id_MaxIdeal(int deg, const ring r);
33 #define idMaxIdeal(D) id_MaxIdeal(D,currRing)
34 
35 /// index of generator with leading term in ground ring (if any); otherwise -1
36 //int id_PosConstant(ideal id, const ring r)
37 #define idPosConstant(I) id_PosConstant(I,currRing)
38 
39 //BOOLEAN id_IsConstant(ideal id, const ring r);
40 #define idIsConstant(I) id_IsConstant(I,currRing)
41 
42 #define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
43 
44 ideal id_Copy (ideal h1, const ring r);
45 
46 #define idPrint(id) id_Print(id, currRing, currRing)
47 #define idTest(id) id_Test(id, currRing)
48 
49 #if 0
50 
51 // ifdef PDEBUG // Sorry: the following was lost........ :((((((((
52 ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
53 #define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
54 
55 inline ideal idCopy(ideal A)
56 {
57  return id_DBCopy(A,currRing); // well, just for now... ok? Macros can't have default args values :(
58 }
59 #else
60 inline ideal idCopy(ideal A)
61 {
62  return id_Copy(A, currRing);
63 }
64 #endif
65 
66 
67 /// h1 + h2
68 inline ideal idAdd (ideal h1, ideal h2)
69 {
70  return id_Add(h1, h2, currRing);
71 }
72 
73 BOOLEAN idInsertPoly (ideal h1,poly h2); /* h1 + h2 */
74 BOOLEAN idInsertPolyOnPos (ideal I,poly p,int pos); /* inserts p in I on pos */
75 inline BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
76 {
77  return id_InsertPolyWithTests (h1, validEntries, h2, zeroOk, duplicateOk, currRing);
78 }
79 
80 
81 /* h1 + h2 */
82 
83 /// hh := h1 * h2
84 inline ideal idMult (ideal h1, ideal h2)
85 {
86  return id_Mult(h1, h2, currRing);
87 }
88 
89 BOOLEAN idIs0 (ideal h);
90 
91 inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
92 {
93  return id_HomIdeal(id, Q, currRing);
94 }
95 
96 inline BOOLEAN idHomModule(ideal m, ideal Q,intvec **w)
97 {
98  return id_HomModule(m, Q, w, currRing);
99 }
100 
101 BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
102 
103 ideal idMinBase (ideal h1);
104  /*returns a minimized set of generators of h1*/
105 void idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
106 void idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
107 int idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
108 
109 int binom (int n,int r);
110 
111 inline ideal idFreeModule (int i)
112 {
113  return id_FreeModule (i, currRing);
114 }
115 
116 
117 ideal idSect (ideal h1,ideal h2);
118 ideal idMultSect(resolvente arg, int length);
119 
120 //ideal idSyzygies (ideal h1, tHomog h,intvec **w);
121 ideal idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
122  BOOLEAN setRegularity=FALSE, int *deg = NULL);
123 ideal idLiftStd (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
124 
125 ideal idLift (ideal mod, ideal sumod,ideal * rest=NULL,
126  BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
127  matrix *unit=NULL);
128 
129 void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
130 
131 intvec * idMWLift(ideal mod,intvec * weights);
132 
133 ideal idQuot (ideal h1,ideal h2,
134  BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
135 
136 // ideal idPower(ideal gid,int deg);
137 
138 //ideal idElimination (ideal h1,poly delVar);
139 ideal idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
140 
141 #ifdef WITH_OLD_MINOR
142 poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
143 #endif
144 ideal idMinors(matrix a, int ar, ideal R = NULL);
145 
146 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
147 
148 ideal idHead(ideal h);
149 
150 // ideal idHomogen(ideal h, int varnum);
151 
152 BOOLEAN idIsSubModule(ideal id1,ideal id2);
153 
154 static inline ideal idVec2Ideal(poly vec)
155 {
156  return id_Vec2Ideal(vec, currRing);
157 }
158 
159 ideal idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
160 
161 static inline BOOLEAN idIsZeroDim(ideal i)
162 {
163  return id_IsZeroDim(i, currRing);
164 }
165 
166 matrix idDiff(matrix i, int k);
167 matrix idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
168 
169 static inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE)
170 {
171  return id_Sort(id, nolex, currRing);
172 }
173 
174 ideal idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
175 matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how);
176 
177 // intvec *idQHomWeight(ideal id);
178 
179 ideal idXXX (ideal h1, int k);
180 
181 poly id_GCD(poly f, poly g, const ring r);
182 
183 ideal id_Farey(ideal x, number N, const ring r);
184 
185 ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
186 
187 #endif
ideal id_FreeModule(int i, const ring r)
the free module of rank i
const poly a
Definition: syzextra.cc:212
CF_NO_INLINE CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
Definition: cf_inline.cc:564
BOOLEAN idInsertPolyOnPos(ideal I, poly p, int pos)
insert p into I on position pos
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, short *w=NULL)
Definition: ideals.cc:1086
#define FALSE
Definition: auxiliary.h:95
ideal idXXX(ideal h1, int k)
Definition: ideals.cc:657
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN id_HomModule(ideal m, ideal Q, intvec **w, const ring R)
BOOLEAN id_HomIdeal(ideal id, ideal Q, const ring r)
CanonicalForm divide(const CanonicalForm &ff, const CanonicalForm &f, const CFList &as)
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
ideal idModulo(ideal h1, ideal h2, tHomog h=testHomog, intvec **w=NULL)
Definition: ideals.cc:1988
#define TRUE
Definition: auxiliary.h:99
BOOLEAN id_InsertPolyWithTests(ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk, const ring r)
insert h2 into h1 depending on the two boolean parameters:
intvec * idMWLift(ideal mod, intvec *weights)
Definition: ideals.cc:2128
g
Definition: cfModGcd.cc:4031
int k
Definition: cfEzgcd.cc:93
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:169
ideal idLift(ideal mod, ideal sumod, ideal *rest=NULL, BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE, BOOLEAN divide=FALSE, matrix *unit=NULL)
Definition: ideals.cc:891
void idDelEquals(ideal id)
Definition: ideals.cc:2563
#define Q
Definition: sirandom.c:25
ideal idLiftStd(ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL)
Definition: ideals.cc:704
static BOOLEAN idIsZeroDim(ideal i)
Definition: ideals.h:161
ideal idMinBase(ideal h1)
Definition: ideals.cc:45
ideal idHead(ideal h)
ideal idSeries(int n, ideal M, matrix U=NULL, intvec *w=NULL)
Definition: ideals.cc:1886
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
fq_nmod_poly_t * vec
Definition: facHensel.cc:103
const ring r
Definition: syzextra.cc:208
ideal idElimination(ideal h1, poly delVar, intvec *hilb=NULL)
Definition: ideals.cc:1353
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace=FALSE, intvec **w=NULL)
Definition: ideals.cc:2297
Definition: intvec.h:14
void idKeepFirstK(ideal ide, const int k)
keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero...
Definition: ideals.cc:2531
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
tHomog
Definition: structs.h:37
ideal idMinors(matrix a, int ar, ideal R=NULL)
compute all ar-minors of the matrix a the caller of mpRecMin the elements of the result are not in R ...
Definition: ideals.cc:1744
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2231
ideal idFreeModule(int i)
Definition: ideals.h:111
#define A
Definition: sirandom.c:23
poly id_GCD(poly f, poly g, const ring r)
Definition: ideals.cc:2355
const ring R
Definition: DebugPrint.cc:36
intvec * id_Sort(const ideal id, const BOOLEAN nolex, const ring r)
sorts the ideal w.r.t. the actual ringordering uses lex-ordering when nolex = FALSE ...
ideal idMultSect(resolvente arg, int length)
Definition: ideals.cc:340
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
int m
Definition: cfEzgcd.cc:119
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
FILE * f
Definition: checklibs.c:7
int i
Definition: cfEzgcd.cc:123
ideal idSect(ideal h1, ideal h2)
Definition: ideals.cc:201
ideal idCopy(ideal A)
Definition: ideals.h:60
ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition: ideals.h:84
ideal id_Mult(ideal h1, ideal h2, const ring R)
h1 * h2 one h_i must be an ideal (with at least one column) the other h_i may be a module (with no co...
BOOLEAN idInsertPolyWithTests(ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
Definition: ideals.h:75
static ideal idCopyFirstK(const ideal ide, const int k)
Definition: ideals.h:20
#define NULL
Definition: omList.c:10
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:91
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp=TRUE, BOOLEAN setRegularity=FALSE, int *deg=NULL)
Definition: ideals.cc:515
ideal id_Add(ideal h1, ideal h2, const ring r)
h1 + h2
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
const CanonicalForm & w
Definition: facAbsFact.cc:55
Variable x
Definition: cfModGcd.cc:4023
ideal id_Farey(ideal x, number N, const ring r)
Definition: ideals.cc:2455
BOOLEAN idIsSubModule(ideal id1, ideal id2)
Definition: ideals.cc:1813
ideal * resolvente
Definition: ideals.h:18
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE)
Definition: ideals.cc:1260
BOOLEAN id_IsZeroDim(ideal I, const ring r)
ideal id_CopyFirstK(const ideal ide, const int k, const ring r)
copies the first k (>= 1) entries of the given ideal/module and returns these as a new ideal/module (...
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply=TRUE)
Definition: ideals.cc:1916
int idGetNumberOfChoise(int t, int d, int begin, int end, int *choise)
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition: ideals.h:68
ideal id_Vec2Ideal(poly vec, const ring R)
kBucketDestroy & P
Definition: myNF.cc:191
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:154
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:86
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
int binom(int n, int r)
matrix idDiff(matrix i, int k)
Definition: ideals.cc:1903
int l
Definition: cfEzgcd.cc:94