source: git/kernel/ideals.h @ 3630fa8

spielwiese
Last change on this file since 3630fa8 was 3630fa8, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: starting to add an optional ring argument to id[^_]* (without it)
  • Property mode set to 100644
File size: 5.9 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
21ideal idCopyFirstK (const ideal ide, const int k);
22
23/// delete an ideal
24inline void idDelete (ideal* h, ring r = currRing)
25{ 
26  id_Delete(h, r); 
27}
28
29/// initialise the maximal ideal (at 0)
30//ideal id_MaxIdeal(int deg, const ring r);
31#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
32
33/// index of generator with leading term in ground ring (if any); otherwise -1
34//int id_PosConstant(ideal id, const ring r)
35#define idPosConstant(I) id_PosConstant(I,currRing)
36//
37/// Count the effective size of an ideal
38/// (without the trailing allocated zero-elements)
39static inline int idSize(const ideal id, const ring r = currRing)
40{
41  int j = IDELEMS(id) - 1;
42  poly* mm = id->m;
43  while ((j >= 0) && (mm[j] == NULL)) j--;
44  return (j + 1); 
45}
46
47//void id_Norm(ideal id, const ring r);
48#define idNorm(I) id_Norm(I,currRing)
49
50//void id_DelMultiples(ideal id, const ring r);
51#define idDelMultiples(I) id_DelMultiples(I,currRing)
52
53//void id_DelEquals(ideal id, const ring r);
54#define idDelEquals(I) id_DelEquals(I,currRing)
55
56//void id_DelLmEquals(ideal id, const ring r);
57#define idDelLmEquals(I) id_DelLmEquals(I,currRing)
58
59//void id_DelDiv(ideal id, const ring r);
60#define idDelDiv(I) id_DelDiv(I,currRing)
61
62//BOOLEAN id_IsConstant(ideal id, const ring r);
63#define idIsConstant(I) id_IsConstant(I,currRing)
64
65#define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
66
67#ifdef PDEBUG
68#define idTest(A) id_DBTest(A, PDEBUG, __FILE__,__LINE__,currRing)
69#define idPrint(id) idShow(id, currRing, currRing)
70#else
71#define idTest(A)  (TRUE)
72#define idPrint(A) ((void)0)
73#endif
74
75ideal id_Copy (ideal h1, const ring r = currRing);
76
77#if 0
78
79// ifdef PDEBUG // Sorry: the following was lost........ :((((((((
80ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
81#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
82
83inline ideal idCopy(ideal A, const ring R = currRing)
84{
85  return id_DBCopy(A,R); // well, just for now... ok? Macros can't  have default args values :(
86}
87#else
88inline ideal idCopy(ideal A, const ring R = currRing)
89{
90  return id_Copy(A, R);
91}
92#endif
93
94
95ideal idAdd (ideal h1,ideal h2);
96  /* h1 + h2 */
97BOOLEAN idInsertPoly (ideal h1,poly h2);
98  /* h1 + h2 */
99BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
100  const poly h2, const bool zeroOk, const bool duplicateOk);
101  /* h1 + h2 */
102ideal idMult (ideal h1,ideal h2);
103  /*hh := h1 * h2*/
104
105BOOLEAN idIs0 (ideal h);
106
107// returns TRUE, if idRankFreeModule(m) > 0
108BOOLEAN idIsModule(ideal m, const ring r);
109BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
110BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
111BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
112
113ideal idMinBase (ideal h1);
114  /*returns a minimized set of generators of h1*/
115void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
116void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
117int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
118
119int     binom (int n,int r);
120
121inline ideal idFreeModule (int i, const ring R = currRing)
122{
123  return id_FreeModule (i, R);
124}
125
126
127
128
129ideal   idSect (ideal h1,ideal h2);
130ideal   idMultSect(resolvente arg, int length);
131
132//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
133ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
134                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
135ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
136
137ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
138             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
139             matrix *unit=NULL);
140
141void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
142
143intvec * idMWLift(ideal mod,intvec * weights);
144
145ideal   idQuot (ideal h1,ideal h2,
146                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
147
148ideal   idPower(ideal gid,int deg);
149
150//ideal   idElimination (ideal h1,poly delVar);
151ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
152
153poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
154ideal   idMinors(matrix a, int ar, ideal R = NULL);
155
156ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
157
158ideal   idHead(ideal h);
159
160ideal   idHomogen(ideal h, int varnum);
161
162BOOLEAN idIsSubModule(ideal id1,ideal id2);
163
164inline ideal idVec2Ideal(poly vec, const ring R = currRing)
165{
166  return id_Vec2Ideal(vec, R);
167}
168
169ideal   idMatrix2Module(matrix mat);
170
171matrix  idModule2Matrix(ideal mod);
172
173matrix  idModule2formatedMatrix(ideal mod,int rows, int cols);
174
175ideal   idSubst(ideal i, int n, poly e);
176
177ideal   idJet(ideal i,int d);
178ideal   idJetW(ideal i,int d, intvec * iv);
179ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
180
181BOOLEAN idIsZeroDim(ideal i);
182matrix  idDiff(matrix i, int k);
183matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
184
185intvec *idSort(ideal id,BOOLEAN nolex=TRUE);
186ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
187matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
188// transpose a module
189ideal   idTransp(ideal a);
190// version of "ideal idTransp(ideal)" which works within a given ring.
191ideal id_Transp(ideal a, const ring rRing);
192
193intvec *idQHomWeight(ideal id);
194
195ideal idXXX (ideal  h1, int k);
196
197poly id_GCD(poly f, poly g, const ring r);
198
199ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R);
200//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
201ideal id_Farey(ideal x, number N, const ring r);
202
203ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
204#endif
Note: See TracBrowser for help on using the repository browser.