File: app_ismarkedgroebnerbasis.cpp

package info (click to toggle)
gfan 0.3dfsg-1.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,016 kB
  • sloc: cpp: 17,728; makefile: 251
file content (42 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "vektor.h"
#include "printer.h"
#include "parser.h"
#include "gfanapplication.h"
#include "newtonpolytope.h"
#include "buchberger.h"
#include "wallideal.h"
#include "log.h"

class IsMarkedGroebnerBasisApplication : public GFanApplication
{
public:
  const char *helpText()
  {
    return "This program checks if a set of marked polynomials is a Groebner basis with respect to its marking. First it is checked if the markings are consistent with respect to a positive vector. Then Buchberger's S-criterion is checked. The output is boolean value.\n";
  }
  IsMarkedGroebnerBasisApplication()
  {
    registerOptions();
  }
  char *name()
  {
    return "_ismarkedgroebnerbasis";
  }
  int main()
  {
    FileParser P(Stdin);
    PolynomialSet g=P.parsePolynomialSetWithRing();

    bool isConsistent=isMarkingConsistent(g);

    log1 fprintf(Stderr,"Is marking consistent:%i\n",isConsistent);
    bool isGroebnerBasis=isConsistent;
    if(isGroebnerBasis)
      isGroebnerBasis=isMarkedGroebnerBasis(g);
    fprintf(Stdout,isGroebnerBasis?"true\n":"false\n");

    return 0;
  }
};

static IsMarkedGroebnerBasisApplication theApplication;