My Project
Loading...
Searching...
No Matches
ideals.h
Go to the documentation of this file.
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*/
9
12#include "polys/simpleideals.h"
13
14#include "kernel/structs.h" // for tHomog
15
16//typedef struct sip_sideal * ideal;
17//typedef struct sip_smap * map;
18typedef ideal * resolvente;
19
20static inline ideal idCopyFirstK (const ideal ide, const int k)
21{
22 return id_CopyFirstK(ide, k, currRing);
23}
24
25void idKeepFirstK(ideal ide, const int k);
26void idDelEquals(ideal id);
27
28/// delete an ideal
29#define idDelete(H) id_Delete((H),currRing)
30
31/// initialise the maximal ideal (at 0)
32//ideal id_MaxIdeal(int deg, const ring r);
33#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
34
35/// index of generator with leading term in ground ring (if any); otherwise -1
36//int id_PosConstant(ideal id, const ring r)
37#define idPosConstant(I) id_PosConstant(I,currRing)
38
39//BOOLEAN id_IsConstant(ideal id, const ring r);
40#define idIsConstant(I) id_IsConstant(I,currRing)
41
42#define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
43
44ideal id_Copy (ideal h1, const ring r);
45
46#define idPrint(id) id_Print(id, currRing, currRing)
47#define idTest(id) id_Test(id, currRing)
48
49#if 0
50
51// ifdef PDEBUG // Sorry: the following was lost........ :((((((((
52ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
53#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
54
55inline ideal idCopy(ideal A)
56{
57 return id_DBCopy(A,currRing); // well, just for now... ok? Macros can't have default args values :(
58}
59#else
61{
62 return id_Copy(A, currRing);
63}
64#endif
65
66
67/// h1 + h2
69{
70 return id_Add(h1, h2, currRing);
71}
72
73BOOLEAN idInsertPoly (ideal h1,poly h2); /* h1 + h2 */
74BOOLEAN idInsertPolyOnPos (ideal I,poly p,int pos); /* inserts p in I on pos */
75inline BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
76{
78}
79
80
81/* h1 + h2 */
82
83/// hh := h1 * h2
84static inline ideal idMult (ideal h1, ideal h2)
85{
86 return id_Mult(h1, h2, currRing);
87}
88
90
91static inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
92{
93 return id_HomIdeal(id, Q, currRing);
94}
95
97{
98 return id_HomModule(m, Q, w, currRing);
99}
100
102
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
111inline ideal idFreeModule (int i)
112{
113 return id_FreeModule (i, currRing);
114}
115
116
117// GB algorithm for syz computations:
119{
121 // internal variants:
125 // and the library functions:
132 // and test variants
134
137
138//ideal idSyzygies (ideal h1, tHomog h,intvec **w);
142
146
147void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, int *w= NULL );
148
151
152// ideal idPower(ideal gid,int deg);
153
154//ideal idElimination (ideal h1,poly delVar);
156
157#ifdef WITH_OLD_MINOR
158poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
159#endif
160ideal idMinors(matrix a, int ar, ideal R = NULL);
161
163
165
166// ideal idHomogen(ideal h, int varnum);
167
169
170static inline ideal idVec2Ideal(poly vec)
171{
172 return id_Vec2Ideal(vec, currRing);
173}
174
176
178{
179 return id_IsZeroDim(i, currRing);
180}
181
182matrix idDiff(matrix i, int k);
184
186{
187 return id_Sort(id, nolex, currRing);
188}
189
193
194// intvec *idQHomWeight(ideal id);
195
196poly id_GCD(poly f, poly g, const ring r);
197
198ideal id_Farey(ideal x, number N, const ring r);
199
200ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
201
202ideal id_Satstd(const ideal I, ideal J, const ring r);
203ideal id_Sat_principal(const ideal I, ideal J, const ring r);
205ideal id_Homogenize(ideal I, int var_num, const ring r);
207
208GbVariant syGetAlgorithm(char *n, const ring r, const ideal M);
209#endif
int BOOLEAN
Definition auxiliary.h:87
#define TRUE
Definition auxiliary.h:100
#define FALSE
Definition auxiliary.h:96
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
int l
Definition cfEzgcd.cc:100
int m
Definition cfEzgcd.cc:128
int i
Definition cfEzgcd.cc:132
int k
Definition cfEzgcd.cc:99
Variable x
Definition cfModGcd.cc:4082
int p
Definition cfModGcd.cc:4078
g
Definition cfModGcd.cc:4090
FILE * f
Definition checklibs.c:9
const CanonicalForm & w
Definition facAbsFact.cc:51
CanonicalForm divide(const CanonicalForm &ff, const CanonicalForm &f, const CFList &as)
fq_nmod_poly_t * vec
Definition facHensel.cc:108
ideal idHead(ideal h)
ideal idMinors(matrix a, int ar, ideal R=NULL)
compute all ar-minors of the matrix a the caller of mpRecMin the elements of the result are not in R ...
Definition ideals.cc:1988
int binom(int n, int r)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition ideals.cc:2629
ideal idElimination(ideal h1, poly delVar, intvec *hilb=NULL, GbVariant a=GbDefault)
Definition ideals.cc:1605
GbVariant
Definition ideals.h:119
@ GbGroebner
Definition ideals.h:126
@ GbModstd
Definition ideals.h:127
@ GbStdSat
Definition ideals.h:130
@ GbSlimgb
Definition ideals.h:123
@ GbFfmod
Definition ideals.h:128
@ GbNfmod
Definition ideals.h:129
@ GbDefault
Definition ideals.h:120
@ GbStd
Definition ideals.h:122
@ GbSingmatic
Definition ideals.h:131
@ GbSba
Definition ideals.h:124
matrix idDiff(matrix i, int k)
Definition ideals.cc:2146
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition ideals.cc:2077
ideal idMinBase(ideal h1, ideal *SB=NULL)
Definition ideals.cc:51
ideal id_Homogenize(ideal I, int var_num, const ring r)
Definition ideals.cc:3335
void idDelEquals(ideal id)
Definition ideals.cc:2964
ideal idMultSect(resolvente arg, int length, GbVariant a=GbDefault)
Definition ideals.cc:471
ideal id_HomogenizeW(ideal I, int var_num, intvec *w, const ring r)
Definition ideals.cc:3380
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
static ideal idVec2Ideal(poly vec)
Definition ideals.h:170
BOOLEAN idIsSubModule(ideal id1, ideal id2)
Definition ideals.cc:2056
ideal idSaturate(ideal I, ideal J, int &ki, BOOLEAN isIdeal=TRUE)
Definition ideals.cc:3248
poly id_GCD(poly f, poly g, const ring r)
Definition ideals.cc:2753
ideal idLift(ideal mod, ideal submod, ideal *rest=NULL, BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE, BOOLEAN divide=FALSE, matrix *unit=NULL, GbVariant a=GbDefault)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
Definition ideals.cc:1105
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static BOOLEAN idIsZeroDim(ideal i)
Definition ideals.h:177
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
BOOLEAN idInsertPolyOnPos(ideal I, poly p, int pos)
insert p into I on position pos
ideal idLiftStd(ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL, GbVariant a=GbDefault, ideal h11=NULL)
Definition ideals.cc:976
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition ideals.h:96
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace=FALSE, intvec **w=NULL)
Definition ideals.cc:2695
BOOLEAN idInsertPolyWithTests(ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
Definition ideals.h:75
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply=TRUE)
Definition ideals.cc:2159
void idKeepFirstK(ideal ide, const int k)
keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero....
Definition ideals.cc:2932
ideal idSect(ideal h1, ideal h2, GbVariant a=GbDefault)
Definition ideals.cc:315
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp=TRUE, BOOLEAN setRegularity=FALSE, int *deg=NULL, GbVariant a=GbDefault)
Definition ideals.cc:830
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, int *w=NULL)
Definition ideals.cc:1336
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition ideals.h:91
static ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
Definition ideals.h:84
ideal idCopy(ideal A)
Definition ideals.h:60
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition ideals.h:68
ideal * resolvente
Definition ideals.h:18
GbVariant syGetAlgorithm(char *n, const ring r, const ideal M)
Definition ideals.cc:3425
ideal id_Farey(ideal x, number N, const ring r)
Definition ideals.cc:2856
int idGetNumberOfChoise(int t, int d, int begin, int end, int *choise)
ideal id_Satstd(const ideal I, ideal J, const ring r)
Definition ideals.cc:3116
static ideal idCopyFirstK(const ideal ide, const int k)
Definition ideals.h:20
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE)
Definition ideals.cc:1506
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
ideal idModulo(ideal h1, ideal h2, tHomog h=testHomog, intvec **w=NULL, matrix *T=NULL, GbVariant a=GbDefault)
Definition ideals.cc:2422
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition ideals.h:185
ideal idSeries(int n, ideal M, matrix U=NULL, intvec *w=NULL)
Definition ideals.cc:2129
ideal id_Sat_principal(const ideal I, ideal J, const ring r)
Definition ideals.cc:3168
ideal idFreeModule(int i)
Definition ideals.h:111
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
STATIC_VAR jList * T
Definition janet.cc:30
STATIC_VAR Poly * h
Definition janet.cc:971
#define NULL
Definition omList.c:12
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
ideal id_Add(ideal h1, ideal h2, const ring r)
h1 + h2
ideal id_Vec2Ideal(poly vec, const ring R)
intvec * id_Sort(const ideal id, const BOOLEAN nolex, const ring r)
sorts the ideal w.r.t. the actual ringordering uses lex-ordering when nolex = FALSE
BOOLEAN id_HomIdeal(ideal id, ideal Q, const ring r)
ideal id_FreeModule(int i, const ring r)
the free module of rank i
BOOLEAN id_IsZeroDim(ideal I, const ring r)
BOOLEAN id_InsertPolyWithTests(ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk, const ring r)
insert h2 into h1 depending on the two boolean parameters:
ideal id_Mult(ideal h1, ideal h2, const ring R)
h1 * h2 one h_i must be an ideal (with at least one column) the other h_i may be a module (with no co...
ideal id_CopyFirstK(const ideal ide, const int k, const ring r)
copies the first k (>= 1) entries of the given ideal/module and returns these as a new ideal/module (...
BOOLEAN id_HomModule(ideal m, ideal Q, intvec **w, const ring R)
#define R
Definition sirandom.c:27
#define A
Definition sirandom.c:24
#define M
Definition sirandom.c:25
#define Q
Definition sirandom.c:26
tHomog
Definition structs.h:35
@ testHomog
Definition structs.h:38