source: git/kernel/fglm/fglm.h @ 066288

spielwiese
Last change on this file since 066288 was 066288, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Separating headers: kernel/fglm/ NOTE: in this case git was able to detect the movement of headers despite minor changes to them, in general if git fails to do that one will get separate DELETION and ADDITION of a new file which is to be avoided e.g. at the cost of an extra commit (with all the changes)
  • Property mode set to 100644
File size: 2.8 KB
Line 
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.
27class fglmSelem
28{
29public:
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
46class fglmDelem
47{
48public:
49    poly monom;
50    fglmVector v;
51    int insertions;
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
80BOOLEAN
81fglmzero( ring sourceRing, ideal & sourceIdeal, ring destRing, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
82
83BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
84
85#endif
Note: See TracBrowser for help on using the repository browser.