# source:git/kernel/ideals.h@e511e0

spielwiese
Last change on this file since e511e0 was e511e0, checked in by Hans Schoenemann <hannes@…>, 12 years ago
fix: idJet,idJetW,idModule2formatedMatrix -> id_Jet,id_JetW,id_Module2formatedMatrix
• Property mode set to `100644`
File size: 5.7 KB
Line
1#ifndef IDEALS_H
2#define IDEALS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* \$Id\$ */
7/*
8* ABSTRACT - all basic methods to manipulate ideals
9*/
10#include <polys/simpleideals.h>
11#include <kernel/polys.h>
12// #include <kernel/structs.h>
13
14//typedef struct sip_sideal *        ideal;
15//typedef struct sip_smap *          map;
16typedef ideal *            resolvente;
17
18extern ideal currQuotient;
19
20
21inline ideal idCopyFirstK (const ideal ide, const int k, ring R = currRing)
22{
23  return id_CopyFirstK(ide, k, R);
24}
25
26/// delete an ideal
27inline void idDelete (ideal* h, ring r = currRing)
28{
29  id_Delete(h, r);
30}
31
32/// initialise the maximal ideal (at 0)
33//ideal id_MaxIdeal(int deg, const ring r);
34#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
35
36/// index of generator with leading term in ground ring (if any); otherwise -1
37//int id_PosConstant(ideal id, const ring r)
38#define idPosConstant(I) id_PosConstant(I,currRing)
39
40/// Count the effective size of an ideal
41/// (without the trailing allocated zero-elements)
42static inline int idSize(const ideal id)
43{
44  int j = IDELEMS(id) - 1;
45  poly* mm = id->m;
46  while ((j >= 0) && (mm[j] == NULL)) j--;
47  return (j + 1);
48}
49
50
51//BOOLEAN id_IsConstant(ideal id, const ring r);
52#define idIsConstant(I) id_IsConstant(I,currRing)
53
55
56#ifdef PDEBUG
57#define idTest(A) id_DBTest(A, PDEBUG, __FILE__,__LINE__,currRing)
58#define idPrint(id) idShow(id, currRing, currRing)
59#else
60#define idTest(A)  (TRUE)
61#define idPrint(A) ((void)0)
62#endif
63
64ideal id_Copy (ideal h1, const ring r);
65
66#if 0
67
68// ifdef PDEBUG // Sorry: the following was lost........ :((((((((
69ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
70#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
71
72inline ideal idCopy(ideal A, const ring R = currRing)
73{
74  return id_DBCopy(A,R); // well, just for now... ok? Macros can't  have default args values :(
75}
76#else
77inline ideal idCopy(ideal A, const ring R = currRing)
78{
79  return id_Copy(A, R);
80}
81#endif
82
83
84/// h1 + h2
85inline ideal idAdd (ideal h1, ideal h2, const ring R = currRing)
86{
88}
89
90BOOLEAN idInsertPoly (ideal h1,poly h2);  /* h1 + h2 */
91inline BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk, const ring R = currRing)
92{
93  return id_InsertPolyWithTests (h1, validEntries, h2, zeroOk, duplicateOk, R);
94}
95
96
97/* h1 + h2 */
98
99/// hh := h1 * h2
100inline ideal idMult (ideal h1, ideal h2, const ring R = currRing)
101{
102  return id_Mult(h1, h2, R);
103}
104
105BOOLEAN idIs0 (ideal h);
106
107// returns TRUE, if idRankFreeModule(m) > 0
108BOOLEAN idIsModule(ideal m, const ring r);
109
110inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL, const ring R = currRing)
111{
112  return id_HomIdeal(id, Q, R);
113}
114
115inline BOOLEAN idHomModule(ideal m, ideal Q,intvec **w, const ring R = currRing)
116{
117   return id_HomModule(m, Q, w, R);
118}
119
120BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
121
122ideal idMinBase (ideal h1);
123  /*returns a minimized set of generators of h1*/
124void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
125void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
126int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
127
128int     binom (int n,int r);
129
130inline ideal idFreeModule (int i, const ring R = currRing)
131{
132  return id_FreeModule (i, R);
133}
134
135
136
137
138ideal   idSect (ideal h1,ideal h2);
139ideal   idMultSect(resolvente arg, int length);
140
141//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
142ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
143                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
144ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
145
146ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
147             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
148             matrix *unit=NULL);
149
150void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
151
152intvec * idMWLift(ideal mod,intvec * weights);
153
154ideal   idQuot (ideal h1,ideal h2,
155                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
156
157// ideal   idPower(ideal gid,int deg);
158
159//ideal   idElimination (ideal h1,poly delVar);
160ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
161
162poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
163ideal   idMinors(matrix a, int ar, ideal R = NULL);
164
165ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
166
168
169// ideal   idHomogen(ideal h, int varnum);
170
171BOOLEAN idIsSubModule(ideal id1,ideal id2);
172
173inline ideal idVec2Ideal(poly vec, const ring R = currRing)
174{
175  return id_Vec2Ideal(vec, R);
176}
177
178ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
179
180inline BOOLEAN idIsZeroDim(ideal i, const ring R = currRing)
181{
182  return idIsZeroDim(i, R);
183}
184
185matrix  idDiff(matrix i, int k);
186matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
187
188inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE, const ring R = currRing)
189{
190  return id_Sort(id, nolex, R);
191}
192
193ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
194matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
195
196/// transpose a module
197inline ideal   idTransp(ideal a, const ring R = currRing)
198{
199  return id_Transp(a, R);
200}
201
202// intvec *idQHomWeight(ideal id);
203
204ideal idXXX (ideal  h1, int k);
205
206poly id_GCD(poly f, poly g, const ring r);
207
208ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R);
209//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
210ideal id_Farey(ideal x, number N, const ring r);
211
212ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
213
214
215#endif
Note: See TracBrowser for help on using the repository browser.