source: git/libpolys/polys/simpleideals.h @ cf02b22

spielwiese
Last change on this file since cf02b22 was cf02b22, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: last fixes to matpol.cc FIX: add "const" for (last) ring parameter for p_GetShortExpVector and correct declarations p_polys.h ADD: copy over *Choise funxtions from ideals.h to simpleideals.h
  • Property mode set to 100644
File size: 2.9 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 <polys/monomials/ring.h>
11#include <omalloc/omalloc.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
34class ip_smatrix;
35typedef ip_smatrix *       matrix;
36
37struct sideal_list;
38typedef struct sideal_list *      ideal_list;
39
40struct sideal_list
41{
42  ideal_list next;
43  ideal      d;
44#ifndef NDEBUG
45  int nr;
46#endif
47};
48
49extern omBin sip_sideal_bin;
50
51#ifdef PDEBUG
52ideal idDBInit (int size, int rank, const char *f, int l);
53#define idInit(A,B) idDBInit(A,B,__FILE__,__LINE__)
54#else
55/*- creates an ideal -*/
56ideal idInit (int size, int rank=1);
57#endif
58/*- deletes an ideal -*/
59void id_Delete (ideal* h, ring r);
60void id_ShallowDelete (ideal* h, ring r);
61void idSkipZeroes (ideal ide);
62  /*gives an ideal the minimal possible size*/
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)  (TRUE)
70// #define id_Print(A, r) ((void)0)
71#endif
72
73#ifdef PDEBUG
74ideal id_DBCopy(ideal h1,const char *f,int l, const ring r);
75#define id_Copy(A,R) id_DBCopy(A,__FILE__,__LINE__,R)
76#else
77ideal id_Copy (ideal h1,const ring r);
78#endif
79  /*adds two ideals without simplifying the result*/
80ideal idSimpleAdd (ideal h1,ideal h2);
81  /*adds the quotient ideal*/
82ideal idAdd (ideal h1,ideal h2);
83  /* h1 + h2 */
84BOOLEAN idIs0 (ideal h);
85
86long id_RankFreeModule(ideal m, ring lmRing, ring tailRing);
87static inline long id_RankFreeModule(ideal m, ring r)
88{return id_RankFreeModule(m, r, r);}
89// returns TRUE, if idRankFreeModule(m) > 0
90BOOLEAN id_IsModule(ideal m, ring r);
91ideal   idFreeModule (int i);
92int     idElem(const ideal F);
93int id_PosConstant(ideal id, const ring r);
94ideal id_MaxIdeal (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);
102intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r);
103
104
105int     binom (int n,int r);
106
107  /*- verschiebt die Indizes der Modulerzeugenden um i -*/
108void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
109void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
110int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
111
112#endif
Note: See TracBrowser for help on using the repository browser.