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
60inline ideal idCopy(ideal A)
61{
62 return id_Copy(A, currRing);
63}
64#endif
65
66
67/// h1 + h2
68inline ideal idAdd (ideal h1, ideal 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{
77 return id_InsertPolyWithTests (h1, validEntries, h2, zeroOk, duplicateOk, currRing);
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
89BOOLEAN idIs0 (ideal h);
90
91static inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
92{
93 return id_HomIdeal(id, Q, currRing);
94}
95
96static inline BOOLEAN idHomModule(ideal m, ideal Q,intvec **w)
97{
98 return id_HomModule(m, Q, w, currRing);
99}
100
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
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:
133
134ideal idSect (ideal h1,ideal h2, GbVariant a=GbDefault);
136
137//ideal idSyzygies (ideal h1, tHomog h,intvec **w);
138ideal idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
139 BOOLEAN setRegularity=FALSE, int *deg = NULL, GbVariant a=GbDefault);
140ideal idLiftStd (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL, GbVariant a=GbDefault, ideal h11=NULL);
141
142ideal idLift (ideal mod, ideal submod,ideal * rest=NULL,
143 BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
144 matrix *unit=NULL, GbVariant a=GbDefault);
145
146void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, int *w= NULL );
147
148ideal idQuot (ideal h1,ideal h2,
149 BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
150
151// ideal idPower(ideal gid,int deg);
152
153//ideal idElimination (ideal h1,poly delVar);
154ideal idElimination (ideal h1,poly delVar, intvec *hilb=NULL, GbVariant a=GbDefault);
155
156#ifdef WITH_OLD_MINOR
157poly idMinor(matrix a, int ar, unsigned long which, ideal R = NULL);
158#endif
159ideal idMinors(matrix a, int ar, ideal R = NULL);
160
161ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
162
163ideal idHead(ideal h);
164
165// ideal idHomogen(ideal h, int varnum);
166
167BOOLEAN idIsSubModule(ideal id1,ideal id2);
168
169static inline ideal idVec2Ideal(poly vec)
170{
171 return id_Vec2Ideal(vec, currRing);
172}
173
174ideal idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
175
176static inline BOOLEAN idIsZeroDim(ideal i)
177{
178 return id_IsZeroDim(i, currRing);
179}
180
181matrix idDiff(matrix i, int k);
182matrix idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
183
184static inline intvec *idSort(ideal id,BOOLEAN nolex=TRUE)
185{
186 return id_Sort(id, nolex, currRing);
187}
188
189ideal idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL,
191matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how);
192
193// intvec *idQHomWeight(ideal id);
194
195poly id_GCD(poly f, poly g, const ring r);
196
197ideal id_Farey(ideal x, number N, const ring r);
198
199ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
200
201ideal id_Satstd(const ideal I, ideal J, const ring r);
202
203GbVariant syGetAlgorithm(char *n, const ring r, const ideal M);
204#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
Definition: intvec.h:23
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:1980
int binom(int n, int r)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
Definition: ideals.cc:2621
ideal idElimination(ideal h1, poly delVar, intvec *hilb=NULL, GbVariant a=GbDefault)
Definition: ideals.cc:1593
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:2138
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:2069
void idDelEquals(ideal id)
Definition: ideals.cc:2956
ideal idMultSect(resolvente arg, int length, GbVariant a=GbDefault)
Definition: ideals.cc:472
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:169
BOOLEAN idIsSubModule(ideal id1, ideal id2)
Definition: ideals.cc:2048
poly id_GCD(poly f, poly g, const ring r)
Definition: ideals.cc:2745
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:176
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:2687
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:2151
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:2924
ideal idSect(ideal h1, ideal h2, GbVariant a=GbDefault)
Definition: ideals.cc:316
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:1324
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 idMinBase(ideal h1)
Definition: ideals.cc:51
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:3154
ideal id_Farey(ideal x, number N, const ring r)
Definition: ideals.cc:2848
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:3108
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:1494
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:2414
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:184
ideal idSeries(int n, ideal M, matrix U=NULL, intvec *w=NULL)
Definition: ideals.cc:2121
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