source: git/kernel/fglm.h @ 1450c9

spielwiese
Last change on this file since 1450c9 was 1450c9, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: moved interpreter-related FGLM declarations to Singular/fglm.h FIX: List template requires an "factory/templates/ftmpl_list.cc" include - UGLY!!!
  • 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/fglmvec.h>
20
21#define PROT(msg)
22#define STICKYPROT(msg) if (BTEST1(OPT_PROT)) Print(msg)
23#define PROT2(msg,arg)
24#define STICKYPROT2(msg,arg) if (BTEST1(OPT_PROT)) Print(msg,arg)
25#define fglmASSERT(ignore1,ignore2)
26
27// internal Version: 1.10.1.4
28// Some data types needed by the fglm algorithm. claptmpl.cc has to know them.
29class fglmSelem
30{
31public:
32    int * divisors;
33    poly monom;
34    int numVars;
35    fglmSelem( poly p, int var );
36
37    void cleanup();
38    BOOLEAN isBasisOrEdge() const { return ( (divisors[0] == numVars) ? TRUE : FALSE ); }
39    void newDivisor( int var ) { divisors[ ++divisors[0] ]= var; }
40//#ifndef NOSTREAMIO
41//friend OSTREAM & operator <<(OSTREAM &, fglmSelem);
42//#endif
43};
44//#ifndef NOSTREAMIO
45//inline OSTREAM & operator <<(OSTREAM & os, fglmSelem) { return os;};
46//#endif
47
48class fglmDelem
49{
50public:
51    poly monom;
52    fglmVector v;
53    int insertions;
54    int var;
55    fglmDelem( poly & m, fglmVector mv, int v );
56
57    void cleanup();
58    BOOLEAN isBasisOrEdge() const { return ( (insertions == 0) ? TRUE : FALSE ); }
59    void newDivisor() { insertions--; }
60//#ifndef NOSTREAMIO
61//friend OSTREAM & operator <<(OSTREAM &, fglmDelem);
62//#endif
63};
64//#ifndef NOSTREAMIO
65//inline OSTREAM & operator <<(OSTREAM & os, fglmDelem) { return os;};
66//#endif
67
68// fglmzero(...):
69// The fglm algorithm for 0-dimensional ideals. ( fglmzero is defined in fglmzero.cc )
70// Calculates the reduced groebner basis of sourceIdeal in destRing.
71// The sourceIdeal has to be a reduced, 0-dimensional groebner basis in sourceRing.
72// Warning: There is no check, if the ideal is really 0-dimensional and minimal.
73// If it is minimal but not reduced, then it returns FALSE, otherwise TRUE.
74// Warning: There is no check, if the rings are compatible for fglm (see
75// fglm.cc for functions to check this)
76// if switchBack==TRUE, then the procedure sets the ring as currentRing which was
77// current when it was called ( When called there may be currRing != sourceRing ).
78// if switchBack==FALSE, then currRing==destRing at the end.
79// if deleteIdeal==TRUE then sourceIdeal is deleted (in any case, even if the
80// procedure fails)
81// if deleteIdeal==FALSE, then nothing happens to sourceIdeal
82BOOLEAN
83fglmzero( ring sourceRing, ideal & sourceIdeal, idhdl destRingHdl, ideal & destideal, BOOLEAN switchBack = TRUE, BOOLEAN deleteIdeal = FALSE );
84
85BOOLEAN fglmquot( ideal sourceIdeal, poly quot, ideal & destIdeal );
86
87#endif
88#endif
Note: See TracBrowser for help on using the repository browser.