source: git/kernel/ideals.h @ 737a68

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