source: git/libpolys/polys/simpleideals.h @ 85bcd6

spielwiese
Last change on this file since 85bcd6 was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 4.5 KB
Line 
1#ifndef SIMPLEIDEALS_H
2#define SIMPLEIDEALS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT - all basic methods to manipulate ideals
8*/
9#include <omalloc/omalloc.h>
10#include <polys/monomials/ring.h>
11#include <polys/matpol.h>
12
13struct sip_sideal
14{
15  poly*  m;
16  long rank;
17  int nrows;
18  int ncols;
19  #define IDELEMS(i) ((i)->ncols)
20  #define MATCOLS(i) ((i)->ncols)
21  #define MATROWS(i) ((i)->nrows)
22  #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]
23
24};
25
26struct sip_smap
27{
28  poly *m;
29  char *preimage;
30  int nrows;
31  int ncols;
32};
33
34struct sideal_list;
35typedef struct sideal_list *      ideal_list;
36
37struct sideal_list
38{
39  ideal_list next;
40  ideal      d;
41#ifndef NDEBUG
42  int nr;
43#endif
44};
45
46extern omBin sip_sideal_bin;
47
48/*- creates an ideal -*/
49ideal idInit (int size, int rank=1);
50
51/*- deletes an ideal -*/
52void id_Delete (ideal* h, ring r);
53void id_ShallowDelete (ideal* h, ring r);
54void idSkipZeroes (ideal ide);
55  /*gives an ideal the minimal possible size*/
56
57/// number of non-zero polys in F
58int     idElem(const ideal F);
59/// normialize all polys in id
60void    id_Normalize(ideal id, const ring r);
61
62int id_MinDegW(ideal M,intvec *w, const ring r);
63
64#ifdef PDEBUG
65void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r);
66#define id_Test(A, r) id_DBTest(A, PDEBUG, __FILE__,__LINE__, r)
67// #define id_Print(id, r) id_Show(id, r)
68#else
69#define id_Test(A, r)  ((void)(TRUE))
70// #define id_Print(A, r) ((void)0)
71#endif
72
73ideal id_Copy (ideal h1,const ring r);
74
75  /*adds two ideals without simplifying the result*/
76ideal id_SimpleAdd (ideal h1,ideal h2, const ring r);
77  /*adds the quotient ideal*/
78ideal id_Add (ideal h1,ideal h2,const ring r);
79  /* h1 + h2 */
80
81ideal id_Power(ideal given,int exp, const ring r);
82BOOLEAN idIs0 (ideal h);
83
84long id_RankFreeModule(ideal m, ring lmRing, ring tailRing);
85static inline long id_RankFreeModule(ideal m, ring r)
86{return id_RankFreeModule(m, r, r);}
87// returns TRUE, if idRankFreeModule(m) > 0
88BOOLEAN id_IsModule(ideal m, ring r);
89ideal   id_FreeModule (int i, const ring r);
90int     idElem(const ideal F);
91int id_PosConstant(ideal id, const ring r);
92ideal id_Head(ideal h,const ring r);
93ideal id_MaxIdeal (const ring r);
94ideal id_MaxIdeal(int deg, const ring r);
95ideal id_CopyFirstK (const ideal ide, const int k,const ring r);
96void id_DelMultiples(ideal id, const ring r);
97void id_Norm(ideal id, const ring r);
98void id_DelEquals(ideal id, const ring r);
99void id_DelLmEquals(ideal id, const ring r);
100void id_DelDiv(ideal id, const ring r);
101BOOLEAN id_IsConstant(ideal id, const ring r);
102
103/// sorts the ideal w.r.t. the actual ringordering
104/// uses lex-ordering when nolex = FALSE
105intvec *id_Sort(const ideal id, const BOOLEAN nolex, const ring r);
106
107ideal id_Transp(ideal a, const ring rRing);
108void id_Compactify(ideal id, const ring r);
109ideal  id_Mult (ideal h1,ideal  h2, const ring r);
110ideal id_Homogen(ideal h, int varnum,const ring r);
111BOOLEAN id_HomIdeal (ideal id, ideal Q, const ring r);
112BOOLEAN id_HomModule(ideal m, ideal Q, intvec **w, const ring R);
113BOOLEAN id_IsZeroDim(ideal I, const ring r);
114ideal id_Jet(ideal i,int d, const ring R);
115ideal id_JetW(ideal i,int d, intvec * iv, const ring R);
116ideal  id_Subst(ideal id, int n, poly e, const ring r);
117matrix id_Module2Matrix(ideal mod, const ring R);
118matrix id_Module2formatedMatrix(ideal mod,int rows, int cols, const ring R);
119ideal id_Matrix2Module(matrix mat, const ring R);
120ideal id_Vec2Ideal(poly vec, const ring R);
121
122int id_ReadOutPivot(ideal arg, int* comp, const ring r);
123
124int     binom (int n,int r);
125
126  /*- verschiebt die Indizes der Modulerzeugenden um i -*/
127void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
128void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
129int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
130
131#ifdef PDEBUG
132void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint = 0);
133#endif
134
135
136/// insert h2 into h1 depending on the two boolean parameters:
137/// - if zeroOk is true, then h2 will also be inserted when it is zero
138/// - if duplicateOk is true, then h2 will also be inserted when it is
139///   already present in h1
140/// return TRUE iff h2 was indeed inserted
141BOOLEAN id_InsertPolyWithTests (ideal h1, const int validEntries,
142                                const poly h2, const bool zeroOk,
143                                const bool duplicateOk, const ring r);
144
145
146intvec * id_QHomWeight(ideal id, const ring r);
147
148
149#endif
Note: See TracBrowser for help on using the repository browser.