source: git/kernel/ideals.h @ 74efabb

spielwiese
Last change on this file since 74efabb was 74efabb, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
FIX: one ";" too many
  • 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
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)
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);
76
77#ifdef PDEBUG
78ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
79#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
80
81inline ideal idCopy(ideal A, const ring R = currRing)
82{
83  return id_DBCopy(A,R); // well, just for now... ok? Macros can't  have default args values :(
84}
85#else
86inline ideal idCopy(ideal A, const ring R = currRing)
87{
88  return id_Copy(A, R);
89}
90#endif
91
92
93ideal idAdd (ideal h1,ideal h2);
94  /* h1 + h2 */
95BOOLEAN idInsertPoly (ideal h1,poly h2);
96  /* h1 + h2 */
97BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
98  const poly h2, const bool zeroOk, const bool duplicateOk);
99  /* h1 + h2 */
100ideal idMult (ideal h1,ideal h2);
101  /*hh := h1 * h2*/
102
103BOOLEAN idIs0 (ideal h);
104
105// returns TRUE, if idRankFreeModule(m) > 0
106BOOLEAN idIsModule(ideal m, const ring r);
107BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
108BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
109BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
110
111ideal idMinBase (ideal h1);
112  /*returns a minimized set of generators of h1*/
113void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
114void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
115int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
116
117int     binom (int n,int r);
118
119ideal   idFreeModule (int i);
120
121ideal   idSect (ideal h1,ideal h2);
122ideal   idMultSect(resolvente arg, int length);
123
124//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
125ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
126                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
127ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
128
129ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
130             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
131             matrix *unit=NULL);
132
133void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
134
135intvec * idMWLift(ideal mod,intvec * weights);
136
137ideal   idQuot (ideal h1,ideal h2,
138                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
139
140ideal   idPower(ideal gid,int deg);
141
142//ideal   idElimination (ideal h1,poly delVar);
143ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
144
145poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
146ideal   idMinors(matrix a, int ar, ideal R = NULL);
147
148ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
149
150ideal   idHead(ideal h);
151
152ideal   idHomogen(ideal h, int varnum);
153
154BOOLEAN idIsSubModule(ideal id1,ideal id2);
155
156ideal   idVec2Ideal(poly vec);
157
158ideal   idMatrix2Module(matrix mat);
159
160matrix  idModule2Matrix(ideal mod);
161
162matrix  idModule2formatedMatrix(ideal mod,int rows, int cols);
163
164ideal   idSubst(ideal i, int n, poly e);
165
166ideal   idJet(ideal i,int d);
167ideal   idJetW(ideal i,int d, intvec * iv);
168ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
169
170BOOLEAN idIsZeroDim(ideal i);
171matrix  idDiff(matrix i, int k);
172matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
173
174intvec *idSort(ideal id,BOOLEAN nolex=TRUE);
175ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
176matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
177// transpose a module
178ideal   idTransp(ideal a);
179// version of "ideal idTransp(ideal)" which works within a given ring.
180ideal id_Transp(ideal a, const ring rRing);
181
182intvec *idQHomWeight(ideal id);
183
184ideal idXXX (ideal  h1, int k);
185
186poly id_GCD(poly f, poly g, const ring r);
187
188ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R);
189//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
190ideal id_Farey(ideal x, number N, const ring r);
191
192ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
193#endif
Note: See TracBrowser for help on using the repository browser.