source: git/libpolys/polys/ideals.h @ f7a975

spielwiese
Last change on this file since f7a975 was f7a975, checked in by Hans Schoenemann <hannes@…>, 12 years ago
moved simple ideal stuff to simpleideals.h renamed ideals.cc to simpleideals.cc (needs to be cleaned) fixed #includes for ideals.h
  • 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 <kernel/structs.h>
11
12//typedef struct sip_sideal *        ideal;
13//typedef struct sip_smap *          map;
14typedef ideal *            resolvente;
15
16
17extern omBin sip_sideal_bin;
18
19/*- creates an ideal -*/
20ideal idInit (int size, int rank=1);
21ideal idCopyFirstK (const ideal ide, const int k);
22
23/// delete an ideal
24// #define idDelete(h) id_Delete(h, currRing)
25void id_Delete (ideal* h, ring r);
26void id_ShallowDelete (ideal* h, ring r);
27/*- initialise an ideal -*/ // ?
28
29/// initialise the maximal ideal (at 0)
30ideal idMaxIdeal (int deg);
31
32/// gives an ideal the minimal possible size
33void idSkipZeroes (ideal ide);
34
35/// index of generator with leading term in ground ring (if any); otherwise -1
36int idPosConstant (ideal id);
37
38/// Count the effective size of an ideal
39/// (without the trailing allocated zero-elements)
40static inline int idSize(const ideal id)
41{
42  int j = IDELEMS(id) - 1;
43  poly* mm = id->m;
44  while ((j >= 0) && (mm[j] == NULL)) j--;
45  return (j + 1); 
46}
47
48void idNorm(ideal id);
49void idDelMultiples(ideal id);
50void idDelEquals(ideal id);
51void idDelLmEquals(ideal id);
52void idDelDiv(ideal id);
53BOOLEAN idIsConstant(ideal id);
54
55#ifdef PDEBUG
56void idDBTest(ideal h1, int level, const char *f,const int l);
57#define idTest(A) idDBTest(A, PDEBUG, __FILE__,__LINE__)
58#define idPrint(id) idShow(id)
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#ifdef PDEBUG
66ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
67#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
68#define idCopy(A,r) id_DBCopy(A,r)
69#else
70#define idCopy(A,r) id_Copy(A,r)
71#endif
72
73
74  /*adds two ideals without simplifying the result*/
75ideal idSimpleAdd (ideal h1,ideal h2);
76  /*adds the quotient ideal*/
77ideal idAdd (ideal h1,ideal h2);
78  /* h1 + h2 */
79BOOLEAN idInsertPoly (ideal h1,poly h2);
80  /* h1 + h2 */
81BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
82  const poly h2, const bool zeroOk, const bool duplicateOk);
83  /* h1 + h2 */
84ideal idMult (ideal h1,ideal h2);
85  /*hh := h1 * h2*/
86
87BOOLEAN idIs0 (ideal h);
88
89// returns TRUE, if idRankFreeModule(m) > 0
90BOOLEAN idIsModule(ideal m, const ring r);
91BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
92BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
93BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
94
95ideal idMinBase (ideal h1);
96  /*returns a minimized set of generators of h1*/
97int pLowVar (poly p);
98  /*-the minimal index of used variables - 1-*/
99void pShift (poly * p,int i);
100  /*- verschiebt die Indizes der Modulerzeugenden um i -*/
101void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
102void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
103int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
104
105int     binom (int n,int r);
106
107ideal   idFreeModule (int i);
108
109ideal   idSect (ideal h1,ideal h2);
110ideal   idMultSect(resolvente arg, int length);
111
112//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
113ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
114                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
115ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
116
117ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
118             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
119             matrix *unit=NULL);
120
121void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
122
123intvec * idMWLift(ideal mod,intvec * weights);
124
125ideal   idQuot (ideal h1,ideal h2,
126                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
127
128ideal   idPower(ideal gid,int deg);
129
130//ideal   idElimination (ideal h1,poly delVar);
131ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
132
133poly idMinor(matrix a, int ar, unsigned long which, ideal R=NULL);
134
135ideal   idMinors(matrix a, int ar, ideal R=NULL);
136
137void   idCompactify(ideal id);
138
139ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
140
141ideal   idHead(ideal h);
142
143ideal   idHomogen(ideal h, int varnum);
144
145BOOLEAN idIsSubModule(ideal id1,ideal id2);
146
147ideal   idVec2Ideal(poly vec);
148
149ideal   idMatrix2Module(matrix mat);
150
151matrix  idModule2Matrix(ideal mod);
152
153matrix  idModule2formatedMatrix(ideal mod,int rows, int cols);
154
155ideal   idSubst(ideal i, int n, poly e);
156
157ideal   idJet(ideal i,int d);
158ideal   idJetW(ideal i,int d, intvec * iv);
159int idMinDegW(ideal M,intvec *w);
160ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
161
162BOOLEAN idIsZeroDim(ideal i);
163matrix  idDiff(matrix i, int k);
164matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
165
166intvec *idSort(ideal id,BOOLEAN nolex=TRUE);
167ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
168int     idElem(const ideal F);
169matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
170// transpose a module
171ideal   idTransp(ideal a);
172// version of "ideal idTransp(ideal)" which works within a given ring.
173ideal id_Transp(ideal a, const ring rRing);
174
175intvec *idQHomWeight(ideal id);
176
177void    idNormalize(ideal id);
178
179ideal idXXX (ideal  h1, int k);
180
181poly id_GCD(poly f, poly g, const ring r);
182
183ideal idChineseRemainder(ideal *x, number *q, int rl);
184//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
185ideal idFarey(ideal x, number N);
186
187ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
188
189#ifdef PDEBUG
190/* Shows an ideal -- only for debugging */
191void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint = 0);
192#else
193#define idShow(id, lmRing, tailRing, debugPrint) ((void)0)
194#endif
195#endif
Note: See TracBrowser for help on using the repository browser.