source: git/kernel/fglm.h @ 650f2d8

fieker-DuValspielwiese
Last change on this file since 650f2d8 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
RevLine 
[35aab3]1// emacs edit mode for this file is -*- C++ -*-
[341696]2// $Id$
[35aab3]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
[6eccc9]16#ifdef HAVE_FACTORY
[b1dfaf]17#include <factory/factory.h>
[35aab3]18
[599326]19#include <kernel/polys.h>
20#include <kernel/fglmvec.h>
[35aab3]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
[2d10dab]42friend OSTREAM & operator <<(OSTREAM &, fglmSelem);
[35aab3]43#endif
44};
45#ifndef NOSTREAMIO
[2d10dab]46inline OSTREAM & operator <<(OSTREAM & os, fglmSelem) { return os;};
[35aab3]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
[2d10dab]62friend OSTREAM & operator <<(OSTREAM &, fglmDelem);
[35aab3]63#endif
64};
65#ifndef NOSTREAMIO
[2d10dab]66inline OSTREAM & operator <<(OSTREAM & os, fglmDelem) { return os;};
[35aab3]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
[098f98f]84fglmzero( ring sourceRing, ideal & sourceIdeal, idhdl destRingHdl, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
[35aab3]85
[6eccc9]86BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
[35aab3]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.
[6eccc9]94BOOLEAN fglmProc( leftv result, leftv first, leftv second );
[35aab3]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.
[6eccc9]104BOOLEAN fglmQuotProc( leftv result, leftv first, leftv second );
[35aab3]105
106// FindUnivariatePolys (test)
[6eccc9]107BOOLEAN FindUnivariateWrapper( ideal source, ideal & dest );
[35aab3]108
109// wrapper for FindUnivariatePolys (test)
[6eccc9]110BOOLEAN findUniProc( leftv result, leftv first);
[35aab3]111
112// homogeneous FGLM
[6eccc9]113ideal fglmhomProc(leftv first, leftv second);
[35aab3]114#endif
115#endif
Note: See TracBrowser for help on using the repository browser.