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

spielwiese
Last change on this file since f7a975 was f7a975, checked in by Hans Schoenemann <hannes@…>, 13 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
RevLine 
[35aab3]1#ifndef IDEALS_H
2#define IDEALS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
[341696]6/* $Id$ */
[35aab3]7/*
8* ABSTRACT - all basic methods to manipulate ideals
9*/
[028192]10// #include <kernel/structs.h>
11
[b07ba77]12//typedef struct sip_sideal *        ideal;
13//typedef struct sip_smap *          map;
14typedef ideal *            resolvente;
15
16
17extern omBin sip_sideal_bin;
18
[35aab3]19/*- creates an ideal -*/
20ideal idInit (int size, int rank=1);
[1919112]21ideal idCopyFirstK (const ideal ide, const int k);
[e9c3b2]22
23/// delete an ideal
[028192]24// #define idDelete(h) id_Delete(h, currRing)
[35aab3]25void id_Delete (ideal* h, ring r);
26void id_ShallowDelete (ideal* h, ring r);
[e9c3b2]27/*- initialise an ideal -*/ // ?
28
29/// initialise the maximal ideal (at 0)
[35aab3]30ideal idMaxIdeal (int deg);
[e9c3b2]31
32/// gives an ideal the minimal possible size
[35aab3]33void idSkipZeroes (ideal ide);
[e9c3b2]34
35/// index of generator with leading term in ground ring (if any); otherwise -1
[dd5534]36int idPosConstant (ideal id);
[e9c3b2]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); 
[27fc50]46}
[e9c3b2]47
[35aab3]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
[85e68dd]56void idDBTest(ideal h1, int level, const char *f,const int l);
[35aab3]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
[d523f3]64ideal id_Copy (ideal h1,const ring r);
[028192]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
[35aab3]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 */
[ded085]79BOOLEAN idInsertPoly (ideal h1,poly h2);
[e070895]80  /* h1 + h2 */
[2b3caae]81BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
82  const poly h2, const bool zeroOk, const bool duplicateOk);
[1a68d1d]83  /* h1 + h2 */
[35aab3]84ideal idMult (ideal h1,ideal h2);
85  /*hh := h1 * h2*/
86
87BOOLEAN idIs0 (ideal h);
88
89// returns TRUE, if idRankFreeModule(m) > 0
[028192]90BOOLEAN idIsModule(ideal m, const ring r);
[35aab3]91BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
92BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
[30b8381]93BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
[35aab3]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);
[81dab73]115ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
[35aab3]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
[0a64b14]133poly idMinor(matrix a, int ar, unsigned long which, ideal R=NULL);
134
[35aab3]135ideal   idMinors(matrix a, int ar, ideal R=NULL);
136
[10ea45f]137void   idCompactify(ideal id);
[35aab3]138
[cf108d]139ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
[35aab3]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);
[cf108d]167ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
[b3930d]168int     idElem(const ideal F);
[35aab3]169matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
[90a60f]170// transpose a module
[35aab3]171ideal   idTransp(ideal a);
[90a60f]172// version of "ideal idTransp(ideal)" which works within a given ring.
[028192]173ideal id_Transp(ideal a, const ring rRing);
[90a60f]174
[35aab3]175intvec *idQHomWeight(ideal id);
176
177void    idNormalize(ideal id);
178
179ideal idXXX (ideal  h1, int k);
[225d94]180
181poly id_GCD(poly f, poly g, const ring r);
[bba835]182
183ideal idChineseRemainder(ideal *x, number *q, int rl);
[3580b7]184//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
[3149a5]185ideal idFarey(ideal x, number N);
[90a60f]186
[028192]187ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
[90a60f]188
[e9c3b2]189#ifdef PDEBUG
[1a4313]190/* Shows an ideal -- only for debugging */
[028192]191void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint = 0);
[e9c3b2]192#else
193#define idShow(id, lmRing, tailRing, debugPrint) ((void)0)
[1a4313]194#endif
[35aab3]195#endif
Note: See TracBrowser for help on using the repository browser.