source: git/kernel/fglm.h @ fec53d

fieker-DuValspielwiese
Last change on this file since fec53d was b1dfaf, checked in by Frank Seelisch <seelisch@…>, 14 years ago
patch from Kai (checked for problems under Windows OS: no problems) git-svn-id: file:///usr/local/Singular/svn/trunk@13210 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.9 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#include <factory/factory.h>
18
19#include <kernel/polys.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
42friend OSTREAM & operator <<(OSTREAM &, fglmSelem);
43#endif
44};
45#ifndef NOSTREAMIO
46inline 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
62friend OSTREAM & operator <<(OSTREAM &, fglmDelem);
63#endif
64};
65#ifndef NOSTREAMIO
66inline 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, idhdl destRingHdl, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
85
86BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
87
88// fglmproc(...):
89// The procedure which has to be called from the interpreter for fglm.
90// first is the sourceRing, second is the given ideal in sourceRing.
91// Returns the groebnerbasis of the sourceIdeal in the currentRing.
92// Checks, if the ideal is really a reduced groebner basis of a
93// 0-dimensional Ideal. Returns TRUE if an error occoured.
94BOOLEAN fglmProc( leftv result, leftv first, leftv second );
95
96// fglmquotproc(...):
97// The procedure which has to be called from the interpreter for fglmquot.
98// first is the ideal I, second is the polynomial q. The polynomial must
99// be reduced with respect to I.
100// Returns the groebnerbasis of I:q in the currentRing.
101// Checks, if the ideal is really a reduced groebner basis of a
102// 0-dimensional Ideal and if q is really reduced.
103//  Returns TRUE if an error occoured.
104BOOLEAN fglmQuotProc( leftv result, leftv first, leftv second );
105
106// FindUnivariatePolys (test)
107BOOLEAN FindUnivariateWrapper( ideal source, ideal & dest );
108
109// wrapper for FindUnivariatePolys (test)
110BOOLEAN findUniProc( leftv result, leftv first);
111
112// homogeneous FGLM
113ideal fglmhomProc(leftv first, leftv second);
114#endif
115#endif
Note: See TracBrowser for help on using the repository browser.