source: git/kernel/ideals.h @ b23b31a

fieker-DuValspielwiese
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
RevLine 
[8505243]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*/
[f7d39b]9
10#include <polys/monomials/ring.h>
11#include <polys/monomials/p_polys.h>
[8505243]12#include <polys/simpleideals.h>
[f7d39b]13
[da6156]14#include <kernel/structs.h> // for tHomog
[8505243]15
16//typedef struct sip_sideal *        ideal;
17//typedef struct sip_smap *          map;
18typedef ideal *            resolvente;
19
[0f43c5]20static inline ideal idCopyFirstK (const ideal ide, const int k)
[d84a4d]21{
[9e8bfa]22  return id_CopyFirstK(ide, k, currRing);
[d84a4d]23}
[8505243]24
[9234fb]25void idKeepFirstK(ideal ide, const int k);
[c81bf7]26void idDelEquals(ideal id);
[9234fb]27
[8505243]28/// delete an ideal
[86f1dc]29#define idDelete(H) id_Delete((H),currRing)
[8505243]30
31/// initialise the maximal ideal (at 0)
[a9c298]32//ideal id_MaxIdeal(int deg, const ring r);
[bb5c28]33#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
[8505243]34
35/// index of generator with leading term in ground ring (if any); otherwise -1
[bb5c28]36//int id_PosConstant(ideal id, const ring r)
37#define idPosConstant(I) id_PosConstant(I,currRing)
[d84a4d]38
[bb5c28]39//BOOLEAN id_IsConstant(ideal id, const ring r);
40#define idIsConstant(I) id_IsConstant(I,currRing)
[8505243]41
[36d6ec6]42#define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
43
[6a4ba5f]44ideal id_Copy (ideal h1, const ring r);
[8505243]45
[f7d39b]46#define idPrint(id) id_Print(id, currRing, currRing)
47#define idTest(id)  id_Test(id, currRing)
48
[3630fa8]49#if 0
50
51// ifdef PDEBUG // Sorry: the following was lost........ :((((((((
[8505243]52ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
53#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
54
[9e8bfa]55inline ideal idCopy(ideal A)
[8505243]56{
[9e8bfa]57  return id_DBCopy(A,currRing); // well, just for now... ok? Macros can't  have default args values :(
[8505243]58}
59#else
[9e8bfa]60inline ideal idCopy(ideal A)
[8505243]61{
[9e8bfa]62  return id_Copy(A, currRing);
[8505243]63}
64#endif
65
66
[d84a4d]67/// h1 + h2
[9e8bfa]68inline ideal idAdd (ideal h1, ideal h2)
[d84a4d]69{
[9e8bfa]70  return id_Add(h1, h2, currRing);
[d84a4d]71}
72
73BOOLEAN idInsertPoly (ideal h1,poly h2);  /* h1 + h2 */
[48cbb0]74BOOLEAN idInsertPolyOnPos (ideal I,poly p,int pos);  /* inserts p in I on pos */
[9e8bfa]75inline BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
[d84a4d]76{
[9e8bfa]77  return id_InsertPolyWithTests (h1, validEntries, h2, zeroOk, duplicateOk, currRing);
[d84a4d]78}
79
80
81/* h1 + h2 */
82
83/// hh := h1 * h2
[9e8bfa]84inline ideal idMult (ideal h1, ideal h2)
[d84a4d]85{
[9e8bfa]86  return id_Mult(h1, h2, currRing);
[d84a4d]87}
[8505243]88
89BOOLEAN idIs0 (ideal h);
90
[9e8bfa]91inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
[d84a4d]92{
[9e8bfa]93  return id_HomIdeal(id, Q, currRing);
[d84a4d]94}
95
[9e8bfa]96inline BOOLEAN idHomModule(ideal m, ideal Q,intvec **w)
[d84a4d]97{
[9e8bfa]98   return id_HomModule(m, Q, w, currRing);
[d84a4d]99}
100
[8505243]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
[9e8bfa]111inline ideal idFreeModule (int i)
[3630fa8]112{
[9e8bfa]113  return id_FreeModule (i, currRing);
[3630fa8]114}
115
116
[8505243]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
[d84a4d]136// ideal   idPower(ideal gid,int deg);
[8505243]137
138//ideal   idElimination (ideal h1,poly delVar);
139ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
140
[7356be]141#ifdef WITH_OLD_MINOR
[d16ea9]142poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
[7356be]143#endif
[d16ea9]144ideal   idMinors(matrix a, int ar, ideal R = NULL);
[8505243]145
146ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
147
148ideal   idHead(ideal h);
149
[d84a4d]150// ideal   idHomogen(ideal h, int varnum);
[8505243]151
152BOOLEAN idIsSubModule(ideal id1,ideal id2);
153
[0f43c5]154static inline ideal idVec2Ideal(poly vec)
[3630fa8]155{
[9e8bfa]156  return id_Vec2Ideal(vec, currRing);
[3630fa8]157}
[8505243]158
159ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
160
[0f43c5]161static inline BOOLEAN idIsZeroDim(ideal i)
[d84a4d]162{
[9e8bfa]163  return id_IsZeroDim(i, currRing);
[d84a4d]164}
165
[8505243]166matrix  idDiff(matrix i, int k);
167matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
168
[0f43c5]169static inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE)
[d84a4d]170{
[9e8bfa]171  return id_Sort(id, nolex, currRing);
[d84a4d]172}
173
[8505243]174ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
175matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
176
[d84a4d]177// intvec *idQHomWeight(ideal id);
[8505243]178
179ideal idXXX (ideal  h1, int k);
180
181poly id_GCD(poly f, poly g, const ring r);
182
[f9591a]183ideal id_Farey(ideal x, number N, const ring r);
[8505243]184
185ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
[d84a4d]186
[8505243]187#endif
Note: See TracBrowser for help on using the repository browser.