source: git/kernel/ideals.h @ 1ca2af

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