source: git/kernel/ideals.h @ b23b31a

spielwiese
Last change on this file since b23b31a was 0e633e, checked in by Hans Schoenemann <hannes@…>, 8 years ago
cleanup: extern currRing
  • Property mode set to 100644
File size: 5.0 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
10#include <polys/monomials/ring.h>
11#include <polys/monomials/p_polys.h>
12#include <polys/simpleideals.h>
13
14#include <kernel/structs.h> // for tHomog
15
16//typedef struct sip_sideal *        ideal;
17//typedef struct sip_smap *          map;
18typedef ideal *            resolvente;
19
20static inline ideal idCopyFirstK (const ideal ide, const int k)
21{
22  return id_CopyFirstK(ide, k, currRing);
23}
24
25void idKeepFirstK(ideal ide, const int k);
26void idDelEquals(ideal id);
27
28/// delete an ideal
29#define idDelete(H) id_Delete((H),currRing)
30
31/// initialise the maximal ideal (at 0)
32//ideal id_MaxIdeal(int deg, const ring r);
33#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
34
35/// index of generator with leading term in ground ring (if any); otherwise -1
36//int id_PosConstant(ideal id, const ring r)
37#define idPosConstant(I) id_PosConstant(I,currRing)
38
39//BOOLEAN id_IsConstant(ideal id, const ring r);
40#define idIsConstant(I) id_IsConstant(I,currRing)
41
42#define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
43
44ideal id_Copy (ideal h1, const ring r);
45
46#define idPrint(id) id_Print(id, currRing, currRing)
47#define idTest(id)  id_Test(id, currRing)
48
49#if 0
50
51// ifdef PDEBUG // Sorry: the following was lost........ :((((((((
52ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
53#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
54
55inline ideal idCopy(ideal A)
56{
57  return id_DBCopy(A,currRing); // well, just for now... ok? Macros can't  have default args values :(
58}
59#else
60inline ideal idCopy(ideal A)
61{
62  return id_Copy(A, currRing);
63}
64#endif
65
66
67/// h1 + h2
68inline ideal idAdd (ideal h1, ideal h2)
69{
70  return id_Add(h1, h2, currRing);
71}
72
73BOOLEAN idInsertPoly (ideal h1,poly h2);  /* h1 + h2 */
74BOOLEAN idInsertPolyOnPos (ideal I,poly p,int pos);  /* inserts p in I on pos */
75inline BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
76{
77  return id_InsertPolyWithTests (h1, validEntries, h2, zeroOk, duplicateOk, currRing);
78}
79
80
81/* h1 + h2 */
82
83/// hh := h1 * h2
84inline ideal idMult (ideal h1, ideal h2)
85{
86  return id_Mult(h1, h2, currRing);
87}
88
89BOOLEAN idIs0 (ideal h);
90
91inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
92{
93  return id_HomIdeal(id, Q, currRing);
94}
95
96inline BOOLEAN idHomModule(ideal m, ideal Q,intvec **w)
97{
98   return id_HomModule(m, Q, w, currRing);
99}
100
101BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
102
103ideal idMinBase (ideal h1);
104  /*returns a minimized set of generators of h1*/
105void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
106void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
107int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
108
109int     binom (int n,int r);
110
111inline ideal idFreeModule (int i)
112{
113  return id_FreeModule (i, currRing);
114}
115
116
117ideal   idSect (ideal h1,ideal h2);
118ideal   idMultSect(resolvente arg, int length);
119
120//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
121ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
122                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
123ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
124
125ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
126             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
127             matrix *unit=NULL);
128
129void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
130
131intvec * idMWLift(ideal mod,intvec * weights);
132
133ideal   idQuot (ideal h1,ideal h2,
134                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
135
136// ideal   idPower(ideal gid,int deg);
137
138//ideal   idElimination (ideal h1,poly delVar);
139ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
140
141#ifdef WITH_OLD_MINOR
142poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
143#endif
144ideal   idMinors(matrix a, int ar, ideal R = NULL);
145
146ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
147
148ideal   idHead(ideal h);
149
150// ideal   idHomogen(ideal h, int varnum);
151
152BOOLEAN idIsSubModule(ideal id1,ideal id2);
153
154static inline ideal idVec2Ideal(poly vec)
155{
156  return id_Vec2Ideal(vec, currRing);
157}
158
159ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
160
161static inline BOOLEAN idIsZeroDim(ideal i)
162{
163  return id_IsZeroDim(i, currRing);
164}
165
166matrix  idDiff(matrix i, int k);
167matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
168
169static inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE)
170{
171  return id_Sort(id, nolex, currRing);
172}
173
174ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
175matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
176
177// intvec *idQHomWeight(ideal id);
178
179ideal idXXX (ideal  h1, int k);
180
181poly id_GCD(poly f, poly g, const ring r);
182
183ideal id_Farey(ideal x, number N, const ring r);
184
185ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
186
187#endif
Note: See TracBrowser for help on using the repository browser.