source: git/kernel/ideals.h @ 228e0b

spielwiese
Last change on this file since 228e0b was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • 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/*
7* ABSTRACT - all basic methods to manipulate ideals
8*/
9#include <polys/simpleideals.h>
10#include <kernel/polys.h>
11
12#include <kernel/structs.h> // for tHomog
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
54#define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
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)  ((void)(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{
87  return id_Add(h1, h2, R);
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
136ideal   idSect (ideal h1,ideal h2);
137ideal   idMultSect(resolvente arg, int length);
138
139//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
140ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
141                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
142ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
143
144ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
145             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
146             matrix *unit=NULL);
147
148void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
149
150intvec * idMWLift(ideal mod,intvec * weights);
151
152ideal   idQuot (ideal h1,ideal h2,
153                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
154
155// ideal   idPower(ideal gid,int deg);
156
157//ideal   idElimination (ideal h1,poly delVar);
158ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
159
160poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
161ideal   idMinors(matrix a, int ar, ideal R = NULL);
162
163ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
164
165ideal   idHead(ideal h);
166
167// ideal   idHomogen(ideal h, int varnum);
168
169BOOLEAN idIsSubModule(ideal id1,ideal id2);
170
171inline ideal idVec2Ideal(poly vec, const ring R = currRing)
172{
173  return id_Vec2Ideal(vec, R);
174}
175
176ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
177
178inline BOOLEAN idIsZeroDim(ideal i, const ring R = currRing)
179{
180  return id_IsZeroDim(i, R);
181}
182
183matrix  idDiff(matrix i, int k);
184matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
185
186inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE, const ring R = currRing)
187{
188  return id_Sort(id, nolex, R);
189}
190
191ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
192matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
193
194/// transpose a module
195inline ideal   idTransp(ideal a, const ring R = currRing)
196{
197  return id_Transp(a, R);
198}
199
200// intvec *idQHomWeight(ideal id);
201
202ideal idXXX (ideal  h1, int k);
203
204poly id_GCD(poly f, poly g, const ring r);
205
206ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R);
207//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
208ideal id_Farey(ideal x, number N, const ring r);
209
210ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
211
212
213#endif
Note: See TracBrowser for help on using the repository browser.