source: git/libpolys/polys/simpleideals.h @ 2a38d90

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