My Project
fglm.h
Go to the documentation of this file.
1 // emacs edit mode for this file is -*- C++ -*-
2 
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT - The FGLM-Algorithm
8 * The main header file for the fglm algorithm
9 * (See fglm.cc for details)
10 */
11 
12 #ifndef FGLM_H
13 #define FGLM_H
14 
15 #include "kernel/polys.h"
16 #include "kernel/structs.h"
17 #include "kernel/fglm/fglmvec.h"
18 
19 #define PROT(msg)
20 #define STICKYPROT(msg) if (BTEST1(OPT_PROT)) Print(msg)
21 #define PROT2(msg,arg)
22 #define STICKYPROT2(msg,arg) if (BTEST1(OPT_PROT)) Print(msg,arg)
23 #define fglmASSERT(ignore1,ignore2)
24 
25 // internal Version: 1.10.1.4
26 // Some data types needed by the fglm algorithm. claptmpl.cc has to know them.
27 class fglmSelem
28 {
29 public:
30  int * divisors;
31  poly monom;
32  int numVars;
33  fglmSelem( poly p, int var );
34 
35  void cleanup();
36  BOOLEAN isBasisOrEdge() const { return ( (divisors[0] == numVars) ? TRUE : FALSE ); }
37  void newDivisor( int var ) { divisors[ ++divisors[0] ]= var; }
38 //#ifndef NOSTREAMIO
39 //friend OSTREAM & operator <<(OSTREAM &, fglmSelem);
40 //#endif
41 };
42 //#ifndef NOSTREAMIO
43 //inline OSTREAM & operator <<(OSTREAM & os, fglmSelem) { return os;};
44 //#endif
45 
46 class fglmDelem
47 {
48 public:
49  poly monom;
52  int var;
53  fglmDelem( poly & m, fglmVector mv, int v );
54 
55  void cleanup();
56  BOOLEAN isBasisOrEdge() const { return ( (insertions == 0) ? TRUE : FALSE ); }
57  void newDivisor() { insertions--; }
58 //#ifndef NOSTREAMIO
59 //friend OSTREAM & operator <<(OSTREAM &, fglmDelem);
60 //#endif
61 };
62 //#ifndef NOSTREAMIO
63 //inline OSTREAM & operator <<(OSTREAM & os, fglmDelem) { return os;};
64 //#endif
65 
66 // fglmzero(...):
67 // The fglm algorithm for 0-dimensional ideals. ( fglmzero is defined in fglmzero.cc )
68 // Calculates the reduced groebner basis of sourceIdeal in destRing.
69 // The sourceIdeal has to be a reduced, 0-dimensional groebner basis in sourceRing.
70 // Warning: There is no check, if the ideal is really 0-dimensional and minimal.
71 // If it is minimal but not reduced, then it returns FALSE, otherwise TRUE.
72 // Warning: There is no check, if the rings are compatible for fglm (see
73 // fglm.cc for functions to check this)
74 // if switchBack==TRUE, then the procedure sets the ring as currentRing which was
75 // current when it was called ( When called there may be currRing != sourceRing ).
76 // if switchBack==FALSE, then currRing==destRing at the end.
77 // if deleteIdeal==TRUE then sourceIdeal is deleted (in any case, even if the
78 // procedure fails)
79 // if deleteIdeal==FALSE, then nothing happens to sourceIdeal
80 BOOLEAN
81 fglmzero( ring sourceRing, ideal & sourceIdeal, ring destRing, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
82 
83 BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
84 
85 poly fglmLinearCombination( ideal source, poly monset );
86 poly fglmNewLinearCombination( ideal source, poly monset );
87 #endif
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int m
Definition: cfEzgcd.cc:128
int p
Definition: cfModGcd.cc:4080
Definition: fglm.h:47
int insertions
Definition: fglm.h:51
fglmVector v
Definition: fglm.h:50
poly monom
Definition: fglm.h:49
int var
Definition: fglm.h:52
void cleanup()
Definition: fglmzero.cc:713
void newDivisor()
Definition: fglm.h:57
BOOLEAN isBasisOrEdge() const
Definition: fglm.h:56
fglmDelem(poly &m, fglmVector mv, int v)
The new basis.
Definition: fglmzero.cc:699
Definition: fglm.h:28
poly monom
Definition: fglm.h:31
fglmSelem(poly p, int var)
Definition: fglmzero.cc:319
void cleanup()
Definition: fglmzero.cc:330
int * divisors
Definition: fglm.h:30
int numVars
Definition: fglm.h:32
void newDivisor(int var)
Definition: fglm.h:37
BOOLEAN isBasisOrEdge() const
Definition: fglm.h:36
poly fglmLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:415
BOOLEAN fglmzero(ring sourceRing, ideal &sourceIdeal, ring destRing, ideal &destideal, BOOLEAN switchBack=TRUE, BOOLEAN deleteIdeal=FALSE)
Definition: fglmzero.cc:1193
BOOLEAN fglmquot(ideal sourceIdeal, poly quot, ideal &destIdeal)
Definition: fglmzero.cc:1218
poly fglmNewLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:153
Compatiblity layer for legacy polynomial operations (over currRing)