source: git/kernel/ideals.h @ 36dd34

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