source: git/kernel/fglm.h @ 854405

spielwiese
Last change on this file since 854405 was f0549c8, checked in by Christian Eder, 12 years ago
fixes Manual tests: fglm and stdfglm
  • Property mode set to 100644
File size: 2.8 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id$
3
4/****************************************
5*  Computer Algebra System SINGULAR     *
6****************************************/
7/*
8* ABSTRACT - The FGLM-Algorithm
9*   The main header file for the fglm algorithm
10*   (See fglm.cc for details)
11*/
12
13#ifndef FGLM_H
14#define FGLM_H
15
16#ifdef HAVE_FACTORY
17
18#include <kernel/polys.h>
19#include <kernel/structs.h>
20#include <kernel/fglmvec.h>
21
22#define PROT(msg)
23#define STICKYPROT(msg) if (BTEST1(OPT_PROT)) Print(msg)
24#define PROT2(msg,arg)
25#define STICKYPROT2(msg,arg) if (BTEST1(OPT_PROT)) Print(msg,arg)
26#define fglmASSERT(ignore1,ignore2)
27
28// internal Version: 1.10.1.4
29// Some data types needed by the fglm algorithm. claptmpl.cc has to know them.
30class fglmSelem
31{
32public:
33    int * divisors;
34    poly monom;
35    int numVars;
36    fglmSelem( poly p, int var );
37
38    void cleanup();
39    BOOLEAN isBasisOrEdge() const { return ( (divisors[0] == numVars) ? TRUE : FALSE ); }
40    void newDivisor( int var ) { divisors[ ++divisors[0] ]= var; }
41//#ifndef NOSTREAMIO
42//friend OSTREAM & operator <<(OSTREAM &, fglmSelem);
43//#endif
44};
45//#ifndef NOSTREAMIO
46//inline OSTREAM & operator <<(OSTREAM & os, fglmSelem) { return os;};
47//#endif
48
49class fglmDelem
50{
51public:
52    poly monom;
53    fglmVector v;
54    int insertions;
55    int var;
56    fglmDelem( poly & m, fglmVector mv, int v );
57
58    void cleanup();
59    BOOLEAN isBasisOrEdge() const { return ( (insertions == 0) ? TRUE : FALSE ); }
60    void newDivisor() { insertions--; }
61//#ifndef NOSTREAMIO
62//friend OSTREAM & operator <<(OSTREAM &, fglmDelem);
63//#endif
64};
65//#ifndef NOSTREAMIO
66//inline OSTREAM & operator <<(OSTREAM & os, fglmDelem) { return os;};
67//#endif
68
69// fglmzero(...):
70// The fglm algorithm for 0-dimensional ideals. ( fglmzero is defined in fglmzero.cc )
71// Calculates the reduced groebner basis of sourceIdeal in destRing.
72// The sourceIdeal has to be a reduced, 0-dimensional groebner basis in sourceRing.
73// Warning: There is no check, if the ideal is really 0-dimensional and minimal.
74// If it is minimal but not reduced, then it returns FALSE, otherwise TRUE.
75// Warning: There is no check, if the rings are compatible for fglm (see
76// fglm.cc for functions to check this)
77// if switchBack==TRUE, then the procedure sets the ring as currentRing which was
78// current when it was called ( When called there may be currRing != sourceRing ).
79// if switchBack==FALSE, then currRing==destRing at the end.
80// if deleteIdeal==TRUE then sourceIdeal is deleted (in any case, even if the
81// procedure fails)
82// if deleteIdeal==FALSE, then nothing happens to sourceIdeal
83BOOLEAN
84fglmzero( ring sourceRing, ideal & sourceIdeal, ring destRing, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
85
86BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
87
88#endif
89#endif
Note: See TracBrowser for help on using the repository browser.